how to bind data to datagrid header template on button click event

Discussion in 'ASP .Net' started by Santosh, Aug 2, 2006.

  1. Santosh

    Santosh Guest

    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>");
    }
    }
     
    Santosh, Aug 2, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Purvi T
    Replies:
    0
    Views:
    857
    Purvi T
    Oct 19, 2004
  2. Amy
    Replies:
    0
    Views:
    993
  3. Santosh
    Replies:
    2
    Views:
    7,181
    Santosh
    Jun 9, 2006
  4. Santosh
    Replies:
    0
    Views:
    1,863
    Santosh
    Aug 4, 2006
  5. Max2006
    Replies:
    2
    Views:
    1,578
    Walter Wang [MSFT]
    Sep 19, 2007
Loading...

Share This Page