Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
256 views
I discovered that RadTreeView findControl only works in finding Telerik controls in a NodeTemplate, but does not work when trying to find an ASP control embedded in a NodeTemplate.  This forced me to change my NodeTemplate column from <asp:dropdownlist> to <telerik:RadDropDownList>. I dynamically add values to the dropdownlist server side in NodeDataBound (see code below).  This worked great with <asp:dropdownlist> but with <telerik:RadDropDownList> there are several issues:  1) values aren't displaying in the dropdownlist,  2) it appears there is a dropdown behind a dropdown, 3) dropdownlist width is incorrect.  I've attached an image showing RadTreeView using <telerik:RadDropDownList> versus <asp:dropdownlist>.  I want the solution using <telerik:RadDropDownList> to look exactly as it does using <asp:dropdownlist>.  Assistance in resolving this issue would be appreciated.  We are using Telerik Runtime Version v4.0.30319.  Thanks.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebFormRadDDL.aspx.cs" Inherits="WebApplication2.WebFormRadDDL" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<head runat="server">
    <title></title>
<!--Commenting out style stuff does not improve issues with RadDropDownList-->
<!--The style section below overrides Telerik skin to reduce the spacing between tree nodes.
Added background and border attributes to remove highlighting when selecting or mousing over a node.-->
<style type="text/css">
 
    div.RadTreeView
    {
        line-height: 16px !important;
    }
          
    div.RadTreeView .rtSp
    {
        height: 14px !important;
    }
          
    div.RadTreeView .rtHover .rtIn, div.RadTreeView .rtSelected .rtIn
    {
        background: none !important;
        border: none !important;
        padding: 1px 2px 1px !important;
    }
          
    div.RadTreeView .rtIn
    {
        padding: 1px 2px 1px !important;
    }
     
</style>
</head>
 
<body>
 
    <form id="form1" runat="server">
    <div>
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadTreeView ID="RadTreeView1" runat="server" 
        AutoGenerateColumns="False" OnNodeDataBound="RadTreeView1_NodeDataBound" OnNodeCreated="RadTreeView1_NodeCreated"
        DataFieldID="Node" DataFieldParentID="ParentNode" DataTextField="ParentNode" DataValueField="Description"
        Skin="Web20">   
        <NodeTemplate>
        <!-- don't make cellspacing too big or it messes with ddl activation-->
        <table cellspacing="10px">
            <tr>
            <td>
                <asp:Label runat="server" ID="lbl" Text='<%# DataBinder.Eval(Container, "Value") %>'></asp:Label>
            </td>
            <td></td>
            <td>
                <telerik:RadDropDownList ID="ddl" runat="server" DropDownHeight="15px" DropDownWidth="20px" Font-Size="10px" Enabled="true"> </telerik:RadDropDownList>
            </td>
            </tr>                 
         </table>
         </NodeTemplate>
     </telerik:RadTreeView>  
    </div>
    </form>
</body>
</html>
 
       protected void RadTreeView1_NodeDataBound(object sender, RadTreeNodeEventArgs e)
        {
 
            DataRowView item = e.Node.DataItem as DataRowView;
            string bold = item["Bold"].ToString();
            string validResponses = item["ValidResponses"].ToString();
            string responseRequired = item["ResponseRequired"].ToString() ;
            //RadTreeNode node = RadTreeView1.Nodes[0];
            RadDropDownList ddl = (RadDropDownList)e.Node.FindControl("ddl");
            Label lbl = (Label)e.Node.FindControl("lbl");
 
            if (bold == "Y")
            {
                lbl.Font.Bold = true;
            }
            if (responseRequired == "N")
            {
                ddl.Visible = false;
            }
            else
            {
                Array responses = validResponses.Split('|');
                ddl.Items.Add(new DropDownListItem("", ""));
                foreach (string response in responses)
                {
                 DropDownListItem ddlItem = new DropDownListItem(response, response);
                  ddl.Items.Add(ddlItem);
                }
            }
        }
Lynne
Top achievements
Rank 1
 answered on 22 Jul 2014
1 answer
955 views
Problem: The RadScriptManager is incompatible with the Ajax Control Toolkit (Version number 40412 and higher).

