Hi, is there any way to retrive a groupe columns collection visible using the "outlook style"?
thanks
Marco
hello,
look at this kb
http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.aspx?ArticleID=7694
in paticular
// Loop through every row in the passed in rows collection. foreach ( UltraGridRow row in rows ) { // If you are using Outlook GroupBy feature and have grouped rows by columns in the // UltraGrid, then rows collection can contain group-by rows or regular rows. So you // may need to have code to handle group-by rows as well. if ( row is UltraGridGroupByRow )//<------you can create a list that contains all of these rows
hope it helps,
best regards
E.
ps:your nickname remember my prof:)
I know that method but it's more time expensive.. I'm doing the same thing by cycling the SortedColumns collection, it is smaller than rows collection and also expose the right order of the grouped columns.
I mean that is very strange that there isn't a property or a method that returns immediatly the list of the grouped columns.. :(
thanks a lot.
marco
there is a method that does the opposite:
ultraGrid1.DisplayLayout.Rows.GetAllNonGroupByRows();
try also
ultraGrid1.DisplayLayout.Rows.GetRowEnumerator(GridRowType.GroupByRow,..(other parameters).);
http://help.infragistics.com/Help/NetAdvantage/NET/2008.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v8.2~Infragistics.Win.UltraWinGrid.RowsCollection~GetRowEnumerator.html
I don't what work using rows.. :) i would like usesomething exposed by Group, like this:
ultraGrid1.DisplayLayout.Groups.GetGroupedColumns();
but this method doesn't exist ;)
i believe that this code is the more efficient one.
IEnumerable enumerator = this.ultraGrid1.Rows.GetRowEnumerator(GridRowType.GroupByRow, null, null);foreach (UltraGridGroupByRow row in enumerator) {
IEnumerable enumerator = this.ultraGrid1.Rows.GetRowEnumerator(
GridRowType.GroupByRow
, null, null);foreach (
row in enumerator) {
//here your code
}
Ciao.
Hi Marco,
It sounded like you were looking for a better way. So I just wanted to confirm that there is no better way. :)
I know, i said it in my 2nd post of this thread. it could be a new feature/method of the wingrid. ;)
thank you very much.
There's no collection of only grouped column. The best way to get them is to loop through the SortedColumns collection and check the IsGroupByColumn on each column.
every column of a grid has a property called IsGroupByColumn which indicates if it is grouped by or not.
cycle through the columns of a band and verify if it set to true. let me know if it works!
it's not the right way for me.. you are thinking always in terms of row..
i used the janusgrid before using ultrawingrid so i feel the differences.. here there isn't the way to work with a GroupedColumnsColletion because it doesn't exist.
the code i'm writing or code you proposed to me is a workaround.. i mean that is not a natural way..