Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / September 2003

Tip: Looking for answers? Try searching our database.

Simple Datagrid questions

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Philip Tepedino - 26 Sep 2003 16:01 GMT
Hi,

I have a datagrid setup to do full-row select. When I select a row, I need
to be able to know what the value of the current row's column X is.. how can
I find the value of a specific column when a row is selected?

i'm very used to VB6's listview, and am trying to learn the datagrid, but it
just seems overly complicated for very simple things.

Any help would be appreciated,

Philip Tepedino
MCF - 30 Sep 2003 06:13 GMT
This might help:

// Get the BindingManagerBase of the DataTable.
BindingManagerBase bindingMgrBase =
this.BindingContext[myDataSet.myDataTable];
// Get a DataRowView of the selected row of the DataGrid.
DataRowView drv = (DataRowView)bindingMgrBase.Current;
// Get the DataRow from the DataRowView.
DataRow myDataRow = drv.Row;
// Get the DataColumn from the DataRow.
DataColumn dc = myDataRow["ColumnName"];

I'm not sure that's exactly right.  Anyway, you need to use the Data Binding
stuff.

> Hi,
>
[quoted text clipped - 8 lines]
>
> Philip Tepedino

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.