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.
Unfortunately, activation email could not send to your email. Please try again.

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

Thread ID:

Created:

Updated:

Platform:

Replies:

117912 Jan 8,2015 01:38 AM Jan 9,2015 03:55 AM Windows Forms 1
loading
Tags: GridGroupingControl
Supriya Varne
Asked On January 8, 2015 01:38 AM

 



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

Neelakandan Kannan [Syncfusion]
Replied On January 9, 2015 03:55 AM

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


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.

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.

;