Link to home
Start Free TrialLog in
Avatar of mathieu_cupryk
mathieu_cuprykFlag for Canada

asked on

Need to get a value from a datagrid.

private void btnModifyScale_Click(object sender, EventArgs e)

{

if (grdScales.DisplayLayout.ActiveRow != null)

{

if (grdScales.Selected.Rows.Count == 1)

{

try

{

Voxco.Data.Scale _s = Voxco.Data.Manager.Scales.GetObject((int)grdScales.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)grdScales.Rows[0].Cells[0].Value);

Otherwise I get the first row all the time.
ASKER CERTIFIED SOLUTION
Avatar of Naveen Swamy
Naveen Swamy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Naveen Swamy
Naveen Swamy


hope it helps you
Avatar of mathieu_cupryk

ASKER

Nope, I need to get the row selected?