I’m working with a DataGridView having two TextBoxColumns and a DataGridViewButtonColumn.
As datasource I bound a DataTable with three columns: “ID”, “Name”, “Surname”, but I need to show only the last two columns, so in my datagrid I defined only Name and Surname (and the button column) setting the AutoGenerateColumns property equal to false.
Now I need to use the “ID” field when the button on a row is clicked…
What’s the correct way to get the “ID” value from the current row?
To hide something
.Visibledo not works fast. Try to useDataViewandBindingSource.See this link.
There are
filtersthat works very good.Like this:
Here I find a row:
Here is the Implementation:
Something like this should work.
Hope this help you!