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 Data Binding / November 2004

Tip: Looking for answers? Try searching our database.

DataGrid currentRowIndex and table's rows, in sync while sorting?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
.NET newbie - 23 Nov 2004 07:30 GMT
Hi,

I'm quite new to .NET so sorry if this is silly question.

(.NET 1.1)
I have a dataset with a table (e.g. myTable) filled with records.
I have a datagrid on a form showing some colums of this
table. I also have a button on the form called editButton.

When the user selects a row and clicks editButton I want
to show a new form for editing that record. what I do is
that I get the CurrentRowIndex property of the dataGrid
then I access the selected record by:
dataset.myTable.Rows[CurrentRowIndex]...
and everything is fine ...

But if the user clicks on the header of a column to change
the sort order of the records shown in the datagrid and then
selects a row and clicks editButton this won't work, as
the row 5 in the dataGrid might be the row 2 on myTable
and so on.

Is there a way to either
get the corresponding row number in the table
or
get a new table based on the new sort order?

Regards,
Newbie
Beverley - 23 Nov 2004 19:19 GMT
Try here: http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q934q

I was just looking for something else on that site and I think this addresses your
problem.

> But if the user clicks on the header of a column to change
> the sort order of the records shown in the datagrid and then
[quoted text clipped - 9 lines]
> Regards,
> Newbie
.NET newbie - 24 Nov 2004 11:39 GMT
Hi,

Yes, that's exactly what I wanted to do.
Thanks a lot for your help and also
thanks for that great site.

Regards,
Newbie

> Try here: http://www.syncfusion.com/FAQ/WinForms/FAQ_c44c.asp#q934q
>
[quoted text clipped - 15 lines]
>> Regards,
>> Newbie

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.