How to set data grid column header value dynamically
ASP.NET
3
Posts
2
Posters
0
Views
1
Watching
-
Hi, I have the datagrid,it is working fine. the problem is i am passing single value from another page to this data gird page. I want to set that value as a column header value for that data grid. thanks.
Hi there. You can use the
HeaderText
property for theDataGridColumn
in question -- something like this:void Page_Load(Object sender, EventArgs e)
{if (!IsPostBack)
{
// set the heading for the first column to a value passed in
// from the querystringmyDataGrid.Columns\[0\].HeaderText = Request.QueryString\["title"\]; // ... normal datagrid binding ...
}
}
-
Hi there. You can use the
HeaderText
property for theDataGridColumn
in question -- something like this:void Page_Load(Object sender, EventArgs e)
{if (!IsPostBack)
{
// set the heading for the first column to a value passed in
// from the querystringmyDataGrid.Columns\[0\].HeaderText = Request.QueryString\["title"\]; // ... normal datagrid binding ...
}
}