Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i implement child grid in devexpress grid in asp.net in parent grid column.
Posted
Updated 16-Mar-15 19:41pm
v3

1 solution

asp:GridView ID="ParentGridView" runat="server"
DataSourceID="ParentSqlDataSource"
AutoGenerateColumns="False"
DataKeyNames="pub_id"
OnRowEditing= "ParentGridView_OnRowEditing"
<Columns>
<asp:TemplateField HeaderText="PublisherID">
<ItemTemplate>
<asp:Label id="pubid_lbl" Runat="Server"
Text='<%# Eval("pub_id") %>'/>
</ItemTemplate>

</asp:TemplateField>
<asp:TemplateField HeaderText="Name">
<ItemTemplate>
<asp:Label id="name_lbl" Runat="Server"
Text='<%# Eval("pub_name") %>'/>
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="City">
<ItemTemplate>
<asp:Label id="city_lbl" Runat="Server"
Text='<%# Eval("city") %>'/>
</ItemTemplate>
</asp:TemplateField>

<asp:TemplateField HeaderText="View">
<ItemTemplate>
<asp:Button ID="ViewChild_Button"
runat="server" Text="+" CommandName="Edit" />
</ItemTemplate>
<EditItemTemplate>
<asp:Button ID="CancelChild_Button"
runat="server" Text="-" CommandName="Cancel" />
*ChildGridView…will come here
</EditItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900