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. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to find first enabled cell in grid...

Thread ID:





17001 Jul 28,2004 09:24 PM UTC Jul 29,2004 01:48 AM UTC WinForms 2
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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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

Live Chat Icon For mobile
Live Chat Icon