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.
Syncfusion Feedback

Setting the cursor position and selecting to new record in GridGroupin

Thread ID:

Created:

Updated:

Platform:

Replies:

25631 Mar 2,2005 04:25 PM UTC Mar 3,2005 08:44 AM UTC Windows Forms 4
loading
Tags: GridControl
Jose Egea
Asked On March 2, 2005 04:25 PM UTC

Hi: I have problems when I add a new record in a GridGroupingControl working with collections. I would like to set the cursor and select the new added record. Using groupingGrid.TableControl.CurrentCell.MoveTo(this.regViticolaGridGroupingControl.TableControl.Model.RowCount ,1) cursor changes to the last line, but it is not selected. How can do it? Is there a way to do it with a grouped grid?

Administrator [Syncfusion]
Replied On March 2, 2005 05:43 PM UTC

If you set the ListBoxSelectionMode in 3.0.1.0 as here, this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.None; this.gridGroupingControl1.TableOptions.ListBoxSelectionMode = SelectionMode.One; And then use this code to move the currentcell, it the currentrecord gets selected for me. gridGroupingControl1.TableControl.CurrentCell.MoveTo(this.gridGroupingControl1.TableControl.Model.RowCount ,1); gridGroupingControl1.Table.SelectedRecords.Clear(); gridGroupingControl1.Table.SelectedRecords.Add(gridGroupingControl1.Table.CurrentRecord);

Jose Egea
Replied On March 2, 2005 06:44 PM UTC

That''s ok if my grid is not grouped by any column. And how can do the same if the grid is grouped by columns? Regards

Administrator [Syncfusion]
Replied On March 2, 2005 08:11 PM UTC

This is likely a bug. I will forward it to Stefan so we can try to address it in our code. Until then, I think you can handle TableControlCurrentCellMoved and seelct the currentrecord there. private void gridGroupingControl1_TableControlCurrentCellMoved(object sender, GridTableControlCurrentCellMovedEventArgs e) { gridGroupingControl1.Table.SelectedRecords.Clear(); gridGroupingControl1.Table.SelectedRecords.Add(gridGroupingControl1.Table.CurrentRecord); }

Jose Egea
Replied On March 3, 2005 08:44 AM UTC

Hi: Finally I have done this way: if (gridgrouping.TableDescriptor.GroupedColumns.Count==0) { gridgrouping.TableControl.CurrentCell.MoveTo(this.gridgrouping.TableControl.Model.RowCount ,1); gridgrouping.Table.SelectedRecords.Clear(); gridgrouping.Table.SelectedRecords.Add(gridgrouping.Table.CurrentRecord); } I don''t like it very much because when I add a new record and the grid is grouped by any column it''s still pointing to the previous row, not the new one. But it''s the only way I see to avoid an exception. Any suggestion?

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.

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

;