Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Elegant Grid Tech Support » Default View from boundgrid.datasource Collapse All
Subject Author Date
Alex Pag Oct 21, 2012 - 11:05 AM

Hi. I try to get the default dataview from grid.datasource after set sorting (i press sort on column header for example desc) for one column. The DataView sorting records it’s differents than that i see on my grid in form.

This is my code


 


 DataView mView = ((DataTable)grid.DataSource).DefaultView;



 if (grid.SortRules.Count > 0)

            {

                string direction = (grid.SortRules[0].Direction.ToString() == "Ascending" ? "ASC" : "DESC");

                mView.Sort = grid.SortRules[0].Column.DataPropertyName + " " + direction; ;

            }



How i can get the sorted records from my grid which I see on my form?