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.
Unfortunately, activation email could not send to your email. Please try again.

Problem in setting the backcolor for the nested table in GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

32409 Jul 29,2005 02:42 AM Aug 1,2005 04:11 AM Windows Forms 5
loading
Tags: GridControl
Prathima Venkobachar
Asked On July 29, 2005 02:42 AM

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

Prathima Venkobachar
Replied On July 29, 2005 02:43 AM

Sorry file was not attached properly.. Image_4482.zip

Administrator [Syncfusion]
Replied On July 29, 2005 03: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.

Prathima Venkobachar
Replied On July 29, 2005 05: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

Administrator [Syncfusion]
Replied On July 29, 2005 05: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

Prathima Venkobachar
Replied On August 1, 2005 04:11 AM

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

CONFIRMATION

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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;