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
close icon

I want to get the current record of child table when i change the value in current cell of row and tab key is not pressed and directly moved to cell of next row

 



Hi,
I am using Gridgrouping control.
I have Parent-Child Relationship in the control.
I want to change multiple cell values of rows  in child table.
For that I used "TableControlCurrentCellEditingComplete" event and following code
Dim el As Element
            'Dim rec As GridRecord
            Dim rec As Record
            Dim table, tablechild As GridTable
            Dim tablecontrol As GridTableControl
            Dim cc As GridCurrentCell
            Dim style As GridTableCellStyleInfo

 el = Me.GridGroupingControl1.Table.GetInnerMostCurrentElement()

                If Not el Is Nothing Then

                    table = CType(IIf(TypeOf el.ParentTable Is GridTable, el.ParentTable, Nothing), GridTable)

                    tablecontrol = Me.GridGroupingControl1.GetTableControl(table.TableDescriptor.Name)

                    cc = tablecontrol.CurrentCell

                    style = table.GetTableCellStyle(cc.RowIndex, cc.ColIndex)

                    rec = CType(IIf(TypeOf el Is GridRecord, el, Nothing), GridRecord)



                    If rec Is Nothing AndAlso TypeOf el Is GridRecordRow Then

                        rec = CType(IIf(TypeOf el.ParentRecord Is GridRecord, el.ParentRecord, Nothing), GridRecord)

                    End If

I want to get the current record  of child table when i change the value in current cell of  row and tab key is not pressed and directly moved to cell of next row.
But  When I press the tab key I get current record  of child table


Please give me solution regarding to this.
Thank you and Regards,
Supriya

1 Reply

NK Neelakandan Kannan Syncfusion Team January 9, 2015 08:55 AM UTC

Hi Supriya,

 

Thank you for your interest in Syncfusion products.

 

If you want to get the records from child table, you need to get the records from child table. i.e. the reported scenario can be achieved by using GetTableControl method. Using this method, you can get the child table records by giving the correct child table descriptor name to the TableControl.

 

Code Snippet:

Private Sub gridGroupingControl1_TableControlCurrentCellEditingComplete(ByVal sender As ObjectByVal As GridTableControlEventArgs)
        
If (Not (e.TableControl.Table.TableDescriptor) Is Nothing) Then
            Dim 
childTableDescriptorName As String = e.TableControl.Table.TableDescriptor.Name.ToString
            
Dim style As GridTableCellStyleInfo = Me.gridGroupingControl1.GetTableControl(childTableDescriptorName).GetTableViewStyleInfo(e.TableControl.CurrentCell.RowIndex, e.TableControl.CurrentCell.ColIndex)
            
If ((Not (style) Is Nothing)  _
                        
AndAlso (Not (style.TableCellIdentity) Is Nothing)) Then
                Dim 
id As GridTableCellStyleInfoIdentity style.TableCellIdentity
                
Dim rec As Record id.DisplayElement.GetRecord
            
End If
        End If
    End Sub

 

Sample:

http://www.syncfusion.com/downloads/support/directtrac/117912/Sample_Child_Record_VB-2107216715.zip

 

Please let me know if you have any concerns.

 

Regards,

Neelakandan


Loader.
Live Chat Icon For mobile
Up arrow icon