RE: Save user's re-order grid preferences
-
So I've set my grid to allowReorder , this causes persistence on the grid order but once the program is restarted it goes back to default can someone let me know how I can save a user's re-order preference. Thinking it can be a property? If not maybe build a method to take care of this
-
So I've set my grid to allowReorder , this causes persistence on the grid order but once the program is restarted it goes back to default can someone let me know how I can save a user's re-order preference. Thinking it can be a property? If not maybe build a method to take care of this
In your DataGridView look at the ColumnHeaderMouseClick event. You can gather DataGridView1.SortedColumn.Index to know which column is being sorted on and DataGridView1.SortOrder to see if ascending or descending. Then next time you refill the grid sort on that column and order.
-
In your DataGridView look at the ColumnHeaderMouseClick event. You can gather DataGridView1.SortedColumn.Index to know which column is being sorted on and DataGridView1.SortOrder to see if ascending or descending. Then next time you refill the grid sort on that column and order.
I think he was asking about the order that the columns appear, left to right.
-
So I've set my grid to allowReorder , this causes persistence on the grid order but once the program is restarted it goes back to default can someone let me know how I can save a user's re-order preference. Thinking it can be a property? If not maybe build a method to take care of this
So persist it, big deal.
-
So I've set my grid to allowReorder , this causes persistence on the grid order but once the program is restarted it goes back to default can someone let me know how I can save a user's re-order preference. Thinking it can be a property? If not maybe build a method to take care of this
As piebald suggested persist the order for each user. I use XML and store that sort of thing in the users application data folder. ASP would use a cookie.
Never underestimate the power of human stupidity RAH
-
I think he was asking about the order that the columns appear, left to right.
-
As piebald suggested persist the order for each user. I use XML and store that sort of thing in the users application data folder. ASP would use a cookie.
Never underestimate the power of human stupidity RAH
yes I persist on columnheaderclick. So it looks like I would have to save the column header index when user navigates from that specific panel. question is: (XML is going to be best option) each column will have an index.. on build the grid builds the columns in order to the columns index. what columnheader property is this and how would I go on to save and read from xml to populate these index #s
-
yes I persist on columnheaderclick. So it looks like I would have to save the column header index when user navigates from that specific panel. question is: (XML is going to be best option) each column will have an index.. on build the grid builds the columns in order to the columns index. what columnheader property is this and how would I go on to save and read from xml to populate these index #s