I am new to Syncfusion. Please let me know the equivalent event of CellValueChanged of datagridview in Syncfusion SfDatagrid. I want to achieve the below code for sfDatagrid. The below code is of Winforms Datagridview CellValueChanged event. I want to do the same thing with sfDatagrid
Private Sub gvItems_CellValueChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles gvItems.CellValueChanged
Try
If isSearch = True Then
Exit Sub
End If
If gvItems.Rows.Count = 0 Then
Exit Sub
End If
If e.ColumnIndex = 0 Then
If IsNothing(gvItems.CurrentRow.Cells("AbhishekNo").Value) = True Then
Exit Sub
End If
Dim dt As New DataTable
dt = objCommonMethods.GetDevkrityaDetailsByNo(SqlCon, gvItems.CurrentRow.Cells("AbhishekNo").Value)
If dt.Rows.Count > 0 Then
gvItems.CurrentRow.Cells("AbhishekNo").Value = dt.Rows(0)("AbhishekNo").ToString()
gvItems.CurrentRow.Cells("AbhishekType").Value = Convert.ToInt32(dt.Rows(0)("AbhishekTypeId"))
gvItems.CurrentRow.Cells("ItemCode").Value = dt.Rows(0)("InternalId")
gvItems.CurrentRow.Cells("PoojaName").Value = dt.Rows(0)("InternalId")
gvItems.CurrentRow.Cells("Quantity").Value = "1"
gvItems.CurrentRow.Cells("Rate").Value = dt.Rows(0)("AbhishekAmt").ToString()
'gvItems.CurrentRow.Cells("TotalAmt").Value = dt.Rows(0)("AbhishekAmt").ToString()
End If
gvItems.Rows.Add("")
End If
If e.ColumnIndex = 1 Then
If IsNothing(gvItems.CurrentRow.Cells("PoojaName").Value) = True Then
Exit Sub
End If
Dim dt As New DataTable
dt = objCommonMethods.GetPoojaNameDetails(SqlCon, gvItems.CurrentRow.Cells("PoojaName").Value)
If dt.Rows.Count > 0 Then
gvItems.CurrentRow.Cells("AbhishekNo").Value = dt.Rows(0)("AbhishekNo").ToString()
gvItems.CurrentRow.Cells("AbhishekType").Value = Convert.ToInt32(dt.Rows(0)("AbhishekTypeId"))
gvItems.CurrentRow.Cells("ItemCode").Value = dt.Rows(0)("InternalId")
'gvItems.CurrentRow.Cells("PoojaName").Value = dt.Rows(0)("InternalId")
gvItems.CurrentRow.Cells("Quantity").Value = "1"
gvItems.CurrentRow.Cells("Rate").Value = dt.Rows(0)("AbhishekAmt").ToString()
'gvItems.CurrentRow.Cells("TotalAmt").Value = dt.Rows(0)("AbhishekAmt").ToString()
End If
'gvItems.Rows.Add("")
End If
If e.ColumnIndex = 2 Then
If IsNothing(gvItems.CurrentRow.Cells("ItemCode").Value) = True Then
Exit Sub
End If
Dim dt As New DataTable
dt = objCommonMethods.GetPoojaNameDetails(SqlCon, gvItems.CurrentRow.Cells("ItemCode").Value)
If dt.Rows.Count > 0 Then
'gvItems.CurrentRow.Cells("TotalAmt").Value = dt.Rows(0)("AbhishekAmt").ToString()
gvItems.CurrentRow.Cells("AbhishekNo").Value = dt.Rows(0)("AbhishekNo").ToString()
gvItems.CurrentRow.Cells("AbhishekType").Value = Convert.ToInt32(dt.Rows(0)("AbhishekTypeId"))
gvItems.CurrentRow.Cells("PoojaName").Value = dt.Rows(0)("InternalId")
gvItems.CurrentRow.Cells("Quantity").Value = "1"
gvItems.CurrentRow.Cells("Rate").Value = dt.Rows(0)("AbhishekAmt").ToString()
End If
'gvItems.Rows.Add("")
End If
If e.ColumnIndex = 2 Then
If IsNothing(gvItems.CurrentRow.Cells("ItemCode").Value) = True Then
Exit Sub
End If
Dim dt As New DataTable
dt = objCommonMethods.GetPoojaNameDetails(SqlCon, gvItems.CurrentRow.Cells("ItemCode").Value)
If dt.Rows.Count > 0 Then
'gvItems.CurrentRow.Cells("TotalAmt").Value = dt.Rows(0)("AbhishekAmt").ToString()
gvItems.CurrentRow.Cells("AbhishekNo").Value = dt.Rows(0)("AbhishekNo").ToString()
gvItems.CurrentRow.Cells("AbhishekType").Value = Convert.ToInt32(dt.Rows(0)("AbhishekTypeId"))
gvItems.CurrentRow.Cells("PoojaName").Value = dt.Rows(0)("InternalId")
gvItems.CurrentRow.Cells("Quantity").Value = "1"
gvItems.CurrentRow.Cells("Rate").Value = dt.Rows(0)("AbhishekAmt").ToString()
End If
'gvItems.Rows.Add("")
End If
If e.ColumnIndex = 0 Or e.ColumnIndex = 1 Or e.ColumnIndex = 2 Or e.ColumnIndex = 3 Or e.ColumnIndex = 4 Then
CalculateDocumentTotal()
End If
Catch ex As Exception
End Try
End Sub