Arikael
asked on
intercept sorting of a databound datagridview
Hi experts
I have a databound datagridview which can be sorted (columnheader click)
But everytime the dvg respectively the bindingsource behind it gets sorted because a user clicked on a columnhead, the dvg should first be sorted by a field I defined (always) and then by the field the user wants.
How can I achieve this?
is it possible to intercept the sorting and prefix the sort-string with my field?
I'm using c#, .NET 2.0 and WinForms
I have a databound datagridview which can be sorted (columnheader click)
But everytime the dvg respectively the bindingsource behind it gets sorted because a user clicked on a columnhead, the dvg should first be sorted by a field I defined (always) and then by the field the user wants.
How can I achieve this?
is it possible to intercept the sorting and prefix the sort-string with my field?
I'm using c#, .NET 2.0 and WinForms
You're trying to sort a gridview with two columns rigth?
You can pass, on your sort expression, two or more columns separated by commas, like this:
"Col1 ASC, Col2 DESC"
If it doesn't solve your problens, you can post your Sorting event code and i'll try to help you.
You can pass, on your sort expression, two or more columns separated by commas, like this:
"Col1 ASC, Col2 DESC"
If it doesn't solve your problens, you can post your Sorting event code and i'll try to help you.
ASKER
Hi
a datagridview.
with sorting event, you mean the SortCompare event?
a datagridview.
with sorting event, you mean the SortCompare event?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks
ASKER