SgDotNet
Singapore Professional .NET User Group -For Cool Developers

changing headertext of columns dynamically in gridview

rated by 0 users
This post has 1 Reply | 1 Follower

Top 100 Contributor
Posts 24
priyaraj Posted: 01-22-2008 8:37 AM

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();

}

}

Top 10 Contributor
Posts 2,284

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