mathieu_cupryk
asked on
Need to get a value from a datagrid.
private void btnModifyScale_Click(objec t sender, EventArgs e)
{
if (grdScales.DisplayLayout.A ctiveRow != null)
{
if (grdScales.Selected.Rows.C ount == 1)
{
try
{
Voxco.Data.Scale _s = Voxco.Data.Manager.Scales. GetObject( (int)grdSc ales.Rows[ 0].Cells[0 ].Value);
ScaleModificationForm _form = new ScaleModificationForm(_s);
_form.ShowDialog();
RefreshData();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message );
}
}
}
This needs to be modified:
Voxco.Data.Manager.Scales. GetObject( (int)grdSc ales.Rows[ 0].Cells[0 ].Value);
Otherwise I get the first row all the time.
{
if (grdScales.DisplayLayout.A
{
if (grdScales.Selected.Rows.C
{
try
{
Voxco.Data.Scale _s = Voxco.Data.Manager.Scales.
ScaleModificationForm _form = new ScaleModificationForm(_s);
_form.ShowDialog();
RefreshData();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message
}
}
}
This needs to be modified:
Voxco.Data.Manager.Scales.
Otherwise I get the first row all the time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Nope, I need to get the row selected?
hope it helps you