Home Forums WinForms controls Xceed Grid for WinForms How to set focus on a particular cell / row in xceed grid for .Net

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #16992 |

    Hi,

    Can you please provide me a help on, how to set the focus on a particular cell / row on the xceed grid for .NET. With my current code the focus is going on the 1st column of the 1st row. Below is the snapshot of the code that I am using to set the focus.

    Code ### 

    mParentForm.WatchListGrid.SelectedRows.Clear();

    thisRow = mParentForm.WatchListGrid.DataRows[index+1];

    mParentForm.WatchListGrid.SelectedRows.Add(thisRow);

    Thanks & Regards,

    Lalit

     

     

    Imported from legacy forums. Posted by Lalit (had 2894 views)

    User (Old forums)
    Member
    Post count: 23064

    You need to also set the CurrentRow, and call the BringIntoView() method on it.

    e.g.:

    mParentForm.WatchListGrid.SelectedRows.Clear();
    thisRow = mParentForm.WatchListGrid.DataRows[index+1];
    mParentForm.WatchListGrid.SelectedRows.Add(thisRow);

    mParentForm.WatchListGrid.CurrentRow = thisRow;
    mParentForm.WatchListGrid.CurrentRow.BringIntoView();

    Imported from legacy forums. Posted by André (had 2403 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.