Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataGridView
Message
From
06/11/2007 15:53:35
 
 
To
06/11/2007 13:20:42
General information
Forum:
ASP.NET
Category:
Forms
Title:
Environment versions
Environment:
C# 2.0
OS:
Vista
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01267049
Message ID:
01267120
Views:
6
This message has been marked as a message which has helped to the initial question of the thread.
Sergio,

You can use the MyDataGridView.CurrentRow.Index to get the index into the grid's datasource. I assume that you want to pass a DataRow to your form? If so, you'd do something like this:
int i = MyDataGridView.CurrentRow.Index;
DataRow row = MyDataSet.MyTable.DefaultView[i].Row;
// or ....MyDataSet.Tables["MyTable"].... if you're not using Typed DataSets

// pass row into the called form
Does that help?

~~Bonnie




>I have a DataViewGrid on my form and an edit button.
>The click event of the edit button calls a form.
>
>How do I pass to the calling form the selected row on DataGridView???
>What do I pass to the calling form?
>
>Thanks,
>Sergio
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform