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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Tracking Row Selection

Thread ID:

Created:

Updated:

Platform:

Replies:

47107 Jul 28,2006 03:44 AM UTC Jul 31,2006 10:38 AM UTC WinForms 4
loading
Tags: GridControl
Bill Langlais
Asked On July 28, 2006 03:44 AM UTC

Hi,

My application needs to update different Graphics Path Objects depending on which rows get selected in a GridGroupingControl with Nested tables and invalidate a graphics control. When the user is doing multi selection I would like to wait until all the selection events finish processing until the last selection event. (One question would that be the row that is actually selected?). Then I want to process the current set of selected records all at once and do the invalidate rather then one at a time while they are being selected.

Is this possible?

Administrator [Syncfusion]
Replied On July 28, 2006 06:40 AM UTC

Hi Bill,

Are you using cell based selection tech? If so, you can use grid.TableModel.SelectionChanged event and check the e.Reason = GridSelectionReason.MouseUp for indicating the end of the selection. Please find the code snippet below.

//Enable the cell based selection tech
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any;

private void TableModel_SelectionChanged(object sender, GridSelectionChangedEventArgs e)
{
if(e.Reason == GridSelectionReason.MouseUp)
{
GridTableModel model = sender as GridTableModel;
foreach(GridRangeInfo info in model.Selections.GetSelectedRows(true,true))
{
for(int i = info.Top ; i<= info.Bottom ;i++)
{
//To get the selected records.
// and invalid the record here....
if( model.Table.DisplayElements[i].Kind == DisplayElementKind.Record)
Console.WriteLine(i +":::" + model.Table.DisplayElements[i].ParentRecord);

}
}
}
}

For more details about selection types, See
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=344

Regards,
Haneef

Bill Langlais
Replied On July 31, 2006 02:47 AM UTC

Hi,

I am using:

GridGroupingControl->SelectedRecordsChanged

>Hi Bill,

Are you using cell based selection tech? If so, you can use grid.TableModel.SelectionChanged event and check the e.Reason = GridSelectionReason.MouseUp for indicating the end of the selection. Please find the code snippet below.

//Enable the cell based selection tech
this.gridGroupingControl1.TableOptions.AllowSelection = GridSelectionFlags.Any;

private void TableModel_SelectionChanged(object sender, GridSelectionChangedEventArgs e)
{
if(e.Reason == GridSelectionReason.MouseUp)
{
GridTableModel model = sender as GridTableModel;
foreach(GridRangeInfo info in model.Selections.GetSelectedRows(true,true))
{
for(int i = info.Top ; i<= info.Bottom ;i++)
{
//To get the selected records.
// and invalid the record here....
if( model.Table.DisplayElements[i].Kind == DisplayElementKind.Record)
Console.WriteLine(i +":::" + model.Table.DisplayElements[i].ParentRecord);

}
}
}
}

For more details about selection types, See
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=344

Regards,
Haneef

Bill Langlais
Replied On July 31, 2006 03:36 AM UTC

Hi,

Can I use the GridgroupingControls MouseUp event? It seems like the only time you would get a mouse up is when a row is being either selected or deselected.

Administrator [Syncfusion]
Replied On July 31, 2006 10:38 AM UTC

Hi Bill,

You need to use the TableControl.MouseUp event for detecting the end of the record selection in a grid.

this.gridGroupingControl1.GetTableControl("YourTableName").MouseUp +=new MouseEventHandler(TableControl_MouseUp);

private void TableControl_MouseUp(object sender, MouseEventArgs e)
{
Console.WriteLine("End of the selection changed event");
}

Let me know if this helps.
Best Regards,
Haneef

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

;