S
samb
When I use manual databinding to a GridView control, as bellow.
'Retrive a DataSet from database
Dim ds As DataSet = uda.GetUsers(conectionString)
'gvUsers - The GridView
gvUsers.DataSource = ds
gvUsers.DataBind()
Wehen I set the AllowSorting property to True and handle the sorting
event I got the sorting column by e.SortingExpression (wich I can
handle to retrive sorted data).
But when I click one more time at the same column I will have
descending sorting. e.SortDirection always return Ascending as the
sorting direction.
I have developed a ViewState fix for this to keep track of the
direction (and when I switch column), but shuld not the Control give me
the SortDirection. I Have been googling for hours to find an example or
explaination to this, all ends ut in ViewState["_sortDirection"] =
"ASC" or "DESC"...
Any one who have got a solution to this or could explain it to me.
Thanks alot,
Sam
SwedSite
'Retrive a DataSet from database
Dim ds As DataSet = uda.GetUsers(conectionString)
'gvUsers - The GridView
gvUsers.DataSource = ds
gvUsers.DataBind()
Wehen I set the AllowSorting property to True and handle the sorting
event I got the sorting column by e.SortingExpression (wich I can
handle to retrive sorted data).
But when I click one more time at the same column I will have
descending sorting. e.SortDirection always return Ascending as the
sorting direction.
I have developed a ViewState fix for this to keep track of the
direction (and when I switch column), but shuld not the Control give me
the SortDirection. I Have been googling for hours to find an example or
explaination to this, all ends ut in ViewState["_sortDirection"] =
"ASC" or "DESC"...
Any one who have got a solution to this or could explain it to me.
Thanks alot,
Sam
SwedSite