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.

excessive use of conditional cell formating (GGC)

Thread ID:

Created:

Updated:

Platform:

Replies:

41658 Mar 8,2006 08:57 AM Mar 9,2006 08:10 AM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On March 8, 2006 08:57 AM

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

Administrator [Syncfusion]
Replied On March 9, 2006 05:41 AM

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.

Administrator [Syncfusion]
Replied On March 9, 2006 08:10 AM

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.

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.

;