Selection basics (GridControl)

I find the way the selection code works on the GridControl confusing. It feels overly complex to me, which I think is because I can't achieve very simple operations easily. I don't understand where GridRangeInfo objects come from that represent the range I want to select.

So my question has two parts.

1) How do you select a single cell, and how do you select a whole row?

2) Can you sum up how GridRangeInfo is supposed to work in a paragraph or so? Just to give me a idea of where to look for stuff in the future.

Thanks
Ian

3 Replies

JP Jeya Preetha M Syncfusion Team June 7, 2012 06:15 AM UTC

Hi Ian ,

Thank you for your interest in Syncfusion Products.

Query 1:

To selec a cell in a grid, please make use of "this.gridcontrol.CurrenCell.MoveTo()" and to select a entire row, please refer the following code snippet.

<code>

GridRangeInfo activeRange = gridControl1.Selections.Ranges.ActiveRange;

</code>

Query 2:

Grid range is a ectanle box, we can specify the range for the following.

1. single cell

2. group of cells(Rectangle)

3. row

4.column

Please refer the following link:

http://help.syncfusion.com/UG/User%20Interface/Windows%20Forms/Grid/default.htm#!Documents/41423gridrangeinfo.htm

which explains about GridRnageInfo.

Please let me know if you have any concerns.

Regards,

Jeya Preetha M



IB ian bradley June 11, 2012 08:27 PM UTC

Cool, I'll add to that as well:

To select a specific cell, you can do CurrentCell.MoveTo(r,c)

Thanks
Ian


JP Jeya Preetha M Syncfusion Team June 18, 2012 05:54 AM UTC

Hi Ian ,

Thanks for the update.

Yes, using the "CurrentCell.MoveTo(r,c)", you can select the specific cell. To select a range of cell means, please refer the previous update.

Please let me know if you have any concerns.

Reagrds,

Jeya Preetha M


Loader.
Up arrow icon