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

How to find first enabled cell in grid...

Thread ID:

Created:

Updated:

Platform:

Replies:

17001 Jul 28,2004 09:24 PM UTC Jul 29,2004 01:48 AM UTC WinForms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 28, 2004 09:24 PM UTC

When my app opens, I''d like to set focus to the first editable cell in the grid. I presume that CurrentCell.MoveTo is the appropriate method, but I don''t know how to identify the row/column of the first enabled cell. Ideas? Thanks, s.s.

Administrator [Syncfusion]
Replied On July 28, 2004 10:37 PM UTC

Do you want to look through the row or down the column? You have some choices to consider. You can always loop though cells checking grid[row,col].Enabled until your find one, and then use grid.CurrentCell.MoveTo to position that currentcell. If you want to look across the first row, and you know the first row has at least one enabled cell, you can use code like this to find it without looping. this.gridControl1.CurrentCell.MoveTo(1,0); this.gridControl1.CurrentCell.MoveRight(); You can do the something similar looking down column 1. But if you do not have information to know there is at least one enabled cell in a row or column, then I think you would have to loop through the rows and columns in the order you decide, looking for an enabled cell.

Administrator [Syncfusion]
Replied On July 29, 2004 01:48 AM UTC

Thanks, Clay. Indeed, the row and column of the first enabled cell varies frequently. I was hoping there might be a better way than that (some usage or variation of QueryNextEnabledCell) that would do the trick. Since I set the enabled attribute during the grid''s load logic, I just decided to save the location of the first enabled cell. Thanks again. s.s.

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

;