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

excessive use of conditional cell formating (GGC)

Hi, my requirement is to format some cells of a row in condition of the value from some other cells in that row. I know that this topic is very common here in the forum, but there are some more open questions. First question: Is there a concept - similar to GridConditionalFormatDescriptor - but where I can specify the style for a single (named) cell and not for "anyCell" Second question: At the moment I realize conditional cell formating - as often shown in this forum - like this (I added some questions): Private Sub _ggc_QueryCellStyleInfo(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.Grouping.GridTableCellStyleInfoEventArgs) Handles _ggc.QueryCellStyleInfo Dim rec As GridRecord If e.TableCellIdentity.Table.Info = Me._ggc.GetTable(Decl.tabNames.EQUIPMENTS.ToString).Info Then ''Question: ^^^^ Is there a better way to check for equal tables? If e.TableCellIdentity.TableCellType = GridTableCellType.AlternateRecordFieldCell OrElse _ e.TableCellIdentity.TableCellType = GridTableCellType.RecordFieldCell Then If Not e.TableCellIdentity.Column Is Nothing AndAlso _ e.TableCellIdentity.Column.MappingName = Decl.equipmentCols.type.ToString Then rec = e.TableCellIdentity.DisplayElement If Not rec Is Nothing AndAlso rec.GetValue(Decl.equipmentCols.type.ToString) = "INPUT" Then e.Style.BackColor = Color.Purple ''Question: is it possible here to influence the style of the other cells ''of the record maybe something like rec.cells("col1").style.BackColor = Color.Red ??? End If End If End If End If End Sub If I could influence the style of e.g. Cell2 and Cell3 when queryCellStyleInfo-event handles Cell1 this would allow producing less code and save runtime. Thank you very much for answering our questions all the time! Greetings, Klaus

2 Replies

AD Administrator Syncfusion Team March 9, 2006 10:41 AM UTC

Hi Klaus, The GridGroupingControl is a column/row-oriented grid, and not cell oriented like GridControl. So in order to set the style for a single cell the QueryCellStyleInfo event must be handled. The table can also be checked using the TableDescriptor Name: e.TableCellIdentity.DisplayElement.ParentTableDescriptor.Name. Regards, Calvin.


AD Administrator Syncfusion Team March 9, 2006 01:10 PM UTC

Hi Klaus, one more note: In your QueryCellInfo you cannot influence other cells in your record, but you can cache values with some fields in your class where you save the display element and the settings you want to apply to these columns. In your QueryCellInfo (probaly best done in an extra metjod) you compare the display element with the saved element field and only if the queried display element is different from the previously query display element that you update the colum settings and save them in your other fiels. QueryCellInfo then simply returns the values from those fields. Stefan >Hi Klaus, > >The GridGroupingControl is a column/row-oriented grid, and not cell oriented like GridControl. So in order to set the style for a single cell the QueryCellStyleInfo event must be handled. >The table can also be checked using the TableDescriptor Name: e.TableCellIdentity.DisplayElement.ParentTableDescriptor.Name. > >Regards, >Calvin.

Loader.
Live Chat Icon For mobile
Up arrow icon