This is a migrated thread and some comments may be shown as answers.

Datalist inside Grid EditForm Template

1 Answer 123 Views
This is a migrated thread and some comments may be shown as answers.
Ruth Dahan
Top achievements
Rank 1
Ruth Dahan asked on 12 Feb 2009, 09:26 AM
I have a grid which is edited in a pop up window (edit form). One field that is edited should be an inner data list, that can be added with editable rows. Trying to define an inner asp datalist leads to confusion between the edit commands on the grid and on the datalist.

What is the recommended way to design an inner editable list (or grid) like the one mentioned above and can be seen in this link?
edit user EditFrom

my code:
            <asp:DataList ID="AgentsDataList2" runat="server" DataSourceID="UserAgentsDatasource" 
                OnEditComman="DataList2_EditCommand" DataKeyField="UserId"
                    <telerik:RadTextBox ID="tbdlAgentId" runat="server" Text='<%# Bind("AgentId") %>'
                    <telerik:RadComboBox ID="cmbdlSwitches" runat="server" DataSourceID="SwitchesDatasource" 
                        DataTextField="Value" DataValueField="Key" Skin="Office2007"
                        <CollapseAnimation Duration="200" Type="OutQuint" /> 
                    <asp:LinkButton ID="LinkButton1" runat="server" CommandName="update"
                    <asp:LinkButton ID="LinkButton2" runat="server" CommandName="cancel"
                    <asp:Label ID="lblAgentId" runat="server" Text='<%# Eval("AgentId") %>' /> 
                    <asp:Label ID="lblSwitches" runat="server" Text='<%# Eval("SwitchId") %>' /> 
                    <asp:LinkButton runat="server" ID="LinkButton1" CommandName="Edit"> Edit 
     <script runat="server"
        protected void DataList2_EditCommand(object source, 
            DataListCommandEventArgs e) 
            //something here... 
            int x = e.Item.ItemIndex; 

Thanks in advanced,

1 Answer, 1 is accepted

Sort by
Georgi Krustev
Telerik team
answered on 16 Feb 2009, 03:20 PM
Hello Ruth,

There should be no confusion between the DataList events and the RadGrid events. This is achievable, because the ASP.NET page framework provides a technique called event bubbling that allows a child control to propagate events up to its containment hierarchy. So when DataList raise event, it will be bubbled after Grid's ItemCommand event is raised. Here you can find more information devoted on this subject.

The DataList logic can be implemented in the ItemCommand handler or in other specific handler. You can ajaxify the DataList to replace the regular postbacks with ajax requests instead.

Best regards,
Georgi Krustev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Asked by
Ruth Dahan
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question