Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
391 views

I am using  a radgrid with the command items of insert and edit turned on.  I am using a form template for the edit/insert views.  In my form template i have multiple dropdown menus.  I am able to populate the first dropdown thru the itemDataBound event with no problem.  My question is how would i populate the next dropdown menu with what is selected in the previous drop down menu?    The dropdowns i am referring to are in the gridSections (radgrid) in the below markup.  The ddlQuestion dropdown is populated with data dependant on what is selected in the ddlSection dropdown.  In the selectedIndexChange for ddlSection I would have to access the edit form somehow.  I am not sure how to do this.  Any ideas?

<telerik:radajaxpanel id="radajaxpanel1" runat="server" loadingPanelID="RadAjaxLoadingPanel1">
                   <telerik:radgrid runat="server" id="gridAudits" GridLines="None" Skin="Sunset" 
                       onneeddatasource="gridAudits_NeedDataSource" 
                       onitemdatabound="gridAudits_ItemDataBound" 
                       onitemcommand="gridAudits_ItemCommand" 
                       oninsertcommand="gridAudits_InsertCommand">
                       <mastertableview CommandItemDisplay="Top" AutoGenerateColumns="False" InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                               ShowHeadersWhenNoRecords="true" DataKeyNames="ID,AuditTypeID">                  
                           <CommandItemSettings AddNewRecordText="Add New Assessment" />
                           <NestedViewTemplate>
                               <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap">
                                   <div class="contactWrap">
                                       <fieldset style="padding: 10px;">
                                           <legend style="padding: 5px;"><b>Section Data:</b>
                                           </legend>
                                               <telerik:radgrid runat="server" id="gridSection" skin="Windows7" 
                                                   OnNeedDataSource="gridSection_NeedDataSource"
                                                   onitemdatabound="gridSection_ItemDataBound" 
                                                   OnDetailTableDataBind="gridSection_DetailTableDataBind"  
                                                   onitemcommand="gridSection_ItemCommand" 
                                                   onprerender="gridSection_PreRender" >
                                                   <mastertableview CommandItemDisplay="Top" AutoGenerateColumns="False" 
                                                           InsertItemPageIndexAction="ShowItemOnCurrentPage" 
                                                           ShowHeadersWhenNoRecords="true" DataKeyNames="ID"
                                                           EditMode="PopUp" >                                                      
                                                       <CommandItemSettings AddNewRecordText="Add" />
                                                       <DetailTables>
                                                           <telerik:GridTableView DataKeyNames="ID" Name="SectionChildren" Width="100%"
                                                               AutoGenerateColumns="False">
                                                               <Columns>                                                            
                                                                   <telerik:GridBoundColumn DataField="Defect" 
                                                                       HeaderText="Child Defect(s)" ReadOnly="True" UniqueName="Defect" />  
                                                               </Columns>
                                                           </telerik:GridTableView>
                                                       </DetailTables>
                                                       <Columns>              
                                                           <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                                                           <telerik:GridBoundColumn DataField="Section" DataFormatString="<nobr>{0}</nobr>" 
                                                               HeaderText="Section" UniqueName="Section" />                                  
                                                           <telerik:GridBoundColumn DataField="Question" 
                                                               HeaderText="Question" UniqueName="Question" />
                                                           <telerik:GridBoundColumn DataField="Result" DataFormatString="<nobr>{0}</nobr>" 
                                                               HeaderText="Result" UniqueName="Result" />
                                                           <telerik:GridBoundColumn DataField="DefectCode" 
                                                               HeaderText="Defect Code" UniqueName="DefectCode" />
                                                           <telerik:GridBoundColumn DataField="UpdatedBy" HeaderText="Updated By" 
                                                               UniqueName="UpdatedBy" DataFormatString="<nobr>{0}</nobr>" />
                                                           <telerik:GridBoundColumn DataField="TimestampLocalTime" DataFormatString="<nobr>{0}</nobr>" 
                                                               HeaderText="Last Updated" UniqueName="TimestampLocalTime" />
                                                           <telerik:GridBoundColumn DataField="Notes" DataFormatString="<nobr>{0}</nobr>" 
                                                               HeaderText="Notes" UniqueName="Notes" />
                                                       </Columns>
                                                       <EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit item: {0}"
                                                               EditFormType="Template" PopUpSettings-Modal="true" CaptionDataField="ID" PopUpSettings-Width="550px">
                                                           <FormTemplate>
               <telerik:radajaxpanel id="radajaxpanel2" runat="server" loadingPanelID="RadAjaxLoadingPanel1">
                                                               <table>
                                                                   <tr>
                                                                       <td>Section: </td>
                                                                       <td>
                                                                           <asp:DropDownList ID="ddlSection" runat="server" AutoPostBack="true"
                                                                           Visible="<%# (Container is GridEditFormInsertItem) ? true : false %>"
                                                                           OnSelectedIndexChanged="ddlSection_indexchanged" />
                                                                           <asp:Label ID="Label1" runat="server" Text='<%# Bind("Section") %>' 
                                                                           Visible="<%# (Container is GridEditFormInsertItem) ? false : true %>" />
                                                                       </td>
                                                                   </tr>
                                                                   <tr>
                                                                       <td>Question: </td>
                                                                       <td><asp:DropDownList ID="ddlQuestion" runat="server" 
                                                                           Visible="<%# (Container is GridEditFormInsertItem) ? true : false %>"/>
                                                                           <asp:Label ID="Label2" runat="server" Text='<%# Bind("Question") %>' 
                                                                           Visible="<%# (Container is GridEditFormInsertItem) ? false : true %>" />
                                                                           </td>
                                                                   </tr>
                                                                   <tr>
                                                                       <td>Result: </td>
                                                                       <td><asp:DropDownList ID="ddlResult" runat="server" /></td>
                                                                   </tr>
                                                                   <tr>
                                                                       <td>Child Defects: </td>
                                                                       <td><asp:CheckBoxList ID="cblChildDefects" runat="server"></asp:CheckBoxList></td>
                                                                   </tr>
                                                                   <tr>
                                                                       <td>Notes: </td>
                                                                       <td><asp:TextBox ID="TextBox1" runat="server" Height="119px" Text='<%# Bind("Notes") %>' 
                                                                       TextMode="MultiLine" Width="445px" />
                                                                   </td>
                                                                   </tr>
                                                               </table>
                                                               </telerik:radajaxpanel>
                                                                       <asp:Button ID="Button1" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                                                           runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                                                       </asp:Button> 
                                                                       <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel">
                                                                       </asp:Button>
                                                           </FormTemplate>
                                                       </EditFormSettings>
                                                   </mastertableview>
                                               </telerik:radgrid>
                                       </fieldset>
                                   </div>
                               </asp:Panel>
                           </NestedViewTemplate>
                           <expandcollapsecolumn visible="True">
                           </expandcollapsecolumn>
                           <Columns>
                               <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                               <telerik:GridTemplateColumn DataField="ID" DataType="System.Int32" 
                                   HeaderText="ID" UniqueName="ID" visible="false">
                                   <EditItemTemplate>
                                       <asp:Label ID="IDTextBox" runat="server" Text='<%# Bind("ID") %>'></asp:Label>
                                   </EditItemTemplate>
                                   <ItemTemplate>
                                       <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                               <telerik:GridTemplateColumn DataField="AuditType" HeaderText="Audit Type" 
                                   UniqueName="AuditType">
                                   <EditItemTemplate>
                                       <asp:DropDownList ID="ddlAuditType" runat="server" 
                                           DataSource="<%# AuditTypeList %>" DataTextField="ListValue" DataValueField="ID" 
                                           Enabled="<%# (Container is GridEditFormInsertItem) ? true: false %>"  />
                                   </EditItemTemplate>
                                   <ItemTemplate>
                                       <asp:Label ID="AuditTypeLabel" runat="server" Text='<%# Eval("AuditType") %>'></asp:Label>
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                               <telerik:GridTemplateColumn DataField="Assessor" HeaderText="Assessor" 
                                   UniqueName="Assessor">
                                   <EditItemTemplate>
                                       <QA:EmployeeLookup id="employeeLookup" runat="server" ></QA:EmployeeLookup>
                                   </EditItemTemplate>
                                   <ItemTemplate>
                                       <asp:Label ID="AssessorLabel" runat="server" Text='<%# Eval("Assessor") %>'></asp:Label>
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                               <telerik:GridTemplateColumn DataField="ICB" HeaderText="ICB" UniqueName="ICB">
                                   <EditItemTemplate>
                                       <asp:CheckBox ID="cbICB" runat="server" Text="ICB" />
                                   </EditItemTemplate>
                                   <ItemTemplate>
                                       <asp:Label ID="ICBLabel" runat="server" Text='<%# Eval("ICB") %>'></asp:Label>
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                               <telerik:GridTemplateColumn DataField="Status" HeaderText="Status" 
                                   UniqueName="Status">
                                   <EditItemTemplate>
                                       <asp:DropDownList ID="ddlStatus" runat="server" DataSource="<%# StatusList %>" 
                                           DataTextField="ListValue" DataValueField="ListValue" 
                                           Enabled="<%# (Container is GridEditFormInsertItem) ? false: true %>" />
                                   </EditItemTemplate>
                                   <ItemTemplate>
                                       <asp:Label ID="StatusLabel" runat="server" Text='<%# Eval("Status") %>'></asp:Label>
                                   </ItemTemplate>
                               </telerik:GridTemplateColumn>
                               <telerik:GridBoundColumn DataField="TimestampLocalTime" HeaderText="Last Updated" 
                                       UniqueName="TimestampLocalTime" ReadOnly="True"/>
                               <telerik:GridBoundColumn DataField="UpdatedBy" HeaderText="Updated By" 
                                   ReadOnly="True" UniqueName="UpdatedBy" />
                           </Columns>
                           <editformsettings>
                               <editcolumn uniquename="EditCommandColumn1">
                               </editcolumn>
                           </editformsettings>
                           </mastertableview>
                   </telerik:radgrid>    
       </telerik:radajaxpanel>
