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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Strike out a row

Thread ID:

Created:

Updated:

Platform:

Replies:

118185 Feb 9,2015 04:18 PM UTC Feb 11,2015 06:22 AM UTC WinForms 3
loading
Tags: GridGroupingControl
Frank Piplak
Asked On February 9, 2015 04:18 PM UTC

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

Neelakandan Kannan [Syncfusion]
Replied On 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

Frank Piplak
Replied On 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

Neelakandan Kannan [Syncfusion]
Replied On 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

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

;