Solved

Need to get a value from a datagrid.

Posted on 2006-10-23
3
149 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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