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.

Row Selection

Thread ID:

Created:

Updated:

Platform:

Replies:

35350 Sep 28,2005 09:11 AM Oct 4,2005 11:24 AM Windows Forms 3
loading
Tags: GridControl
jsun@doble.com
Asked On September 28, 2005 09:11 AM

1. I need to know how to test rows are selected or not for GridDataBoundGrid. I checked the answers for similar posts, but still not quite understand. Please give some details. 2. How to bind data to a single cell of the GridControl? Thank you very much for help. Jerry Sun

Administrator [Syncfusion]
Replied On September 29, 2005 03:06 AM

Hi Jerry, 1.Please try this code snippet: private void gridControl1_SelectionChanged(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventArgs e) { for ( int i = 1 ; i <= this.gridControl1.RowCount ; ++i ) { bool check=this.gridControl1.Selections.GetSelectedRows(true, false).Contains(GridRangeInfo.Row(i)); if (check) { Console.WriteLine("Row "+i+" is Selected"+" This is "+check); } } 2.Please refer this Forum thread, Binding a cell Let us know if this helps. Best Regards, Jeba.

jsun@doble.com
Replied On October 4, 2005 11:00 AM

Hi Jeba, Thank you very much for your help. I tried the code and it did not work. RowCount is a property for the GridCountrol, not for the GridDataBoundGrid. I tried the loop with Rows.Count of the DataTable bounded to the grid, the boolean variable was always false no mater the row was selected or not. The code does not have compile errors. But where should I declare GridRangeInfo? Thank you again for you help. Jerry >Hi Jerry, > >1.Please try this code snippet: > >private void gridControl1_SelectionChanged(object sender, Syncfusion.Windows.Forms.Grid.GridSelectionChangedEventArgs e) > >{ > >for ( int i = 1 ; i <= this.gridControl1.RowCount ; ++i ) > >{ > >bool check=this.gridControl1.Selections.GetSelectedRows(true, false).Contains(GridRangeInfo.Row(i)); > >if (check) > >{ > >Console.WriteLine("Row "+i+" is Selected"+" This is "+check); > >} > >} > > > >2.Please refer this Forum thread, >Binding a cell >Let us know if this helps. > >Best Regards, >Jeba. >

Administrator [Syncfusion]
Replied On October 4, 2005 11:24 AM

In the code above, GridrangeInfo is being used as a static (Shared in VB) member. You just use it as shown as long as you have a using Syncfusion.Widnows.Forms.Grid statement (or an Imports statement in VB). Here is another sample that sowrk with a GridDataBoundGrid. http://www.syncfusion.com/Support/user/uploads/GDBG_6302f039.zip

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.

;