SgDotNet
Singapore Professional .NET User Group -For Cool Developers

changing headertext of columns dynamically in gridview

Latest post 01-29-2008 10:26 AM by icelava. 1 replies.
  • 01-22-2008 8:37 AM

    changing headertext of columns dynamically in gridview

    I am using the following code in Row created event, but this is not working. The grid view has also sorting enabled

    protected void grdProducts_RowCreated(object sender, GridViewRowEventArgs e)

    {

    GridViewRow row = e.Row;

    if (e.Row.RowType == DataControlRowType.Header)

    {

    row.CellsMusic.Text = ViewState["col1"].ToString();

    }

    }

  • 01-29-2008 10:26 AM In reply to

    Re: changing headertext of columns dynamically in gridview

    Why cannot you use the GridViewColumn's HeaderText property?

    this.resultGrid.Columns[0].HeaderText = "whatever";

    The melody of logic will always play out the truth. ~ Narumi Ayumu, Spiral

Page 1 of 1 (2 items) | RSS
Copyright SgDotNet 2004-2008
Powered by Community Server (Commercial Edition), by Telligent Systems