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. (Last updated on : November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set the color to the record which has PlusMinusCell when grid is displayed

Thread ID:

Created:

Updated:

Platform:

Replies:

117951 Jan 13,2015 08:41 AM UTC Jan 21,2015 04:24 AM UTC WinForms 5
loading
Tags: GridGroupingControl
Supriya Varne
Asked On January 13, 2015 08:41 AM UTC

Hi,
I am using Gridgrouping control.
I have Parent-Child Relationship in the control.
I want to change values in cell of  rows values in child table.
for that TableControlCurrentCellEditingComplete is fired 
when grid is displayed i want set the color to the record which has PlusMinusCell


Thank you and Regards,
Supriya

Neelakandan Kannan [Syncfusion]
Replied On January 14, 2015 07:31 AM UTC

Hi Supriya,

 

Thank you for your interest in Syncfusion products.

 

The reported scenario with “Changing record backcolor of Record Plus Minus cell” can be achieved by handling QueryCellStyleInfo. You can check whether record has child table or not by using HasNestedTables property of Record. So that please make use of below code,

 

Code Snippet:

Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As ObjectByVal As GridTableCellStyleInfoEventArgs)
        
Dim rec As Record e.TableCellIdentity.DisplayElement.GetRecord
        
If ((Not (rec) Is Nothing)  _
                    
AndAlso (rec.HasNestedTables  _
                    
AndAlso ((e.TableCellIdentity.TableCellType <> GridTableCellType.EmptyCell)  _
                    
AndAlso ((e.TableCellIdentity.TableCellType <> GridTableCellType.NestedTableIndentCell)  _
                    
AndAlso (e.TableCellIdentity.TableCellType <> GridTableCellType.NestedTableRowHeaderCell))))) Then
            
e.Style.BackColor Color.Orange
        
End If
    End Sub

 

Sample:

http://www.syncfusion.com/downloads/support/directtrac/117951/Sample_Record_Color_VB-1677371984.zip

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


Supriya Varne
Replied On January 14, 2015 08:26 AM UTC

Hi Supriya,

 

Thank you for your interest in Syncfusion products.

 

The reported scenario with “Changing record backcolor of Record Plus Minus cell” can be achieved by handling QueryCellStyleInfo. You can check whether record has child table or not by using HasNestedTables property of Record. So that please make use of below code,

 

Code Snippet:

Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As ObjectByVal As GridTableCellStyleInfoEventArgs)
        
Dim rec As Record e.TableCellIdentity.DisplayElement.GetRecord
        
If ((Not (rec) Is Nothing)  _
                    
AndAlso (rec.HasNestedTables  _
                    
AndAlso ((e.TableCellIdentity.TableCellType <> GridTableCellType.EmptyCell)  _
                    
AndAlso ((e.TableCellIdentity.TableCellType <> GridTableCellType.NestedTableIndentCell)  _
                    
AndAlso (e.TableCellIdentity.TableCellType <> GridTableCellType.NestedTableRowHeaderCell))))) Then
            
e.Style.BackColor Color.Orange
        
End If
    End Sub

 

Sample:

http://www.syncfusion.com/downloads/support/directtrac/117951/Sample_Record_Color_VB-1677371984.zip

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


Hi ,
Sir color of  all records  in gridgrouping control changes to orange color .
I want to  only change the color of record which has plus minus cell means parent record of child table

Thanks and Regards,
Supriya


Neelakandan Kannan [Syncfusion]
Replied On January 19, 2015 06:55 AM UTC

Hi Supriya,

 

Thank you for your update.

 

In our previous sample , we have provided the customization for setting Backcolor for record which has plus/minus cell. In that sample, all the records of parent table has plus/minus cell. i.e. All the records has child table. So it seems that all the records has been colored. Please find the attached video,

 

Please let me know if I misunderstood your query.

 

Regards,

Neelakandan


Attachment: Sample_Video_117951_d239b37d.zip

Supriya Varne
Replied On January 19, 2015 12:21 PM UTC

Hi Supriya,

 

Thank you for your update.

 

In our previous sample , we have provided the customization for setting Backcolor for record which has plus/minus cell. In that sample, all the records of parent table has plus/minus cell. i.e. All the records has child table. So it seems that all the records has been colored. Please find the attached video,

 

Please let me know if I misunderstood your query.

 

Regards,

Neelakandan


Attachment: Sample_Video_117951_d239b37d.zip

Hi ,
Sir When datasource bind to the gridgroupingcontrol and data is displayed in grid first time then i want to set the color to record which has plusminus cell ie parent record 

Thanks and Regards,
Supriya


Neelakandan Kannan [Syncfusion]
Replied On January 21, 2015 04:24 AM UTC

Hi Supriya,

 

Thank you for your update.

 

We regret to let you know that we could not able to clearly understand your query. If you want to change the backcolor for Parent record, you need to handle the QueryCellStyleInfo event. Using this event , you can check whether current record has nested table or not. If current record has nested table, the backcolor for cells will be changed as your specified color. In your previous update, you have mentioned that color should be displayed at first time. So that we need some more details regarding your scenario(by means of screenshot or any video) as we could not clearly understand your scenario. It would be more helpful for us to provide better solution as soon as possible.

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


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.

Warning Icon 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.Close Icon

;