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.

Delete Highlighted Record instead of Selected Record

Thread ID:

Created:

Updated:

Platform:

Replies:

72876 Apr 9,2008 09:36 AM Apr 23,2008 07:03 PM Windows Forms 3
loading
Tags: GridControl
harisan
Asked On April 9, 2008 09:36 AM

Dear Sir:

I use this code to delete selected record row, if I expand mouse selection rows to several rows, it just can only select one record each time, thus delete one row each BtnDelete_click event.
I expect to enumerate each highlighted (alpha blend) rows and then delete it all, but didn't have idea to work it out.

GGC.TableOptions.AllowSelection = GridSelectionFlags.None
GGC.TableOptions.ListBoxSelectionMode = SelectionMode.MultiExtended

Sub BtnDelete_Click()
Dim el As Element = GGC.Table.GetInnerMostCurrentElement()
If Not el Is Nothing Then
Dim rec As Record = el.GetRecord()
rec.Delete()
End If
End Sub

How to make it work perfectly in VB?

Best Regards,
Harry


Sri Rajan [Syncfusion]
Replied On April 11, 2008 07:06 PM

Hi Harry,

Thank you for your patience.

To delete all the highlighted s n GroupingGrid, Please refer the code below.


Private Sub buttonAdv1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim selRecords As Syncfusion.Grouping.SelectedRecordsCollection
selRecords = Me.gridGroupingControl1.Table.SelectedRecords

For Each record As Syncfusion.Grouping.SelectedRecord In selRecords
record.Record.Delete()
Next record
End Sub


Please let me know if this helps.

Best Regards,
Srirajan



harisan
Replied On April 18, 2008 10:03 PM

Hello Srirajan,

Thanks, but it only worked on parent table, I need to delete selected records work on child or nested tables as well.
How to work it out?

Best Regards,
Harry


Johnson [Syncfusion]
Replied On April 23, 2008 07:03 PM

Hi Harry,

To delete ChildTable records when selected, you need to get the selected records from the corresponding table. The code's are below,

Private Sub buttonAdv1_Click(ByVal sender As Object, ByVal e As EventArgs)
Dim selRecords As Syncfusion.Grouping.SelectedRecordsCollection
Table tab = Me.gridGroupingControl1.GetTable("ChildTable Name")
selRecords = tab .SelectedRecords

Dim i As Integer = selRecords.Count
Do While i < 0
i -= 1
selRecords(i).Delete()
Loop
End Sub


Please let me know if you need further assistance.

Best regards,
Johnson




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.

;