The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
Actually, it is possible to see the sort triangle in the header of the databoundgrid only after you have clicked on it.
Is there any way to show it the first time it appears? Do I have to sort it in the code on form load to see it?
Thanks a lot,
Sebastien
ADAdministrator Syncfusion Team June 9, 2005 05:24 PM UTC
Yes, you would have to sort the datasource before the grid is shown to initially see the sorted grid.
You can do this in form.load (after the grid''s DataSource has been set). If you know the DataView associated with teh datasource, you can directly set dataView1.Sort = "MyColumn" to sort MyColumn.
If you do not have knowledge of teh dataview, you can get it from the BindingContext.
CurrencyManager cm = (CurrencyManager) grid.BindingContext[grid.DataSource, grid.DataMember];
DataView dv = (DataView) cm.List;
dv.Sort = "MyColumn";
CurrencyManager
SGSebastien GirouxJune 10, 2005 07:12 PM UTC
Thanks, I''ve used the grid.defaultView.Sort method. Can I decide of the sort type? (Ascending or descending)
Thanks!
Sebastien
ADAdministrator Syncfusion Team June 10, 2005 11:11 PM UTC
If your grid has already been sorted, you can test grid.defaultView.Sort. If the grid was sorted descending, grid.defaultView.Sort will in in DESC. If it does not end in DESC, the grid was sorted ascending.
SGSebastien GirouxJune 15, 2005 03:25 PM UTC
I did this on the panel load:
m_logsDataTable.DefaultView.Sort = "[Time]DESC";
and it worked.
Thanks!
Sebastien