Solved

Need to get a value from a datagrid.

Posted on 2006-10-23
3
144 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
  • 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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now