-----Original Message-----
Yes I did. In fact the following are the event code I use.
private void DataGrid_Inspection_SortCommand(object source,
System.Web.UI.WebControls.DataGridSortCommandEventArgs e)
{
DataView dvInspection = new DataView();
dvInspection.Table = (DataTable)Cache["Inspection"];
dvInspection.Sort = e.SortExpression;
DataGrid_Inspection.DataSource = dvInspection;
DataGrid_Inspection.DataBind();
}
private void DataGrid_Inspection_ItemCreated(object sender,
System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Header )
{
e.Item.Cells[0].Text = "Structure";
e.Item.Cells[1].Text = "Area";
}
}
Elton Wang said:
Do you assign SortExpression for these two columns?
Elton Wang
-----Original Message-----
Yes.
The Data is populated in the ground (databound) on the
page_load event.
Sorting is done in the SortCommand event. The custom
labels are defined in
the ItemCreated event. In fact there were 5 colums to be
displayed. Out of
which, I made 2 columns custom headers. These 2 columns
display the text in a
non-underlined fashion so that I cannot click on it for
sorting at runtime.
How can make these 2 columns again be sortable?
:
What do you mean the columns become non-sortable,
DataGrid_SortCommand can't be fired or other? Could you
give more detailed in?
Elton Wang
(e-mail address removed)
-----Original Message-----
Yes. In fact, I made the sort through the sort event.
However when I changed
the column label via the column create event, the
columns
were become
non-sortable.
:
Hi there,
Do you implement sorting codes in
DataGrid_SortCommand
event?
Elton Wang
(e-mail address removed)
-----Original Message-----
I have created a datagrid in my aspx with
the 'AllowSorting' property to true.
When clicking on the column header, the page
refreshes.
However the sorting
is not done. Am I missing anything?
I populate the data if !postback.
.
.
.
.