Issues with SFDataGrid Cell click

I have attached herewith a copy of a document which explains my issue.

Thank you in anticipation for your help.

Attachment: Issues_with_Data_Grid_cell_click_dee90f02.7z

1 Reply 1 reply marked as answer

AR Arulpriya Ramalingam Syncfusion Team August 27, 2020 01:33 AM UTC

Hi Alain, 
 
Thank you for your interest in Syncfusion products. 
 
The CurrentCellRenderer will be initialized only when the cell is activated and we suggest you to use the CurrentCellRenderer in CurrentCellActivated event instead of CellClick event. Otherwise, please make use of the second solution from the forum. 
 
Example code 
 
AddHandler Me.sfDataGrid1.CurrentCellActivated, AddressOf SfDataGrid1_CurrentCellActivated 
 
Private Sub SfDataGrid1_CurrentCellActivated(ByVal sender As Object, ByVal e As CurrentCellActivatedEventArgs) 
            Try 
 
                        'The current cell value can be retrieved by using the GridCellRendererBase.GetControlValue method  
                        ' when the CurrentCell value is not null. 
                        If sfDataGrid1.CurrentCell IsNot Nothing Then 
                                    ' Get the CurrentCellValue 
                                    'Dim currentCellValue As String 
                                    Dim currentCellRowIndex As Integer = 0 
                                    Dim currentCellColumnIndex As Integer = 0 
                                    Dim currentCellColumn As Object = Nothing 
 
                                    Dim currentCellValue As Object = Me.sfDataGrid1.CurrentCell.CellRenderer.GetControlValue() 
                                    currentCellRowIndex = Me.sfDataGrid1.CurrentCell.RowIndex 
                                    currentCellColumnIndex = Me.sfDataGrid1.CurrentCell.ColumnIndex 
                                    currentCellColumn = Me.sfDataGrid1.CurrentCell.Column 
                                    MessageBox.Show(currentCellValue.ToString() & System.Environment.NewLine & currentCellRowIndex.ToString(), "Current Cell Value") 
                        End If 
 
 
            Catch ex As Exception 
 
                        'TODO: INSTANT C# TODO TASK: Calls to the VB 'Err' object are not converted by Instant C#: 
                        MessageBox.Show(ex.Message) 
 
            End Try 
End Sub 
 
 
Please get back to us, if you need any further assistance. 
 
Regards, 
Arulpriya 


Marked as answer
Loader.
Up arrow icon