.NET V2.0 select single dataGrid cell RRS feed

  • Question

  • How can I select single cell in dataGrid (.NET V2.0 for Pocket PC 2003)? Can't find propertie "selected" as in the newer versions..
    Tuesday, July 26, 2011 10:34 AM


All replies

  • Check SelectionMode property of the DataGridView is set to CellSelect.

    DataGridView1.CurrentCell = DataGridView1(1,1)
    DataGridView1.CurrentCell.Selected = True


    It all Happenz Sendil
    • Proposed as answer by sendilg Wednesday, February 20, 2013 9:57 AM
    Wednesday, July 27, 2011 7:06 PM
  • Problem is that there are no such control "DataGridView". It is only "DataGrid" V2.0 .Net component. And it has not "SelectionMode" property... Also "dataGrid1.CurrentCell." has only these options: .ColumnNumber, .Equals(), .getHashCode(), .GetType(), .RowNumber, .ToString().
    Friday, July 29, 2011 9:43 AM
  • Are you talking a ASP.net DataGrid Control or Wndows Forms control? Since in Windows Forms control,  DataGrid has been replaced by DataGridView in .NET 2.0, you can get more information here: http://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview.selectionmode(v=VS.80).aspx So the problem comes to that not a right version of control being used, I recommand you to upgrade your Visual Studio to a upper version.

    Helen Zhou [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Helen Zhou Tuesday, August 9, 2011 2:40 PM
    Monday, August 1, 2011 7:42 AM