It is awkard to code up the following:
double dFreq =
Convert.ToDouble(dataGridView1.Rows[CurrentFrequency].Cells[freqDataGridViewTextBoxColumn.Index].Value);
It seems to me (comeing from CBuilder6) that I should be able to specify the
selected row as in
dataGridView1.Rows[CurrentFrequency].Selected = true;
and then get the column values directly from the column identifier as in
(this does not work)
double freq = freqDataGridViewTextBoxColumn.value;
There is no method or property that I can see in the column identifier.
Even setting a breakpoint right after the CurrentRow is selected I can
search thru that column identifier, or the TableAdapter or the bindingSource
or the DateSet. ie: I cannot find a "value" that I can access after the row
is selected. Indexing cell[] works fine, just seems there is a better way
no?

Signature
=======================================================================
Joseph "Beemer Biker" Stateson
http://ResearchRiders.org Ask about my 99'R1100RT
=======================================================================
Bart Mermuys - 29 Jan 2007 19:33 GMT
Hi,
> It is awkard to code up the following:
>
[quoted text clipped - 16 lines]
> access after the row is selected. Indexing cell[] works fine, just seems
> there is a better way no?
There are other ways but not necesairly better, depends ...
* Using BindingSource:
- set current row
someBindingSource.Position = rowIdx;
- get data from current row:
double freq = (double)((DataRowView)someBindingSource.Current)["freq"];
- get typed DataRow (when using typed DataSets):
SomeTypedDataSet.SomeTypedRow row =
(SomeTypedDataSet.SomeTypedRow)
((DataRowView)someBindingSource.Current).Row;
* Using DataGridView:
- set current row:
dataGridView1.CurrentCell = dataGridView[rowIdx, 0];
- get data from current row
double freq = (double)dataGridView1.CurrentRow.Cells["freq"].Value;
HTH,
Greetings