473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Determing current table row from DataGrid

Ubi
Hello,

i have a table. a dataView and a DataGrid.
I'm using the dataView to filter the table.
When the user double clicks on the DataGrid i want to get the data of the
first col from the row selected.
The problem is that i can't get the row number of the original table because
the grid is refering to the dataView...
what can i do?
please help...
Nov 16 '05 #1
1 1701
You can use the data binding features to get the current row instead of
finding the row number and going back to the DataSet.

\\\
BindingManagerBase bm;
DataRowView drv;
bm = dataGrid1.BindingContext[dataGrid1.DataSource,dataGrid1.DataMember];
drv = bm.Current as DataRowView;
if (drv != null)
{
MessageBox.Show(drv.Row[0].ToString());
}
///

--
Rob Windsor [MVP-VB]
G6 Consulting
Toronto, Canada

"Ubi" <Ub*@discussions.microsoft.com> wrote in message
news:35**********************************@microsof t.com...
Hello,

i have a table. a dataView and a DataGrid.
I'm using the dataView to filter the table.
When the user double clicks on the DataGrid i want to get the data of the
first col from the row selected.
The problem is that i can't get the row number of the original table because the grid is refering to the dataView...
what can i do?
please help...

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Christopher Weaver | last post by:
I want to set a value in a specific field in the current row of a DataSet. This seems like the most basic thing to do but I can't find the syntax for identifying the current row. IOW, I can do...
3
by: Carolyn Vo | last post by:
I have a datagrid in my web control class that I am trying to get the current rows displayed for. I have enabled paging on the datagrid so if the user is currently on page 3 of 8, and if I have...
2
by: tshad | last post by:
I have multiple Grid objects that are editable on my page. The following is an example of the onEditCommand method. In this case D1 (the Grid object) is known. ...
6
by: Becker | last post by:
Very simple, I have a datagrid on a windows form. I load some rows in it. I click a column header and it sorts ascending. I click it again it sorts descending. This is great, but what I want to...
0
by: Cato Lommerud | last post by:
I have a datagrid control that shows the result from an Acces View and I want to change the current record for other bound controls when the user clicks in the different rows in the datagrid. Since...
3
by: Geoff Jones | last post by:
Hi Can anybody tell me how to find the column index in a DataGrid knowing only the text in the column heading? Any sample code would be most useful. Thanks in advance Geoff
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
0
by: Ben | last post by:
module main ... application.run(new splashform) .. end module after a few screen, I try to load a new codes I got from MSDN on datagrid that works on its own. I took out submain and ran...
1
cori25
by: cori25 | last post by:
I have data in a table for the entire month which breaks out by date, each day I am running the data and updating what currently exists for that day so any changes made will be captured. For example,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.