The following error appears when controls from the ACT are present on the page:
Microsoft JScript runtime error: AjaxControlToolkit requires ASP.NET Ajax 4.0 scripts. Ensure the correct version of the scripts are referenced. If you are using an ASP.NET ScriptManager, switch to the ToolkitScriptManager in AjaxControlToolkit.dll.

Solution for .NET 4.0 projects:  Upgrade the RadControls for ASP.NET AJAX version 2010.1.625 or newer.

Important: Make sure you use the .NET 4.0 build of both Telerik.Web.UI.dll and AjaxControlToolkit.dll

If upgrade is not option you can use the following workaround:
<telerik:RadScriptManager runat="server" EnableScriptCombine="false" /> 

Solution for .NET 3.5 projects: Override the references to MicrosoftAjax.js and MicrosoftAjaxWebForms.js to point to the ACT script files.

<telerik:RadScriptManager runat="server"
    <Scripts> 
        <asp:ScriptReference Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
            Name="MicrosoftAjax.js" Path="Scripts-40412/MicrosoftAjax.js" /> 
        <asp:ScriptReference Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 
            Name="MicrosoftAjaxWebForms.js" Path="Scripts-40412/MicrosoftAjaxWebForms.js" /> 
    </Scripts> 
</telerik:RadScriptManager> 
 

The script files are obtained by building the ACT from source. Sample project, including the scripts for version 40412, is attached.

Eyup
Telerik team
 answered on 22 Jul 2014
1 answer
76 views
Hi, I try to add new row to radGrid by this code (Add button)

PartDt.Rows.InsertAt(dr, 0);
dgdPart.CurrentPageIndex = 0;
dgdPart.DataSource = PartDt;
dgdPart.DataBind();
dgdPart.MasterTableView.Items[0].Edit = true;
dgdPart.Rebind();



   

After             dgdPart.Rebind();   code step into 

