Binding data to datagrid header template on button click

S

Santosh

Dear all i want to bind data to the controls in the datagrid header
template on button click event which is not in the datagrid . i am
writting following code but it gives an error.
can any one tell me what is the solution behind them.

private void search_Click(object sender, System.EventArgs e)
{
selectQuery();


}


private void selectQuery()
{
try
{

strcondition="select * from Student"
DataView dv ;
dv =
VS.DAC.PDMO.GeneralDesMng.SearchSectionsLinesByDistrict(strcondition);
if (dv.Count > 0)
{
Label number_Label =
(Label)searchResult_DataGrid.FindControl("numHeader_Label");
number_Label.Text=
dv[0]["NumUnit"].ToString();
Label capacity_Label =
(Label)searchResult_DataGrid.FindControl("capHeader_Label");
capacity_Label.Text
=dv[0]["CapUnit"].ToString();
Label address_Label =
(Label)searchResult_DataGrid.FindControl("addrHeader_Label");


address_Label.Text=dv[0]["AddrUnit"].ToString();
}
searchResult_DataGrid.DataSource = dv;
searchResult_DataGrid.DataBind();
}
catch(Exception ex)
{
Response.Write("<script
language=Javascript> alert('"+
ex.Message.ToString()+"') ;</script>");
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top