datagrid sort order

  • Thread starter Thread starter John Smith
  • Start date Start date
J

John Smith

i have a win form w/ a datagrid inside
while the app is running many instances of this form r created and closed
how can i ensure that the sort user used last time is kept until the whole
app is
closed

TIA
 
Create a DataView as a static property and bind everything to it. If you
need seperate datasources with the same sort order, same thing... static
class storing the Index of the column you want sorted on . Every time you
bind the grid, set the sort order (ideally of a dataview) to that
columnindex.

If you are in VB.NET, you can just use modules if you are uncomfortable with
Static properties, they are quite similar.

HTH,

Bill

www.devbuzz.com
www.knowdotnet.com
 
tnx

William Ryan eMVP said:
Create a DataView as a static property and bind everything to it. If you
need seperate datasources with the same sort order, same thing... static
class storing the Index of the column you want sorted on . Every time you
bind the grid, set the sort order (ideally of a dataview) to that
columnindex.

If you are in VB.NET, you can just use modules if you are uncomfortable with
Static properties, they are quite similar.

HTH,

Bill

www.devbuzz.com
www.knowdotnet.com
 
Back
Top