protected void dgdPart_ItemDataBound(object sender, GridItemEventArgs e)
{
           if (e.Item.IsInEditMode && e.Item is GridEditFormItem)
            {
                if (e.Item.ItemIndex > -1)
                {
                         RadComboBox cmbPart = (RadComboBox)dgdPart.Items[e.Item.ItemIndex].FindControl("radcmbPart");    //Error line
                          ....
}



I try to debug and see while e.Item.ItemIndex is 0 and the dgdPart.Items.Count is 0 at line "//Error line" so I got error "Index was out of range. Must be non-negative and less than the size of the collection."

I also found the dgdPart.Items.Count is 0 only in dgdPart_ItemDataBound, If I skip the erorr line above and continue until finish dgdPart_ItemDataBound, It comeback to dgdPart.Items.Count = 1

Could you suggest me to solve this problem?  Thanks!!



Below is my aspx code for this radGrid

<telerik:RadGrid ID="dgdPart" runat="server" AllowPaging="True" CellSpacing="0" GridLines="None" AutoGenerateColumns="False" OnEditCommand="dgdPart_EditCommand" OnNeedDataSource="dgdPart_NeedDataSource" OnCancelCommand="dgdPart_CancelCommand" OnItemDataBound="dgdPart_ItemDataBound" OnUpdateCommand="dgdPart_UpdateCommand">
                                                           <ClientSettings>
                                                               <Selecting CellSelectionMode="None">
                                                               </Selecting>
                                                           </ClientSettings>
                                                           <MasterTableView>
                                                               <CommandItemSettings ExportToPdfText="Export to PDF">
                                                               </CommandItemSettings>
                                                               <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                                                   <HeaderStyle Width="20px"></HeaderStyle>
                                                               </RowIndicatorColumn>
                                                               <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                                                   <HeaderStyle Width="20px"></HeaderStyle>
                                                               </ExpandCollapseColumn>
                                                               <Columns>
                                                                    <telerik:GridTemplateColumn FilterControlAltText="Filter CheckBoxTemplateColumn column" UniqueName="CheckBoxTemplateColumn">
                                                                                       <ItemTemplate>
                                                                                           <asp:CheckBox ID="chkToDelete" runat="server"/>
                                                                                       </ItemTemplate>
                                                                                       <ItemStyle HorizontalAlign="Center" VerticalAlign="Top" Width="20px" />
                                                                    </telerik:GridTemplateColumn>  
                                                                   <telerik:GridBoundColumn DataField="t_name" FilterControlAltText="Filter column column" HeaderText="อะไหล่" UniqueName="column">
                                                                   </telerik:GridBoundColumn>
                                                                   <telerik:GridBoundColumn DataField="life_time" FilterControlAltText="Filter column1 column" HeaderText="อายุการใช้งาน" UniqueName="column1">
                                                                   </telerik:GridBoundColumn>
                                                                   <telerik:GridBoundColumn DataField="start_date" FilterControlAltText="Filter column2 column" HeaderText="วันเริ่มต้นใช้งาน" UniqueName="column2">
                                                                   </telerik:GridBoundColumn>
                                                                   <telerik:GridBoundColumn DataField="expire_date" FilterControlAltText="Filter column3 column" HeaderText="วันสิ้นสุดใช้งาน" UniqueName="column3">
                                                                   </telerik:GridBoundColumn>
                                                                   <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column">
                                                                   </telerik:GridEditCommandColumn>
                                                               </Columns>
                                                               <EditFormSettings EditFormType="Template">
                                                                                 <EditColumn uniquename="edit_data_form"/>
                                                                                   <FormTemplate>
                                                                                      
                                                                                       <table>
                                                                                           <tr>
                                                                                               <td style="width:100px;height:20px">
                                                                                                   อะไหล่ :
                                                                                               </td>
                                                                                               <td>
                                                                                                   <telerik:RadComboBox ID="radcmbPart" runat="server"   Width="300px"></telerik:RadComboBox>
                                                                                               </td>
                                                                                           </tr>
                                                                                           <tr>
                                                                                               <td style="width:100px;height:20px">
                                                                                                   อายุการใช้งาน :
                                                                                               </td>
                                                                                               <td>
                                                                                                   <telerik:RadNumericTextBox ID="radtxtLiftTime" runat="server" Text='<%# Bind("life_time") %>' Width="100px"></telerik:RadNumericTextBox>
                                                                                               </td>
                                                                                           </tr>
                                                                                              <tr>
                                                                                               <td style="width:100px;height:20px">
                                                                                                   วันเริ่มต้นใช้งาน :
                                                                                               </td>
                                                                                               <td>
                                                                                                   <asp:TextBox ID="txtPartStartDate" Text='<%# Bind("start_date") %>' runat="server" ></asp:TextBox>
                                                                                                   <asp:CalendarExtender ID="calendarPartStartDate" Format="dd/MM/yyyy" runat="server" TargetControlID="txtPartStartDate"></asp:CalendarExtender>
                                                                                                   
                                                                                               </td>
                                                                                           </tr>
                                                                                            </tr>
                                                                                              <tr>
                                                                                               <td style="width:100px;height:20px">
                                                                                                   วันสิ้นสุดใช้งาน :
                                                                                               </td>
                                                                                               <td>
                                                                                                   <asp:TextBox ID="txtPartExpireDate" Text='<%# Bind("expire_date") %>' runat="server" ></asp:TextBox>
                                                                                                   <asp:CalendarExtender ID="calendarPartExpireDate" Format="dd/MM/yyyy" runat="server" TargetControlID="txtPartExpireDate"></asp:CalendarExtender>
                                                                                               </td>
                                                                                           </tr>
 
                                                                                           <tr>
                                                                                               <td>                                                                                       
                                                                                               </td>
                                                                                               <td>
                                                                                                   <asp:Button ID="btnUpdate" CommandName="Update" Text="Update" runat="server" />  <asp:Button ID="btnCancel" CommandName="Cancel" Text="Cancel" runat="server" />                                           
                                                                                               </td>
                                                                                           </tr>
                                                                                       </table>                                                               
                                                                                   </FormTemplate>
                                                                                   <PopUpSettings ScrollBars="None" />                           
                                                                           </EditFormSettings>
                                                           </MasterTableView>
                                                           <FilterMenu EnableImageSprites="False">
                                                           </FilterMenu>
                                                       </telerik:RadGrid>

Viktor Tachev
Telerik team
 answered on 22 Jul 2014
3 answers
829 views
Hi all,
I'm dinamically adding columns to my RadGrid.
I need to add a GridDateTimeColumn to show and allow the user change a time, so I need to display data in format HH:ss .
I am trying to do this using DataFormatString property but it doesn't work: I always see the standard format yyyy/MM/dd HH:mm:ss .

Here is my code:

                    GridDateTimeColumn col = new GridDateTimeColumn();
                    col.PickerType = GridDateTimeColumnPickerType.TimePicker;
                    col.DataField = "FIELD";
                    col.DataType = typeof(DateTime);
                    col.DataFormatString = "{0:HH mm}";
                    myRadGrid.MasterTableView.Columns.Add(col);

Can anyone help me?
Thanks in advance.
Daniele
Top achievements
Rank 1
 answered on 22 Jul 2014
5 answers
244 views
Stepwise Explanation

 ddlTest.clearItems();
 ddlTest.trackChanges();
ddlTest.clearSelection();

   for (var j = 0; j < heat_no.length - 1; j++) {
                                        var comboItem = new Telerik.Web.UI.RadComboBoxItem();

                                        comboItem.set_text(heat_no[j]);
                                        comboItem.set_value(heat_no[j]);

                                        ddl_cast_no.get_items().add(comboItem);
                                    }
  ddlTest.commitChanges();

1. Above Javascript Code is Executed and My Combobox is filled Perfectly
2. Now if this Code is executed again it Displays new results that is ok
3. Let me execute again .. No Problem in Display
4. I am Making a Postback on server for Some other work
5. After postback is Shows me my combobox has 3 times duplicated values(Not that we have executed it 3 times).

If the Code is two times executed the value will be 2 times Duplicate executed
If the Code is 5 times executed the value will be 5 times Duplicate executed

I want it Without Duplicate
Hope You Got My Point
Reply me as fast as Possible
Vishmay
Top achievements
Rank 1
 answered on 22 Jul 2014
1 answer
145 views
Hi Fellows,

Is there anyone has done exporting the inner grid data with the master/outer grid once clicking on the export button ?

Here is my aspx coding which may give you an idea :
001.<div class="wrapper" runat="server" id="pnlGeneralReport" visible="false">
002.                    <asp:ImageButton ID="DownloadCSV" ImageUrl="images/file-extension-csv-icon.png"
003.                        OnClick="DownloadCSV_Click" runat="server" CssClass="ImageButtons" />
004.                    <asp:ImageButton ID="generalReportHTML" runat="server" OnClick="generalReportHTML_Click" AlternateText="Html" ImageUrl="images/file-extension-xls-html-icon.png"
005.                        CssClass="pdfButton"></asp:ImageButton>
006.                    <asp:ImageButton ID="generalReportExcel" runat="server" OnClick="generalReportHTML_Click" AlternateText="ExcelML" ImageUrl="images/file-extension-xls-icon.png"
007.                        CssClass="pdfButton"></asp:ImageButton>
008.                    <asp:ImageButton ID="generalReportBiff" runat="server" OnClick="generalReportHTML_Click" AlternateText="Biff" ImageUrl="images/file-extension-xls-biff-icon.png"
009.                        CssClass="pdfButton"></asp:ImageButton>
010.                    <asp:ImageButton ID="DownloadPDF" runat="server" OnClick="DownloadPDF_Click" ImageUrl="images/file-extension-pdf-icon.png"
011.                        CssClass="pdfButton"></asp:ImageButton>
012.                    <br />
013.                    <telerik:RadGrid AutoGenerateColumns="False" ID="RadGrid1" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" runat="server" OnItemCommand="RadGrid1_ItemCommand" OnItemCreated="RadGrid1_ItemCreated" EnableLinqExpressions="true" HtmlEncode="true" OnNeedDataSource="RadGrid1_NeedDataSource"
014.                        ShowGroupPanel="True" CellSpacing="-1" GridLines="Both" Skin="Office2010Silver" EnableViewState="true" Width="100%">
015.                        <PagerStyle Mode="NextPrevAndNumeric" />
016.                        <GroupingSettings CaseSensitive="false" />
017.                        <ClientSettings AllowKeyboardNavigation="true">
018.                        </ClientSettings>
019.                        <ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true">
020.                            <Pdf PageHeight="210mm" PageWidth="297mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="45mm"
021.                                BorderStyle="Medium" BorderColor="#666666" PaperSize="A4">
022.                            </Pdf>
023.                        </ExportSettings>
024.                        <MasterTableView Width="100%" DataKeyNames="JobID" HierarchyLoadMode="ServerOnDemand">
025.                            <Columns>
026.                                <telerik:GridMaskedColumn DataField="JobID" HeaderText="JobID#"
027.                                    FilterControlWidth="50px" AutoPostBackOnFilter="false" CurrentFilterFunction="EqualTo"
028.                                    FilterDelay="2000" ShowFilterIcon="false" Mask="#####">
029.                                    <ColumnValidationSettings>
030.                                        <ModelErrorMessage Text=""></ModelErrorMessage>
031.                                    </ColumnValidationSettings>
032.                                </telerik:GridMaskedColumn>
033.                                <telerik:GridBoundColumn HeaderText="Customer Ref No" DataField="JobCustomerRefNo" UniqueName="JobCustomerRefNo"
034.                                    SortExpression="JobCustomerRefNo" HeaderStyle-Width="180px" FilterControlAltText="Filter JobCustomerRefNo column">
035.                                    <ColumnValidationSettings>
036.                                        <ModelErrorMessage Text=""></ModelErrorMessage>
037.                                    </ColumnValidationSettings>
038. 
039.                                </telerik:GridBoundColumn>
040.                                <telerik:GridBoundColumn DataField="JobTitle" FilterControlAltText="Filter JobTitle column" HeaderText="Job Title" SortExpression="JobTitle" UniqueName="JobTitle">
041.                                    <ColumnValidationSettings>
042.                                        <ModelErrorMessage Text="" />
043.                                    </ColumnValidationSettings>
044.                                </telerik:GridBoundColumn>
045.                                <telerik:GridDateTimeColumn DataField="JobBookedDate" PickerType="DatePicker" EnableTimeIndependentFiltering="true"
046.                                    DataFormatString="{0:dd/MM/yyyy HH:mm }" DataType="System.DateTime" FilterControlAltText="Filter JobBookedDate column" HeaderText="Job Booked Date" SortExpression="JobBookedDate" UniqueName="JobBookedDate">
047.                                    <ColumnValidationSettings>
048.                                        <ModelErrorMessage Text="" />
049.                                    </ColumnValidationSettings>
050.                                </telerik:GridDateTimeColumn>
051.                                <telerik:GridBoundColumn DataField="JobAddress1" FilterControlAltText="Filter JobAddress1 column" HeaderText="Address" SortExpression="JobAddress1" UniqueName="JobAddress1">
052.                                    <ColumnValidationSettings>
053.                                        <ModelErrorMessage Text="" />
054.                                    </ColumnValidationSettings>
055.                                </telerik:GridBoundColumn>
056.                                <telerik:GridBoundColumn DataField="JobSuburb" FilterControlAltText="Filter JobSuburb column" HeaderText="Suburb" SortExpression="JobSuburb" UniqueName="JobSuburb">
057.                                    <ColumnValidationSettings>
058.                                        <ModelErrorMessage Text="" />
059.                                    </ColumnValidationSettings>
060.                                </telerik:GridBoundColumn>
061.                                <telerik:GridBoundColumn DataField="JobPostCode" FilterControlAltText="Filter JobPostCode column" HeaderText="PostCode" SortExpression="JobPostCode" UniqueName="JobPostCode">
062.                                    <ColumnValidationSettings>
063.                                        <ModelErrorMessage Text="" />
064.                                    </ColumnValidationSettings>
065.                                </telerik:GridBoundColumn>
066.                                <telerik:GridBoundColumn DataField="JobState" FilterControlAltText="Filter JobState column" HeaderText="State" SortExpression="JobState" UniqueName="JobState">
067.                                    <ColumnValidationSettings>
068.                                        <ModelErrorMessage Text="" />
069.                                    </ColumnValidationSettings>
070.                                </telerik:GridBoundColumn>
071.                                <telerik:GridTemplateColumn DataField="JobStatusID" HeaderText="Status Type" UniqueName="JobStatusID"
072.                                    HeaderStyle-Width="200px" SortExpression="JobStatusID">
073.                                    <FilterTemplate>
074.                                        <telerik:RadComboBox ID="comboJobStatus" DataTextField="JobStatusName"
075.                                            DataValueField="JobStatusID" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("JobStatusID").CurrentFilterValue %>'
076.                                            runat="server" OnClientSelectedIndexChanged="JobStatusIndexChanged">
077.                                            <Items>
078.                                                <telerik:RadComboBoxItem Text="All" />
079.                                            </Items>
080.                                        </telerik:RadComboBox>
081.                                        <telerik:RadScriptBlock ID="RadScriptBlock3" runat="server">
082.                                            <script type="text/javascript">
083.                                                function JobStatusIndexChanged(sender, args) {
084.                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
085.                                                    tableView.filter("JobStatusID", args.get_item().get_value(), "EqualTo");
086.                                                }
087.                                            </script>
088.                                        </telerik:RadScriptBlock>
089.                                    </FilterTemplate>
090.                                    <ItemTemplate>
091.                                        <%# Eval("JobStatus") %>
092.                                    </ItemTemplate>
093.                                </telerik:GridTemplateColumn>
094.                                <telerik:GridTemplateColumn DataField="ClientID" HeaderText="Client" UniqueName="ClientID"
095.                                    HeaderStyle-Width="200px" SortExpression="ClientID">
096.                                    <FilterTemplate>
097.                                        <telerik:RadComboBox ID="comboClient" DataTextField="ClientName"
098.                                            DataValueField="ClientID" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ClientID").CurrentFilterValue %>'
099.                                            runat="server" OnClientSelectedIndexChanged="ClientIndexChanged">
100.                                            <Items>
101.                                                <telerik:RadComboBoxItem Text="All" />
102.                                            </Items>
103.                                        </telerik:RadComboBox>
104.                                        <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
105.                                            <script type="text/javascript">
106.                                                function ClientIndexChanged(sender, args) {
107.                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
108.                                                    tableView.filter("ClientID", args.get_item().get_value(), "EqualTo");
109.                                                }
110.                                            </script>
111.                                        </telerik:RadScriptBlock>
112.                                    </FilterTemplate>
113.                                    <ItemTemplate>
114.                                        <%# Eval("Client") %>
115.                                    </ItemTemplate>
116.                                </telerik:GridTemplateColumn>
117.                                <telerik:GridTemplateColumn DataField="AssignedStaffID" HeaderText="Staff" UniqueName="AssignedStaffID"
118.                                    HeaderStyle-Width="200px" SortExpression="AssignedStaffID">
119.                                    <FilterTemplate>
120.                                        <telerik:RadComboBox ID="comboStaff" DataTextField="StaffName"
121.                                            DataValueField="StaffID" Height="100px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("AssignedStaffID").CurrentFilterValue %>'
122.                                            runat="server" OnClientSelectedIndexChanged="StaffIndexChanged">
123.                                            <Items>
124.                                                <telerik:RadComboBoxItem Text="All" />
125.                                            </Items>
126.                                        </telerik:RadComboBox>
127.                                        <telerik:RadScriptBlock ID="RadScriptBlock10" runat="server">
128.                                            <script type="text/javascript">
129.                                                function StaffIndexChanged(sender, args) {
130.                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
131.                                                    tableView.filter("AssignedStaffID", args.get_item().get_value(), "EqualTo");
132.                                                }
133.                                            </script>
134.                                        </telerik:RadScriptBlock>
135.                                    </FilterTemplate>
136.                                    <ItemTemplate>
137.                                        <%# Eval("AssignedStaff") %>
138.                                    </ItemTemplate>
139.                                </telerik:GridTemplateColumn>
140.                            </Columns>
141.                            <NestedViewTemplate>
142.                                <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
143.                                    <telerik:RadGrid runat="server" ID="JobStatusGrid" OnNeedDataSource="JobStatusGrid_NeedDataSource">
144.                                        <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
145.                                            DataKeyNames="JobStatusHistoryID" PageSize="7" HierarchyLoadMode="Client">
146.                                            <Columns>
147.                                                <telerik:GridBoundColumn HeaderText="Status Type" HeaderButtonType="TextButton"
148.                                                    DataField="JobStatus" UniqueName="JobStatusID">
149.                                                </telerik:GridBoundColumn>
150.                                                <telerik:GridBoundColumn HeaderText="Created By" HeaderButtonType="TextButton"
151.                                                    DataField="CreatedBy" UniqueName="CreatedBy">
152.                                                </telerik:GridBoundColumn>
153.                                                <telerik:GridBoundColumn HeaderText="Created On" HeaderButtonType="TextButton"
154.                                                    DataField="CreatedOn" UniqueName="CreatedOn">
155.                                                </telerik:GridBoundColumn>
156.                                            </Columns>
157.                                        </MasterTableView>
158.                                    </telerik:RadGrid>
159.                                </asp:Panel>
160.                            </NestedViewTemplate>
161.                        </MasterTableView>
162.                        <ClientSettings AllowDragToGroup="true">
163.                            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
164.                        </ClientSettings>
165.                    </telerik:RadGrid>
166.                </div>

I appreciate your help.
Viktor Tachev
Telerik team
 answered on 22 Jul 2014
8 answers
1.0K+ views
Hi,

I am trying to achieve a post back on enter key pressed. I found out that the RadButton's property UseSubmitBehaviour doesn't do anything? I would expect if this is true, the button to be actually a submit button and if false to be a normal button. This seems not to be true here.

As I found out this is not working out, I tried using asp.net control Panel and it's property - DefaultButton to see if it's going to help, but it didn't.

I am using the latest version of the telerik ajax controls library. How can I achieve autopostback on enter? I don't want to subscribe to keypress events and watch for enter key. This should be built in. How can RadButton render input[type=submit] instead of input[type=button]?

Thanks,

Ivan.
Chris
Top achievements
Rank 1
 answered on 22 Jul 2014
10 answers
195 views
For the past day or so I have been seeing this message when creating a new style.

Failed to create skin!
A server error has occured.
We have been notified and will try to resolve it ASAP.
Sorry for the inconvenience.

Can anyone shed some light on this issue?
Thanks.
JON

PS. I was able to open an old style.zip file in the editor. I simply cannot create a new one.
Matt
Top achievements
Rank 1
 answered on 22 Jul 2014
1 answer
180 views
Seems like if you have a multiline radtextbox with a multilined emptymessage (containing CrLf's) AND a tooltip, the emptymessage is set as the value of the textbox.

If only using Lf's to seperate the lines it is working as expected


generated html that is working (without Cr's):
<input ...... value="{"enabled":true,"emptyMessage":"EmptyMsg1\nEmptyMsg2","validationText":"","valueAsString":"","lastSetTextBoxValue":"EmptyMsg1\nEmptyMsg2"}">

generated html that is working (with CrLf's):
<input value="{"enabled":true,"emptyMessage":"EmptyMsg1\r\nEmptyMsg2","validationText":"EmptyMsg1\nEmptyMsg2","valueAsString":"EmptyMsg1\nEmptyMsg2","lastSetTextBoxValue":"EmptyMsg1\nEmptyMsg2"}">

I've manually fixed this by removing any Cr's from the EmptyMessage, but seems like a strange bug as it is only a problem when a text for .Tooltip is used.
Viktor Tachev
Telerik team
 answered on 22 Jul 2014
6 answers
281 views

On a custom edit form for a grid, I have two bound decimal fields.
I want to update a third calculated textbox when the user changes any of the two bound fields.

I followed Dimo's example from an old post called "ascx editform with calculation textboxes when onfocus or onblur", but I was never able to make it work.

Could someone take a look on the attached screen and give me an idea on how to do this? Thanks

--------------
Obviously, I am trying to update the "Total Cost" textbox, if the user changes the Quantity, or the Unit Cost textboxes, which are both bound to the database.

Dimitrios
Top achievements
Rank 1
 answered on 22 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?