Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
134 views

I have a Rad Grid with 
    <MasterTableView EditMode="PopUp"

 

 

 

    <EditFormSettings EditFormType="Template" CaptionFormatString="Entity Properties..." PopUpSettings-Modal="true" >

 

 

 


Using an Object DataSource

 

 

<asp:ObjectDataSource ID="EntityObjectDataSource" runat="server"

 

 

DataObjectTypeName="Namespace.Entities.Enity"

 

 

DeleteMethod="Delete" InsertMethod="Insert" SelectMethod="GetAll"

 

 

TypeName="Namespace.BusinessServices.EntityServices.EntityController"

 

 

UpdateMethod="Update" OldValuesParameterFormatString="original_{0}">

 

 

 

</asp:ObjectDataSource>

 

 

 

I used netTiers to gen service/Entity/ and data access - I have an abstraction layer (controllers) wrapping the net tiers services.

Amongst the controls, I have two text boxes UpdateByTextBox and UpdateDateText Box,
I would like to set these values once the user clicks the 'Save' command button.

(I was able to figure out how to set my CreateByTextBox and CreateDateTextBox by using the following
protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

 

{

 

    if

 

(e.CommandName == RadGrid.InitInsertCommandName)

 

    {

 

        //cancel the default operation

 

        e.Canceled =

true;

 

 

        //Prepare an IDictionary with the predefined values

 

        System.Collections.Specialized.

ListDictionary newValues = new System.Collections.Specialized.ListDictionary() ;

 

 

        //set default value(s)        

 

        newValues[

"CreateBy"] = m_CurrentUserIdentityName; // initialized in page constructor

 

        newValues[

"CreateDate"] = DateTime.Now.ToString();

 

 

        //Insert the item and rebind

 

 

 

        e.Item.OwnerTableView.InsertItem(newValues);

 

    }

Any suggestions/questions or help is greatly appreciated...

Emad
Top achievements
Rank 1
 answered on 25 Dec 2011
0 answers
57 views
hello team...
I m new telerik control...
my code doesnt work-->
  <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"  >
                            <AjaxSettings>
                                <telerik:AjaxSetting AjaxControlID="checkEngelliyim">
                                    <UpdatedControls>
                                        <telerik:AjaxUpdatedControl ControlID="comboEngelli" />
                                        <telerik:AjaxUpdatedControl ControlID="comboYuzde" />
                                        <telerik:AjaxUpdatedControl ControlID="txtEngelliAciklama" />
                                    </UpdatedControls>
                                </telerik:AjaxSetting>
                            </AjaxSettings>
                        </telerik:RadAjaxManager>

    <td width="5%" style="padding-bottom:5px">
                                    <asp:CheckBox ID="checkEngelliyim" Text="" runat="server" AutoPostBack="True"
                                        oncheckedchanged="checkEngelliyim_CheckedChanged" />
                                </td>
(aspx)
     protected void checkEngelliyim_CheckedChanged(object sender, EventArgs e)
        {
            txtEngelliAciklama.Enabled = checkEngelliyim.Checked;
            comboEngelli.Enabled = checkEngelliyim.Checked;
            comboYuzde.Enabled = checkEngelliyim.Checked;
        }
(cs code)

checkEngelliyim is checkbox and auto postback true

I m getting java script error in i.e  explorer mozilla doesnt fire error...
and same code is working another page....I couldnt understand this....I m very bored

Selami
Top achievements
Rank 1
 asked on 24 Dec 2011
1 answer
118 views
I have a simple page in which I have a RadComboBox and a RadDatePicker. 
All works fine, until I add a second RadComboBox.
At this point neither the RadDatePicker nor the second RadComboBox function. 
If I take out the second RadComboBox, all is well again.

Any Thoughts?


TraingWizard_Step_1.aspx....

<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/TrainingWizard.Master" CodeBehind="TrainingWizard_Step_1.aspx.vb" Inherits="TrainingWizard.TrainingWizard_Step_1" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <style type = "text/css">
        .a, .a:active, .a:link, .a:visited{color:Blue; font-size:large; width:92%; text-align:left; text-decoration:none; font-variant:small-caps; margin:auto auto auto 48px;}
        .a:hover{color:Red; font-size:large; width:92%; text-align:left; text-decoration:none; font-variant:small-caps; margin:auto auto auto 48px;}
    </style>
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" runat="server">
    <div style = "width:98%;text-align:center;">
         
            <br /><br />
            <h2>
                Step 1 - Company Name
            </h2>
            <br />
         
                    <telerik:RadComboBox ID="rcbCompanies" Runat="server"                   
                        Width="200px" Height="140px"
                        EmptyMessage="Company Name"
                        DataSourceID="SqlDataSource1" DataTextField="rcbName" DataValueField="CompanyID"                   
                        allowcustomtext="false" Filter="Contains"
                        EnableAutomaticLoadOnDemand="true"
                        ItemsPerRequest="10"
                        ShowMoreResultsBox="true"
                        EnableVirtualScrolling="true">
                    </telerik:RadComboBox><br />
                    <asp:RequiredFieldValidator ID="Validator1" ControlToValidate="rcbCompanies" ForeColor="Red" Text="This is required Information!" runat="server" />
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                        ConnectionString="<%$ ConnectionStrings:SafetyPlusWebConnectionString %>"
                        SelectCommand="SELECT CompanyID, Company_Code + ' | '  + Name as rcbName FROM [Companies] WHERE ([Active] = 1) ORDER BY [Company_Code]">
                    </asp:SqlDataSource>                                       
                    <br /><br />
         
                  
                     
                    <h2>
                        Step 2 - Course Details
                    </h2>                    
                    <br />
         
                 
             
            <telerik:RadDatePicker ID="rdpTrainingDate" runat="server" ZIndex="30001" AutoPostBack="true" DateInput-EmptyMessage="Training Date"/><br />
            <asp:RequiredFieldValidator ID="Validator2" ControlToValidate="rdpTrainingDate" ForeColor="Red" Text="This is required Information!" runat="server" />
            <br /><br />
         
 
                    <telerik:RadComboBox ID="rcbTrainingType" Runat="server"                   
                        Width="200px" Height="140px" AutoPostBack="true"
                        EmptyMessage="Training Type"
                        OnClientSelectedIndexChanged="Training_Type_Picked">            
                <Items>
                    <telerik:RadComboBoxItem Text="Toolbox Talk" Value="1"></telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem Text="Instructor Led" Value="2" ></telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem Text="Computer Based Training" Value="3"></telerik:RadComboBoxItem>
                    <telerik:RadComboBoxItem Text="Other" Value="4"></telerik:RadComboBoxItem>
                </Items>
            </telerik:RadComboBox>
            <asp:RequiredFieldValidator ID="Validator3" ControlToValidate="rcbTrainingType" ForeColor="Red" Text="This is required Information!" runat="server" />
            <br />      
                    
         
         
            <br /><br />          
            <asp:TextBox ID="tbInstructor" runat="server" Width="200" Text="Instructor Name" Visible="false"></asp:TextBox>
            <br /><br />
         
         
        <asp:Button ID="btnNext" runat="server" Text="Next" />
 
        
    </div>
     
</asp:Content>
Cecil
Top achievements
Rank 1
 answered on 24 Dec 2011
2 answers
241 views
Good Morning,
 I'm new to use a Telerik components and obviously I've have a problem.... :-D. So, the my problem is how to upload Documents (like DOC, Word, Excell ecc ecc) into a MS SQL Server with RadAsynUpload or RadUpload. In this moment I use FileUpload (MS VisualStudio 2010 Component) to uploading a documents, and this working fine but i would like use RadComponent to do this. So the VB code that I use is :

-- Upload  --
Private Function uploadDoc(ByVal oFileUpload As FileUpload) As Boolean

        Dim blnRet As Boolean = False
        Dim oBinaryReader As New IO.BinaryReader(oFileUpload.PostedFile.InputStream)
        Dim oByteArray As Byte() = oBinaryReader.ReadBytes(CInt(oFileUpload.PostedFile.ContentLength))

        oBinaryReader.Close()

        Dim nTkt As String = lbl_NumProt.Text
        Dim TKTdb As New TKTdbDataContext
        Dim oRequest = (From tbl In TKTdb.T_PROTO_INs Where (tbl.Num_Prot = nTkt) Select tbl).First

        oRequest.AttachFilename = oFileUpload.FileName
        oRequest.AttachContentType = oFileUpload.PostedFile.ContentType
        oRequest.AttachFileSize = oByteArray.Length
        oRequest.AttachData = oByteArray

        Try
            TKTdb.SubmitChanges()
            blnRet = True
        Catch ex As Exception
            Throw New System.Exception(ex.Message)
        End Try
        Return blnRet

    End Function

-- Download --
Shared Sub getOwnerAttachDoc(ByVal nTkt As String)

        Dim blnRet As Boolean = False
        Dim TKTdb As New TKTdbDataContext
        Dim oRequest = (From tbl In TKTdb.T_PROTO_INs Where (tbl.Num_Prot = nTkt) Select tbl.AttachContentType, tbl.AttachData, tbl.AttachFilename, tbl.AttachFileSize).First

        Dim Filename As String = HttpContext.Current.Server.UrlEncode(oRequest.AttachFilename)
        Dim ContenType As String = oRequest.AttachContentType
        Dim FileSize As String = oRequest.AttachFileSize

        HttpContext.Current.Response.Clear()
        HttpContext.Current.Response.ContentType = "application/octet-stream"
        HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment; filename=" & Filename & "")
        HttpContext.Current.Response.AppendHeader("Content-Lenght", FileSize)
        HttpContext.Current.Response.BinaryWrite(oRequest.AttachData.ToArray)
        HttpContext.Current.Response.Flush()
        HttpContext.Current.Response.End()

    End Sub

Is possible to migrate that VB Code if I want use RadUploadControl or RadAsyncControl?

Thanks
Paolo
Richard
Top achievements
Rank 1
 answered on 23 Dec 2011
1 answer
124 views
Hello People.
Im trying to get id of selected row as asp.net code bellow:

                    <telerik:RadGrid ID="grdProCodes" OnPreRender="grdProCodes_PreRender" AllowMultiRowSelection="true" Visible="true" AutoGenerateColumns="false"
                        runat="server">
                        <ClientSettings EnableRowHoverStyle="true">
                            <Selecting AllowRowSelect="true" />
                        </ClientSettings>

                        <MasterTableView>
                            <Columns>
                                <telerik:GridClientSelectColumn DataTextField="Id" UniqueName="idItemSelected" HeaderStyle-Width="50"
                                    HeaderText="#">

                                </telerik:GridClientSelectColumn>
                                <telerik:GridBoundColumn DataField="CorpDiscountNumber" HeaderStyle-Width="150" HeaderText="Corp. Discount Number">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="PromotionCode" HeaderStyle-Width="150" HeaderText="Promotional Code">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="PromotionalTitle" HeaderText="Descrição">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="StartDate" HeaderStyle-Width="150" HeaderText="Data Inicial"
                                    DataFormatString="{0:dd/MM/yyyy}">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="EndDate" HeaderStyle-Width="150" HeaderText="Data Final"
                                    DataFormatString="{0:dd/MM/yyyy}">
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="Active" HeaderStyle-Width="100" HeaderText="Ativo">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>

When I click in button to do a Post Back in my page, my RadGrid can't detect all my checkbox is checked as the follow code bellow:

                foreach (GridDataItem itemGrid in grdProCodes.MasterTableView.Items)
                {
                    if (itemGrid.Selected)
                    {
                        int idItemSelected = Convert.ToInt32(itemGrid["idItemSelected"]);
                    }
                }

Best Regards,

Milton Camara

Pavlina
Telerik team
 answered on 23 Dec 2011
2 answers
181 views
I'm implementing an interface similar to the one shown here:

http://demos.telerik.com/aspnet-ajax/treelist/examples/itemsdragdrop/defaultcs.aspx 

and I am able to fire an event that has all the information about the dragged item that I need in my code behind. However I'm struggling trying to find out what item the item was dropped on. I need to accomplish this because I need to know whether to a) add the new item as a child of the parent when dropped on an outer node, or b) add the new item as a sibling after the drop target when dropped on an inner node. I also need the identity (some clientDataKeyItem?) for the drop target so that I act on it in the code behind. Any help on this would be appreciated.

Steve
neebs
Top achievements
Rank 2
 answered on 23 Dec 2011
0 answers
83 views
Hello, 

Can any one help me on How to Filter the Rad grid; One of the column as drop down list binded. all other columns are having normal telerik filter.   Everything records should filter dynamically. I am using entity framework 4.1. 



 
Lakshman
Top achievements
Rank 1
 asked on 23 Dec 2011
3 answers
97 views
All,

I have a grid which I dynamically create on server side.
As the Grid populates a large number of entries, I use custom pagine to retrieve only few rows at a time.
The problem is that Fitering is not working correctly when used with custom paging. The filter only filters data that appears in the current dataset (displayed page) and so provides only part of the actual number of rows that should return.
I tried using the technique displayed in http://demos.telerik.com/aspnet-ajax/grid/examples/programming/custompaging/defaultcs.aspx, but the example do not work for me and in fact it seems that it is not working correctly at all.

Any ideas?

Regards,
Tzach.
Pavlina
Telerik team
 answered on 23 Dec 2011
1 answer
463 views
I want to bind states combo box based on which country is selected but when i try to do that programmatically i get the following error
"There is no assigned data source. Unable to complete callback request."

Here is my code
<telerik:RadComboBox ID="ddlState" runat="server" AllowCustomText="true" MaxHeight="100px" EnableAutomaticLoadOnDemand="true"></telerik:RadComboBox>
    public void fillState(long countryId)
    {
        g_frontendDataContext fdc = new g_frontendDataContext();
        try
        {
            var states = from i in fdc.tbl_sfl_states
                         where i.fk_country_id == countryId
                         select new
                         {
                             stateId = i.pk_state_id,
                             stateName = i.state_name
                         };
            ddlState.DataSource = states.ToList();          
            ddlState.DataBind();           
            ddlState.DataTextField = "stateName";
            ddlState.DataValueField = "stateId";          
            fdc.Dispose();
        }
}
Ivana
Telerik team
 answered on 23 Dec 2011
3 answers
121 views
Hi ,

I have given the attribute like this
HeaderStyle-CssClass="tdheaderblue"
 ItemStyle-CssClass="tdheaderbluefirst"


where the tdheaderblue is a css class


.tdheaderblue th
{
background-color: #d5e2e9;
height: 16px;
color: #414141;
font-size: 12px;
border-right: 1px solid White;
padding: 3px 10px 3px 10px;
text-align: center;
}


but the items are able to pickup the css, but the header is not able to pickup the css.


Can any one please help me out ?


Thanks in advance !


regards,
Prasad Jidugu

Pavlina
Telerik team
 answered on 23 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?