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

Strike out a row

Hello,

my grid has been 10 rows and find no way to set the font of 1 row to strike out.

Can you help me (in VB)?

Regards,
Frank

3 Replies

NK Neelakandan Kannan Syncfusion Team February 10, 2015 07:40 AM UTC

Hi Frank,

 

Thank you for using Syncfusion products.

 

If you want to change the Font style as Strike out, you can use QueryCellStyleInfo event. The font style can be changed by using Strikeout property of Font. Please make use of below code,

 

Code Snippet:

AddHandler Me.gridGroupingControl1.QueryCellStyleInfo, AddressOf Me.gridGroupingControl1_QueryCellStyleInfo
    
    
Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As ObjectByVal As GridTableCellStyleInfoEventArgs)
        
If (e.TableCellIdentity.RowIndex 3Then ‘Specify your needed RowIndex
            
e.Style.Font.Strikeout = true
        End If
    End Sub

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


Attachment: Sample_Font_Style_Change_VB_1ed5ec6a.zip


FP Frank Piplak February 10, 2015 08:06 AM UTC

Hello Neelakandan,

thanks for your answer but I mean to modify an existing grid, not to modify when create a grid.

Regards,
Frank


NK Neelakandan Kannan Syncfusion Team February 11, 2015 06:22 AM UTC

Hi Frank,

 

Thank you for your update.

 

Here we have provided the sample as per your need. In the below sample, if you press the Change_Row_Font_Style button, the particular Row font style of grid(which is provided in Textbox) will be changed dynamically. Please make use of below code,

 

Code Snippet:

 

Private Sub gridGroupingControl1_QueryCellStyleInfo(ByVal sender As ObjectByVal As GridTableCellStyleInfoEventArgs)
        
If ((Me.textBoxExt1.Text <> string.Empty)  _
                    
AndAlso ((Not (e.TableCellIdentity.DisplayElement.GetRecord) Is Nothing)  _
                    
AndAlso ((e.TableCellIdentity.DisplayElement.GetRecord.GetRowIndex = Integer.Parse(Me.textBoxExt1.Text))  _
                    
AndAlso fontChange))) Then ‘Specify your needed condition to meet criteria dynamically
            
e.Style.Font.Strikeout = true
        End If
    End Sub
    
    Private 
fontChange As Boolean = false    
    Private Sub 
buttonAdv1_Click(ByVal sender As ObjectByVal As EventArgs)
        fontChange 
= true
        Me
.gridGroupingControl1.Refresh
    
End Sub

 

Note:

The RowIndex of particular record can be retrieved by using GetRowIndex  method of GetRecord. We have attached sample video and sample. Please find the attached file.

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


Attachment: Sample_and_Video_14e7b848.zip

Loader.
Up arrow icon