Binh
Top achievements
Rank 1
 answered on 14 Mar 2011
3 answers
130 views
Hello! I've noticed that any simple iframe makes any Rad Dock unmoveable and frozen at the last version of Rad Controls.
This is the simple code that makes unmoveable dock without a half of the borders at any browser on my system. 
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="MasterPortal.WebSite.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" />
    <telerik:RadDockLayout ID="MainLayout" runat="server">
        <telerik:RadDockZone ID="RadDockZone_1" runat="server">
            <telerik:RadDock ID="ReportDock" runat="server">
                <ContentTemplate>
                    <iframe src="http://www.google.com" />
                </ContentTemplate>
            </telerik:RadDock>
        </telerik:RadDockZone>
        <telerik:RadDockZone ID="RadDockZone_2" runat="server" >
        </telerik:RadDockZone>
    </telerik:RadDockLayout>
    </form>
</body>
</html>


Could you please give me some advices about how can irame could be placed at Rad Dock without making it unusable?
Dmitry
Top achievements
Rank 2
 answered on 14 Mar 2011
1 answer
69 views
I am looking for a way to trap for multi-selection of grid rows.

My issue is that I have a web service return data after a row select/deselect. If I hold the ctrl/shift key and select 4 rows the web service is called 4 times. I saw a post that uses a timer but I am checking to see if anyone has worked a solution to trap for the ctrl/shift key press. I am a little fuzzy on this one but I disabled the drag to select option to eliminate that possibility.

