Digamos que tenemos un UltraGrid. ¿Cómo puedo ordenarlo programáticamente primero por la columna A, luego B, luego C.¿Cómo ordenar un UltraGrid por varias columnas programáticamente?
Gracias!
Digamos que tenemos un UltraGrid. ¿Cómo puedo ordenarlo programáticamente primero por la columna A, luego B, luego C.¿Cómo ordenar un UltraGrid por varias columnas programáticamente?
Gracias!
Documentación aquí: http://help.infragistics.com/Help/Doc/WinForms/2011.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v11.2~Infragistics.Win.UltraWinGrid.UltraGridBand~SortedColumns.html
Sólo puede establecer el indicador de clasificación (el orden es importante), código, tomado desde arriba enlace:
UltraGridBand band = this.ultraGrid1.DisplayLayout.Bands[0];
// Sort the rows by Country and City fields. Notice the order in which these columns
// are set. We want to sort by Country and then sort by City and in order to do that
// we have to set the SortIndicator property in the right order.
band.Columns["Country"].SortIndicator = SortIndicator.Ascending;
band.Columns["City"].SortIndicator = SortIndicator.Ascending;
// You can also sort (as well as group rows by) columns by using SortedColumns
// property off the band.
band.SortedColumns.Add("ContactName", false, false);
Más información sobre el segundo El método se puede encontrar aquí: http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v8.2~Infragistics.Win.UltraWinGrid.SortedColumnsCollection~Add.html
Si también querían automáticamente el grupo de ContactName esto puede hacerlo por usted:
band.SortedColumns.Add("ContactName", false, true);
Aviso sobre la utilización de la verdadera como el último parámetro
gracias, por desgracia, los enlaces que ya no es válida – Xander
@Xander sí, parecen haber cambiado su sitio y no agregaron redirecciones. No es el mismo que se mencionó anteriormente, pero parece que tienen un artículo sobre clasificación que se puede encontrar aquí: http: //www.infragistics.com/help/topic/ED043A4B-031A-48A8-8A20-9BEA498DE71A Sin embargo, la solución publicada sigue siendo válida. – theChrisKent
Gracias, solución simple y útil – Rice