The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
I have a DataGrid (Windows Forms), which I have programmed such that whole rows are selected. When a user presses a button, I want to check whether an item in the DataGrid has been selected.
Is there a DataGrid property that indicates whether a row has been selected in the DataGrid.
For example, in C++ (MFC) the list view control has a property that has a value of -1 when no row has been selected in the control. If a row is selected, it returns the row number.
Is there something similar for the DataGrid?
I noticed that the method CurrentRowIndex returns the currently selected row or the last selected row when nothing is highlighted in the DataGrid.
If there isn't something equivalent, what would be the best way of figuring it out, without having to iterate through the entire DataGrid?
Thanks.
Don't worry about this one...I figured it out.
> Hi,
>
> I have a DataGrid (Windows Forms), which I have programmed such that whole rows are selected. When a user presses a button, I want to check whether an item in the DataGrid has been selected.
>
> Is there a DataGrid property that indicates whether a row has been selected in the DataGrid.
> For example, in C++ (MFC) the list view control has a property that has a value of -1 when no row has been selected in the control. If a row is selected, it returns the row number.
> Is there something similar for the DataGrid?
> I noticed that the method CurrentRowIndex returns the currently selected row or the last selected row when nothing is highlighted in the DataGrid.
>
> If there isn't something equivalent, what would be the best way of figuring it out, without having to iterate through the entire DataGrid?
> Thanks.
JIJimMarch 18, 2003 11:02 AM UTC
So, what was your solution? I'd be really interested to know.
Thanks,
Jim