G
gnewsgroup
I have a GridView, in which the header of one column changes depending
on the selected value of a DropDownList outside of this GridView.
I did this dynamic header through
protected void GridView1_RowCreated(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[5].Text =
myDropDownList.SelectedValue;
}
}
In the declaration of this GridView, I have
AllowSorting="true"
and of course I have a Sorting event handler.
Every column is sortable except this column with the dynamic header.
If assign a static value to this header and remove this RowCreated
event handler, this column becomes sortable, too.
So, the question is: How can I make the column with a dynamic header
sortable?
on the selected value of a DropDownList outside of this GridView.
I did this dynamic header through
protected void GridView1_RowCreated(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[5].Text =
myDropDownList.SelectedValue;
}
}
In the declaration of this GridView, I have
AllowSorting="true"
and of course I have a Sorting event handler.
Every column is sortable except this column with the dynamic header.
If assign a static value to this header and remove this RowCreated
event handler, this column becomes sortable, too.
So, the question is: How can I make the column with a dynamic header
sortable?