D
David
This isn't exactly about DataGrid. It's about DataGridView, but I'm hoping
this newsgroup is close enough. I have a ComboBox type column in a
DataGridView. (VS 2005, .Net 2.0 Beta
versions)
This is an unbound column. No datasource, datamember, or valuemember is
defined. The columns all have an item list.
Is there a simple way to get at the selected index of the combobox in a cell
from that column? For a given cell, I want to get at the SelectedIndex
property of the combobox in that cell. As it is, all I can seem to do is get
at the Value property, which will return the corresponding string. Since it
is an unbound column, I don't have any way of associating a DataMember with
the list of items. (Do I?)
So, the only way I can see to do what I want is to retrieve the Value
property, and then compare that to each item in the list until I get a match,
and then return the position in the list from which the Value was found.
(And if there are two identical items, even that wouldn't work.) Can I get
directly at the selected index value in the DataGridViewComboBoxCell if that
column is an unbound column?
this newsgroup is close enough. I have a ComboBox type column in a
DataGridView. (VS 2005, .Net 2.0 Beta
versions)
This is an unbound column. No datasource, datamember, or valuemember is
defined. The columns all have an item list.
Is there a simple way to get at the selected index of the combobox in a cell
from that column? For a given cell, I want to get at the SelectedIndex
property of the combobox in that cell. As it is, all I can seem to do is get
at the Value property, which will return the corresponding string. Since it
is an unbound column, I don't have any way of associating a DataMember with
the list of items. (Do I?)
So, the only way I can see to do what I want is to retrieve the Value
property, and then compare that to each item in the list until I get a match,
and then return the position in the list from which the Value was found.
(And if there are two identical items, even that wouldn't work.) Can I get
directly at the selected index value in the DataGridViewComboBoxCell if that
column is an unbound column?