Forum Discussion

litty_john's avatar
12 years ago

How to get the selected cells in dev express string grid

Hi,

Does anybody know how to test if a cell is selected in devexpress string grid.
Please help if you come across any solutions.

Thanks,
Litty

1 Reply



  • Hi,



    I don't know how to check if a cell is selected, you should check the documentation from DevExpress.



    But, maybe this function can help you



    /// <summary>

    /// Clicks on a certain cell from a grid.

    /// gridObject: the name of the grid

    /// rowIndex: the index of the row

    /// columnVisibleIndex: the column's visible index (the first visible column has VisibleIndex = 0)

    /// text: text to enter the the cell

    /// </summary>



    function EnterInfoInCell(grid, rowIndex, columnVisibleIndex, text)

    {

      grid.Focus();

      view=grid.MainView;

      var column = view.GetVisibleColumn(columnVisibleIndex);

      if(column != null)

      {

        view.SetRowCellValue(rowIndex, column, text);

      }  

    }



    Raluca