Last post Mar 18, 2010 01:35 AM by VINOTHD
Member
49 Points
214 Posts
Oct 29, 2008 06:28 AM|khalid2008|LINK
hi all, I have a radgrid with detailtable, and inside the detailtable I have GridTemplateColumn which contain dropdownlist, please how can I acess the dropdownlist to bind it thanks in advance
140 Points
70 Posts
Mar 11, 2009 06:11 AM|incubator138@hotmail.com|LINK
Hi,
Set the Name property for the Detail table and hence you can access the DropDownlist from the Detail table in the ItemDataBound event as shown below.
ASPX:
<DetailTables > <rad:GridTableView runat="server" Name="Detail" DataSourceID="SqlDataSource1" > <Columns> <rad:GridTemplateColumn UniqueName="TempCol" HeaderText="TempCol" > <ItemTemplate> <asp:DropDownList ID="DropDownList1" runat="server"> </asp:DropDownList> </ItemTemplate> </rad:GridTemplateColumn> </Columns> </rad:GridTableView> </DetailTables>
CS:
protected void RadGrid1_ItemDataBound(object sender, Telerik.WebControls.GridItemEventArgs e) { if ((e.Item is GridDataItem)&&(e.Item.OwnerTableView.Name=="Detail")) { GridDataItem item = (GridDataItem)e.Item; DropDownList ddl = (DropDownList)item["TempCol"].FindControl("DropDownList1"); // code to populate the DropDownList } }
Regards
Shinu [:)]
None
0 Points
3 Posts
Mar 18, 2010 01:35 AM|VINOTHD|LINK
Hi ,
Great Job.
Thanks,
Vinoth.D
Member
49 Points
214 Posts
DetailTableDataBind in RadGrid
Oct 29, 2008 06:28 AM|khalid2008|LINK
hi all,
I have a radgrid with detailtable, and inside the detailtable I have GridTemplateColumn which contain dropdownlist, please how can I acess the dropdownlist to bind it
thanks in advance
Member
140 Points
70 Posts
Re: DetailTableDataBind in RadGrid
Mar 11, 2009 06:11 AM|incubator138@hotmail.com|LINK
Hi,
Set the Name property for the Detail table and hence you can access the DropDownlist from the Detail table in the ItemDataBound event as shown below.
ASPX:
CS:
Regards
Shinu [:)]
None
0 Points
3 Posts
Re: DetailTableDataBind in RadGrid
Mar 18, 2010 01:35 AM|VINOTHD|LINK
Hi ,
Great Job.
Thanks,
Vinoth.D