Solved

Need to get a value from a datagrid.

Posted on 2006-10-23
3
150 Views
Last Modified: 2010-04-23
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.
0
Comment
Question by:mathieu_cupryk
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
Naveen Swamy earned 500 total points
ID: 17788139
0
 
LVL 9

Expert Comment

by:Naveen Swamy
ID: 17788144

hope it helps you
0
 

Author Comment

by:mathieu_cupryk
ID: 17788157
Nope, I need to get the row selected?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question