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

Addressing Cells in a selected Row

Thread ID:

Created:

Updated:

Platform:

Replies:

1407 Oct 24,2002 10:13 AM UTC Oct 24,2002 01:44 PM UTC WinForms 1
loading
Tags: GridControl
Scott Baker
Asked On October 24, 2002 10:13 AM UTC

Basically, I need to know the indexs of the rows that are selected within the grid, i.e.. int selectedRow = ?? int selectedCol = ?? this.gridControl1[selectedRow, selectedCol].CellValue = "Hello"; AND enumerator = this.gridControl1.Selections.SelectedRows(false,true).GetEnumerator(); while(enumerator.MoveNext()) { Syncfusion.Windows.Forms.Grid.RowObject selectedRow = enumerator.Current as Syncfusion.Windows.Forms.Grid.RowObject; selectedRow[Col].CellValue = "Hello"; } I would appreciate any direction you can offer, and do thank you in advance for being patient with the pseudo code I used to attempt to convey my problem. Regards,

Administrator [Syncfusion]
Replied On October 24, 2002 01:44 PM UTC

Since it looks like you ultimately want to access the selected cells in the grid, then you ultimately have to get at the row and col index. One way to do this is to iterate through the GridControl.Selections.GetSelectedRanges collection, and look at each range. One technical point is that a range can be just a range of columns or rows or cells or table. And to loop through by row/col, the range has to have the top, left, bottom, right properties properly set for each of these different kinds of ranges. The GridRangeInfo.ExpandRange method handles this technical problem for you. Attached is a sample that shows how you might go about this task.

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

;