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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GGC, current row persistance against DataSourse

Thread ID:





33835 Aug 26,2005 05:33 PM UTC Aug 27,2005 09:06 AM UTC WinForms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On August 26, 2005 05:33 PM UTC

I have a GGC that is bound to a table. No relationships are created. It is working in the listbox mode: ggc.TableOptions.ListBoxSelectionMode = SelectionMode.One; When I navigate the grid, cursor in the underlying bindingManager changes: this makes sense. When a piece of code deletes the current row, from the table, this row disappears from the grid: makes sense, too After deleting the current row, cursor in the bindingManager changes to the next row in the DataTable, but grid shows that nothing is selected: this does not make sense to me. I can probably catch the event when table changes and make selection manually, but is there a simplier way? Thank you (using v3.0.1.1)

Administrator [Syncfusion]
Replied On August 26, 2005 11:39 PM UTC

I do not know of a simpler way to do this. Here is a sample that uses RecordDeleting to manage this. http://www.syncfusion.com/Support/user/uploads/GGC_Delete_e227177c.zip

Administrator [Syncfusion]
Replied On August 27, 2005 01:33 AM UTC

Thank you. This would have worked if I was to delete records from the grid. According to help, when I delete records directly from the datasource, SourceListListChanged event will be raised. I tried to achive the same functionality in that event with the code similat to what''s below, but failed. My selected row is not VISIBLY selected (but works otherwise!) private void ggcGeneric_SourceListListChanged(object sender, TableListChangedEventArgs e) { GridGroupingControl ggc = sender as GridGroupingControl; BindingManagerBase currency = bindingContext[ggc.DataSource]; Syncfusion.Grouping.Record recToBeSelected = null; if (currency.Position >= 0) { foreach (Syncfusion.Grouping.Record rec in ggc.Table.FilteredRecords) { object p = rec.GetData(); if (p == currency.Current) { recToBeSelected = rec; break; } } } if (recToBeSelected != null) { int rowIndex; rowIndex = ggc.Table.FilteredRecords.IndexOf(recToBeSelected); recToBeSelected.SetCurrent(); } } I''m afraid I would ask you for example, how to manually select a row from within that event.

Administrator [Syncfusion]
Replied On August 27, 2005 09:06 AM UTC

I think you will have to put a slight pause in your event handler to permit the gird to finish what it does there. Otherwise, your settings will later be stepped on by what the grid is doing. Here is a little sample using this technique. http://www.syncfusion.com/Support/user/uploads/GGC_Delete_378496c.zip


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon