Flexgrid focus row (net version)

Posted by: devcode.ou on 6 December 2023, 7:31 pm EST

    • Post Options:
    • Link

    Posted 6 December 2023, 7:31 pm EST

    I have not be able to set the focus on the selected row in flexgrid net version,

    lets say

    • i start a search
    • i want to set the focus on the first rows of the flexgrid
                    flexgrid.Select(0,0,true);

    The focus is on the flexgrid but not on the row (i also tried to add this.flexgrid.Focus()),

    if i press the down arrow key i will go to the selected row,

    so basically I have to press the down arrow key twice to start scrolling the grid

    Any advise?

  • Posted 7 December 2023, 9:16 pm EST

    Hi Beniamino,

    As per our understanding of your use-case, you are trying to select a row in flexgrid via code and then want to scroll down the grid using down arrow key.

    FlexGrid’s Select() method applies selection on the specified cell. By default, NET8 FlexGrid’s SelectionMode is “Row”. Therefore, the following code selects the first row of the flexgrid:

    grid.Select(0, 0, true);

    If you want to set the focus on the first cell of the selected row, you can use FlexGrid’s SetCursor() method:

    grid.SetCursor(grid.Selection.Row, grid.Selection.Column);

    Doing this, will allow you to scroll down the grid with single down arrow key press.

    Kindly refer to the attached sample for full implementation. See FocusCell.zip

    Thanks & Regards,

    Aastha

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels