G
Guest
I have a question that maybe somebody can help me out.
I have a gridview that is bound to a sqltable, and I have created two
template columns.
I am having problems getting the sorting to work. I turned on the Allow
Sorting property but when I click one of the columns that is bound, it will
not sort.
Below is the code I am using
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
try
{
if (e.SortDirection == SortDirection.Ascending)
{
e.SortDirection = SortDirection.Descending;
}
else
{
e.SortDirection = SortDirection.Ascending;
}
}
catch (Exception x)
{
using (System.IO.StreamWriter sw = new
System.IO.StreamWriter("c:\\agserror\\mapMaker.log", true))
{
// Add some text to the file.
sw.WriteLine(DateTime.Now + " : " + x.Message);
sw.WriteLine(x.StackTrace);
}
}
}
Any help would be appriciated
Thanks
I have a gridview that is bound to a sqltable, and I have created two
template columns.
I am having problems getting the sorting to work. I turned on the Allow
Sorting property but when I click one of the columns that is bound, it will
not sort.
Below is the code I am using
protected void GridView1_Sorting(object sender, GridViewSortEventArgs e)
{
try
{
if (e.SortDirection == SortDirection.Ascending)
{
e.SortDirection = SortDirection.Descending;
}
else
{
e.SortDirection = SortDirection.Ascending;
}
}
catch (Exception x)
{
using (System.IO.StreamWriter sw = new
System.IO.StreamWriter("c:\\agserror\\mapMaker.log", true))
{
// Add some text to the file.
sw.WriteLine(DateTime.Now + " : " + x.Message);
sw.WriteLine(x.StackTrace);
}
}
}
Any help would be appriciated
Thanks