473,385 Members | 1,780 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,385 software developers and data experts.

How to get sorted rows from datagrid?

I'm binding a DataTable to a datagrid. I'd like the DataTable to use
any kind of sort the datagrid is using so the two stay in synch. When
some one clicks a data column header and sorts the grid, I want the
underlying DataTable to be sorted. I've tried referencing DefaultView
on the DataTable but it is never sorted. How can I get it to sort?

Thanks,
Brett

Jul 31 '06 #1
1 1618
Here it is:

dv.Table.DefaultView[ CurrentCell.RowNumber ].Row[ "ColumnName" ]
>From the doubleclick() event inside the datagrid.
Brett

Jul 31 '06 #2

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

Similar topics

3
by: Oliver Drobnik | last post by:
Hi, I have a datagrid bound to a datatable. Now if I sort the datagrid by clicking on one of the column heads I can no longer use the index in the datagrid to find the corresponding row in the...
3
by: sam | last post by:
Hello group, The datagrid is sorted using a dataview. Can I get the sorted dataview or table from the datagrid or any other way. All I need to get is the sorted data. Here is my code and what I am...
0
by: DBW | last post by:
I am using a DataGrid control with a DataTable as a data source. Everything seem to work fine until the DataGrid is sorted by clicking on the column header. After that I do not know how to...
5
by: Jason | last post by:
I've been trying to figure out a good way to do this but haven't had much luck, any input would be greatly appreciated. Basically, after a datagrid is sorted, how can I get the primary key value...
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...
1
by: s26f84 | last post by:
Hey Guys Alot of articles and alot of stuff still no answer. Please help me on this one. I need to get data out of a filterred selected row !!! ... this is how my code looks like.... On...
1
by: dever | last post by:
How to prevent a sorted dataview, which bound to a datagrid, from sorting anymore no matter how you change the data values? My users want to sort the datagrid first (i did it by applying...
2
by: Docarctiss | last post by:
Hello every one, this is what i would like to achieve ..... Once i click on a column header in a datagrid it sorts the rows, i select a row to edit but once i accept the edit i don't want it to...
2
by: frenzy99 | last post by:
Can someone suggest a way to Sort two halves of DataGridView (based on the same column/criteria) and then merge the two sorted halves. say the datagrid view has 10 rows (with name/string) 1.D...
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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.