Thanks,
Craig 
Pavlina
Telerik team
 answered on 14 Mar 2011
1 answer
116 views
We have a RadGrid with some custom sorting, master/detail rows and GroupByExpressions. The problem occurs when a groups toggle button is clicked, calling "._toggleGroupsExpand/Collapse", then clicking on a parent grid's sortable column.  

I saw the older threads regarding this error that talked about firewalls interfering with the x-microsoft header and that doesn't seem to be the case here. the headers are staying intact and there's no firewall applicable, this is running on localhost.
Maria Ilieva
Telerik team
 answered on 14 Mar 2011
2 answers
147 views
Hi,

I have radcombobox into radgrid. i am using sqldatasource for bind radcombobox using radgrid datakey names. but it is not bind.

Here my code,

    <telerik:RadGrid ID="rgAddPlans" runat="server" AutoGenerateColumns="False" DataSourceID="sdsDispayPlans" DataKeyNames="sp_pln_id"
                            Width="740px" GridLines="Both">
                            <MasterTableView HierarchyDefaultExpanded="true" AutoGenerateColumns="false" CommandItemDisplay="Top"
                                DataKeyNames="sp_pln_id">                              
                           
                                <Columns>                    
                                  
                                     <telerik:GridTemplateColumn HeaderText="Existing Coverage" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate>
                                            <asp:Label ID="lblExistCvg" runat="server" SkinID="NoBold" Text='<%# Bind("cvg_typ_code") %>'></asp:Label>
                                              <asp:HiddenField ID="hfWaiveStatus" runat="server" />
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Center" Wrap="false" />
                                        <HeaderStyle Width="120px" HorizontalAlign="Center" Wrap="true" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn HeaderText="Coverage" HeaderStyle-Font-Bold="true">
                                        <ItemTemplate>
                                            <telerik:RadComboBox ID="ddlCoverage" AutoPostBack="false" Width="110px" DataSourceID="sdsddlCoverage"
                                                runat="server" OnSelectedIndexChanged="ddlCoverage_IndexChanged"  DataTextField="cvg_typ_code"
                                                DataValueField="pln_cvg_id">                                               
                                            </telerik:RadComboBox>

                                            
                                            <asp:Label ID="lblCoverage" runat="server" SkinID="NoBold" Style="padding-left: 50px;
                                                text-align: center" Visible="false"></asp:Label>
                                        </ItemTemplate>
                                        <HeaderStyle Width="110px" HorizontalAlign="Center" />
                                        <ItemStyle HorizontalAlign="Center" />
                                    </telerik:GridTemplateColumn>                              
                                </Columns>                           
                            </MasterTableView>                       
                        </telerik:RadGrid>
                           <asp:SqlDataSource ID="sdsddlCoverage" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnStr %>"
        ProviderName="<%$ ConnectionStrings:MyConnStr.ProviderName %>" SelectCommand="SELECT  
                                               ct.description
                                             , ct.cvg_typ_code
                                             , pct.pln_cvg_id  
                             FROM  
                                               plan_coverage_types pct  
                                               JOIN coverage_types ct ON ( pct.cvg_typ_id = ct.cvg_typ_id )   
                             WHERE  
                                               pct.pln_id = :sp_pln_id   order by ct.cvg_typ_id ">
        <SelectParameters>
            <asp:Parameter Name="sp_pln_id" />          
        </SelectParameters>
    </asp:SqlDataSource>

