Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
20810 | Oct 26,2004 11:05 AM UTC | Oct 28,2004 04:32 AM UTC | WinForms | 7 |
![]() |
Tags: Grouping |
private void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e) { if(e.Style.CellType == "CheckBox") { GridRecordRow rec = this.gridGroupingControl1.Table.DisplayElements[e.TableCellIdentity.RowIndex] as GridRecordRow; if(rec != null) { Group grp = rec.ParentGroup; if(grp != null && grp.GetChildCount() == 2) { e.Style.BackColor = Color.Blue; } } } }
Group grp = gcr.ParentGroup; //gcr is GridCaptionRow if(grp.IsExpanded) { Console.WriteLine("++++++++"); DetailsSection ds = grp.Details; if(ds is GridRecordsDetails) { GridRecordsDetails grd = ds as GridRecordsDetails; foreach(Record r2 in grd.Records) { Console.WriteLine("* " + r2.ToString()); } } else if(ds is GridGroupsDetails) { GridGroupsDetails ggd = ds as GridGroupsDetails; foreach(Group g in ggd.Groups) { Console.WriteLine("+ " + g.ToString()); } } Console.WriteLine("-------"); }
Group grp = gcr.ParentGroup; //gcr is GridCaptionRow string spc = new string(''*'', 20); //for indents while(grp != null) { Console.WriteLine(spc + grp.ToString()); spc = spc.Substring(0, spc.Length - 2); grp = grp.ParentGroup; }
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.