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>");
}
}
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>");
}
}