how can i bind a datalist dynamically??
-
:rose:im using asp.net 2.0+c# i have a datalist1 as a itemtemplate in a datalist2. in datalist2 i have an itemtemplate button if i click on that i have to bind the datalist1.hw can i do that dyanmically??:confused:
Hi, Create an event handler for handling ItemCommand event of datalist as following. protected void dlst_ItemCommand ( object source, DataListCommandEventArgs e ) { //Find InnerDatalit. DataList datalist1 = ( DataList )e.Item.FindControl( "DataList1" ); //Set its datasource datalist1.DataSource = datasource. //Bind it. datalist1.DataBind(); } This event will call when u click on button in the outer datalist and will find inner datalist and bind it to the data.
Thanks and Regards, Chetan Ranpariya
-
Hi, Create an event handler for handling ItemCommand event of datalist as following. protected void dlst_ItemCommand ( object source, DataListCommandEventArgs e ) { //Find InnerDatalit. DataList datalist1 = ( DataList )e.Item.FindControl( "DataList1" ); //Set its datasource datalist1.DataSource = datasource. //Bind it. datalist1.DataBind(); } This event will call when u click on button in the outer datalist and will find inner datalist and bind it to the data.
Thanks and Regards, Chetan Ranpariya