Her is my code. i want radcombobox bind depends sp_pln_id. but it is not binding.

Please give me tips for this one.


Thanks,
Dhamu.
Maria Ilieva
Telerik team
 answered on 14 Mar 2011
1 answer
96 views
Hello All,

I am using Radgrid with AllowFilteringByColumn="True", and onclicking on Filter button, the filter criteria is openning at top of the page with blank background.

Please have a look on attached screenshot, and suggest me some solution.


Thanks
Mukesh
Pavlina
Telerik team
 answered on 14 Mar 2011
1 answer
77 views
Hi,

I currently use the latest Version 2010.3.1317.40 of the RadGrid. Is there a change in the behavior, RadGrid handles data when grouping is enabled? The former versions displayed the data as delivered. Now the data will be automatically sorted. But I don't want this. I don't have changed anything in my code. Is it a bug or have I set some property now?

Thanks.
Tsvetina
Telerik team
 answered on 14 Mar 2011
3 answers
559 views

Having a bit of trouble just finding a control in this.
I have cleared out most code for an easier read and left the main tags in place.
Need to find the SqlDataSource and I have tried everything with no luck....

 

 

    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="odsFill" GridLines="None"
    AllowPaging="True" Width="950px" DataKeyNames="xxx">
    <MasterTableView DataSourceID="odsFill" AutoGenerateColumns="False" DataKeyNames="xxx"
        AllowPaging="true">
        <RowIndicatorColumn HeaderStyle-Width="20px" />
        <ExpandCollapseColumn HeaderStyle-Width="20px" />
        <Columns>
              
        </Columns>
        <DetailTables>
            <telerik:GridTableView runat="server" >
                <ParentTableRelation>
                    <telerik:GridRelationFields DetailKeyField="xxx" MasterKeyField="xxx" />
                </ParentTableRelation>
                <NoRecordsTemplate>
                    There are no records.</NoRecordsTemplate>
                <Columns>                            
                    <telerik:GridTemplateColumn DataField="TYPE" UniqueName="xxx" HeaderText="C">
                        <ItemTemplate>
                            <asp:HyperLink ID="create3Clink" runat="server" Text="Create 3C" 
                                NavigateUrl='default.aspx' />                                    
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <NestedViewSettings>
                    <ParentTableRelation>
                        <telerik:GridRelationFields DetailKeyField="COMP_ID" MasterKeyField="COMP_ID" />
                    </ParentTableRelation>
                </NestedViewSettings>
                <NestedViewTemplate>
                    <asp:Label ID="lblID" Text='test' runat="server" />
                    <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">
                        <Tabs>
                            <telerik:RadTab runat="server" Text="Verification" PageViewID="PageView3" />                                    
                        </Tabs>
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                        <telerik:RadPageView runat="server" ID="PageView3" BorderStyle="Solid">
                            <h4>
                                Verification</h4>
                                  
                                  
                            <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ToolBox %>"
                                SelectCommand="SELECT * From MyTable">                                        
                            </asp:SqlDataSource>
                              
                             
                        </telerik:RadPageView>
                      
                    </telerik:RadMultiPage>
                </NestedViewTemplate>
            </telerik:GridTableView>
        </DetailTables>
    </MasterTableView>
</telerik:RadGrid>

Vasil
Telerik team
 answered on 14 Mar 2011
1 answer
110 views

Hello,
I am trying to save the dynamically  created raddoc in to mssql. GetRegisteredDocksState() does not recognize the newly created raddoc.

Public Sub SaveState()
        Dim dockState As String
        Dim serializer As New Script.Serialization.JavaScriptSerializer()
        Dim stateList As List(Of DockState) = RadDockLayout1.GetRegisteredDocksState()
        Dim serializedList As New StringBuilder()
        Dim i As Integer = 0
        While i < stateList.Count
            serializedList.Append(serializer.Serialize(stateList(i)))
            serializedList.Append("|")
            i += 1
        End While
        dockState = serializedList.ToString()
....
....


 Do you have any KB article on the same ?

Pero
Telerik team
 answered on 14 Mar 2011
1 answer
205 views

I have a column in my rad grid that displays image when LastUserActivity < MostResentUpdate. I want that column to be sorted by default. What should i give in the sort expression in the fieldname..

<SortExpressions>
     <telerik:GridSortExpression FieldName="??????"/>
</SortExpressions>



Thanks,

 

Pavlina
Telerik team
 answered on 14 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?