473,544 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataView sort does not show in DataGrid

I have a DataTable in a DataSet. A DataGrid is bound to the DataTable.
When I assign a field to the DataTable.Defau ltView.Sort property the
order in the DataGrid does not change.

What am I missing?
--
Bill
Nov 16 '05 #1
4 4302
Sorry. I should have added that this is a WinForms app.
--
Bill
Nov 16 '05 #2
Todd:

The DefaultView will send the sort back to its original state, so if you
haven't reset it, then it's not going to do anything. Just to test, call
..Sort on another field, anyone will do just to verify that it's working. If
you've already called so, then let me know.

Cheers,

bill
"Bill Todd" <no@no.com> wrote in message
news:3b******** *************** *********@4ax.c om...
I have a DataTable in a DataSet. A DataGrid is bound to the DataTable.
When I assign a field to the DataTable.Defau ltView.Sort property the
order in the DataGrid does not change.

What am I missing?
--
Bill

Nov 16 '05 #3
Hi Bill,

I reviewed the thread, and find that you have posted a similar problem inn
the same newsgroup.
Subject: Why must I rebind DataGrid to see Sort?
Newsgroups: microsoft.publi c.dotnet.langua ges.csharp

You may go and have a check, if you still have any concern on this issue,
please post there and I will follow up in that thread.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 16 '05 #4
Bill:

I just read your top post.. You are binding to the DataTable... Create a
DataView and bind to it instead. The View's sort has No effect on the
datatable's positioning, so if the grid is bound to it, it won't do
anything. Bind to the view instead.
"Bill Todd" <no@no.com> wrote in message
news:3b******** *************** *********@4ax.c om...
I have a DataTable in a DataSet. A DataGrid is bound to the DataTable.
When I assign a field to the DataTable.Defau ltView.Sort property the
order in the DataGrid does not change.

What am I missing?
--
Bill

Nov 16 '05 #5

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

Similar topics

4
1528
by: Martin Schmid | last post by:
I am trying to implement a DataView for a DataGrid so I can sort at runtime by clicking on column headers. My initial page load works... it displays the data However, when I click a column heading at run time, the data doesn't sort as expected, in fact, the DataGrid becomes empty, all I see are column headings: SqlConnection...
2
3279
by: Alpha | last post by:
I have a window application. In one of the form, a datagrid has a dataview as its datasource. Initial filtering result would give the datavew 3 items. When I double click on the datagrid to edit the selected lie item at which case I would pop up a separate dialog box to do so, in the debugging code, the dataview.count would return 0. I get...
1
1760
by: troyblakely | last post by:
I am having trouble sorting a datagrid. I have read numerous posts on this and other lists, and tried most of the suggestions, but none of them have worked for me yet. I populate a dataset from two queries, then I want to sort the data and bind it to a datagrid. Regardless of what I have tried, the datagrid is populated with the unsorted data....
13
2078
by: Steve | last post by:
I have a form with a dataset and a datagrid. I created a dataview on this dataset. When the user modifies the datagrid, I look up this record in the dataview to make sure it is unique. Here is the confusion......... I thought that the DataView is the view from the dataset, but it seems that the dataview has the records that are in the...
4
2607
by: Aaron Smith | last post by:
Dim dv As DataView = New DataView(FacilitiesDS1.Facilities, "", "ID ASC", DataViewRowState.CurrentRows) Dim iPos As Integer = dv.Find(dr.Item("ID")) Me.BindingContext(FacilitiesDS1, "Facilities").Position = iPos That is the code.. dr is DataRow. If dr.Item("ID") = 3, the find will return position 0, which it should have been 1, and if the...
1
1235
by: dbuchanan | last post by:
My code specifies a descending sort, but when my form opens the datagrid is sorted ascending. However the controls that are bound to the datagrid recognize the row selection *as if* the rows were sorted descending. For example: If I select the first row, I get the last row instead. === my code snipit === Private bmb As BindingManagerBase
5
3951
by: enceladus311 | last post by:
I'm trying to find a way to keep from having to fill a DataView after every PostBack to a page. Basically, the design is that I have a DataView that I fill, which I then set as the DataSource to a DataGrid on my page. This works well, however, like I said, I would like to keep from having to fill the DataView on each PostBack. So,...
0
1177
by: brian_is_online | last post by:
Hi all, I have a DataGrid which is bound to a DataView to return search results. The DataGrid headers allow sorting so when clicked I rebind the DataView with the appropriate Sort property. To save expensive database calls, the DataView is used instead of re-querying. I've now got a problem where if I select a row in the DataGrid, then...
10
4268
by: babis | last post by:
I work with .NET2003 C# windows form application, i add a datagrid in my form like this: dataGridProduct.DataSource = dataViewProduct; I also make the allowSort property of the datagrid set to be true. Here is my problem, i want to make when i click one of the datagrid cell, said there're ProductID or ProductName, i also show it in my...
0
7434
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7371
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7622
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5925
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5305
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4925
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3420
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1848
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.