We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Problem in setting the backcolor for the nested table in GridGroupingControl

Hi, I am trying to set the backcolor for the child table. It is applying for all the rows except the rows where the data is present. Also I am trying to remove the borders for the child table by setting the style and applying the style to the child tabledescriptor. still the borders are appearing. I have pasted the code I am using.Is this right..?I am also sending the screen shot how it looks like..? srcDataSet.Tables[0].TableName = "View"; srcDataSet.Tables[1].TableName = "ViewHistory"; srcDataSet.Relations.Add( srcDataSet.Tables[0].Columns[DBColumns.AssetId], srcDataSet.Tables[1].Columns[DBColumns.AssetId]); srcDataSet.Relations[0].RelationName = "View_History"; groupingGrid1.DataSource = srcDataSet.Tables[0]; GridTableCellStyleInfo ViewHistStyle = new GridTableCellStyleInfo(); ViewHistStyle.BackColor = Color.White; ViewHistStyle.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; ViewHistStyle.ReadOnly = false; ViewHistStyle.Borders.All = new GridBorder( GridBorderStyle.None ); ViewHistStyle.AllowEnter = false; GridEngine engine = this.groupingGrid1.Engine; engine.ChildGroupOptions.ShowCaption = false; engine.NestedTableGroupOptions.ShowColumnHeaders = false; engine.NestedTableGroupOptions.ShowGroupHeader = false; engine.NestedTableGroupOptions.ShowCaption = false; engine.NestedTableGroupOptions.ShowCaptionPlusMinus = false; GridTableDescriptor ViewTableDescriptor = (GridTableDescriptor) engine.TableDescriptor; RelationDescriptor ViewHistRelationDescriptor = ViewTableDescriptor.Relations["View_History"]; GridTableDescriptor ViewHistTableDescriptor = (GridTableDescriptor) ViewHistRelationDescriptor.ChildTableDescriptor; ViewTableDescriptor.Appearance.AnyCell.BackColor = Color.White; ViewTableDescriptor.AllowNew = false; ViewTableDescriptor.Appearance.AnyRecordFieldCell = ViewHistStyle; engine.NestedTableGroupOptions.ShowEmptyGroups = false; this.groupingGrid1.TableModel.Properties.DisplayHorzLines = false; this.groupingGrid1.TableModel.Properties.DisplayVertLines = false; //Here I am setting other styles for the parent table.... Thanks, Prathima

5 Replies

PV Prathima Venkobachar July 29, 2005 01:43 AM

Sorry file was not attached properly.. Image_4482.zip


AD Administrator Syncfusion Team July 29, 2005 02:30 AM

Instead of: ViewTableDescriptor.Appearance.AnyRecordFieldCell = ViewHistStyle; try ViewTableDescriptor.Appearance.RecordFieldCell = ViewHistStyle; ViewTableDescriptor.Appearance.AlternateRecordFieldCell = ViewHistStyle; to see if that does what you want.


PV Prathima Venkobachar July 29, 2005 04:01 AM

I tried .This is not reflecting. I am getting the backcolor, but only for the row for which the record is there..it is setting cyan color.. How can i debug this..? Thanks, prathima


AD Administrator Syncfusion Team July 29, 2005 04:34 AM

Handle the QueryCellCellInfo event. In the handler, set e.Style.CellTipText = e.TableCellStyleIndentity.Info. Then as you move your mouse over the region you want to color, the celltip should give you information about the grid cell that you are hovering over. Here is a little sample that colors nested tables. It also removes the borders from the inner most table. Can you use Paint to mark up a screen shot of this grid to show exactly what you want to change? Then maybe I can suggest how to do it. http://www.syncfusion.com/Support/user/uploads/GGC_NestedTables_3e5c6aad.zip


PV Prathima Venkobachar August 1, 2005 03:11 AM

I was able to solve the issue. thanks for the quick response. Thanks, prathima

Loader.
Live Chat Icon For mobile
Up arrow icon