P
Paul E
I have a column on my DataGridView that is of the type
DataGridViewComboBoxColumn. On some of my rows, I want to keep the user
from changing the value in that field.
What I'm doing now is, as soon as I populate my rows, I run through
each row something like this:
private: System::Windows::Forms:ataGridView^ Fields;
...
#define COMBO_COL 3
for (int i = 0; i < Fields->RowCount; ++i)
{
if (it shouldn't be changed)
{
Fields->Rows->Cells[COMBO_COL]->ReadOnly = true;
}
}
That works, but it both looks ugly and doesn't give the user a clue
about why the combo box's arrow doesn't do anything.
Ideally, what I'd like to do is hide the arrow altogether for those
rows. Does anyone have any ideas about how to do that?
One thought is that I could change the cell type on the fly to a
regular edit cell. I'm not sure how to do that, or if that would just
confuse the control altogether.
DataGridViewComboBoxColumn. On some of my rows, I want to keep the user
from changing the value in that field.
What I'm doing now is, as soon as I populate my rows, I run through
each row something like this:
private: System::Windows::Forms:ataGridView^ Fields;
...
#define COMBO_COL 3
for (int i = 0; i < Fields->RowCount; ++i)
{
if (it shouldn't be changed)
{
Fields->Rows->Cells[COMBO_COL]->ReadOnly = true;
}
}
That works, but it both looks ugly and doesn't give the user a clue
about why the combo box's arrow doesn't do anything.
Ideally, what I'd like to do is hide the arrow altogether for those
rows. Does anyone have any ideas about how to do that?
One thought is that I could change the cell type on the fly to a
regular edit cell. I'm not sure how to do that, or if that would just
confuse the control altogether.