473,657 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid numerical sorted instead alphanumerical. ..

Hi to all,

I have a datagrid filled with string values, and when i click in a header
column the datagrid is alphanumerical sorted , but i need sort some columns
by numeric way...

The datasource of this Datagrid is a DataView, that is a View of a DataTable
(using the property of the datatable.Curre ntView)

Do you know how could i solve the sorting problem to have a numerical sort,
instead an alphanumerical sorting?

Thanks a lot.
Josema.
Nov 17 '05 #1
2 1810
Josema,

"Josema" <Je******@ocu.o rg> schreef in bericht
news:3D******** *************** ***********@mic rosoft.com...
Hi to all,

I have a datagrid filled with string values, and when i click in a header
column the datagrid is alphanumerical sorted , but i need sort some
columns
by numeric way...

The datasource of this Datagrid is a DataView, that is a View of a
DataTable
(using the property of the datatable.Curre ntView)

Do you know how could i solve the sorting problem to have a numerical
sort,
instead an alphanumerical sorting?

Thanks a lot.
Josema.


You could change the type of the column to a numerical type, if the column
only has numbers in it.

If the column mixes alpha and numerical I wouldn't know actually.

Alternatively, you could sort the DataTable yourself in response to clicks
on the header.

By the way, you might consider posting this question in either
microsoft.publi c.dotnet.framew ork.windowsform s
or
microsoft.publi c.dotnet.framew ork.windowsform s.controls

Hope this helps,
Tom T.
Nov 17 '05 #2


Thanks, its was so useful, i have some columns with numerical value, i
will try to localize it, cause my datatable is dinamic (any number of
columns)...

Its a good clue to start with it.

Thanks again.
Josema.

*** Sent via Developersdex http://www.developersdex.com ***
Nov 17 '05 #3

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

Similar topics

5
2594
by: Ruthless | last post by:
Hello. As a greenhorn i've got some new questions... Is there any type in XSD for alphanumerical strings? if not: What is XSD pattern for alphanumerical strings? E.g. password: alphanumerical and lenght=6(at least) And second thing(sorry ;D)
6
35470
by: Dan | last post by:
I'd like to loop through selected datagrid rows and extract specified columns from those rows. How would I do that? Thanks... Dan
5
1815
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 of the item selected by the user? That is, not the datagrid index 'location' of the item the user selected, but the value inside a column of this item the user clicked on. I would use the CurrencyManager in a windows application but I'm not...
5
2774
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go to the database to get the next page. Is there a way to use the dataset to allow us to read back and forth in it instead of going back to the database to get it? Thanks,
10
4941
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 the column order of the datatable). I also allow the user to click on a column header to sort the datagrid by that column. I need to identify the row and column in the datatable when the user clicks on a cell in the datagrid. Using the...
1
219
by: Abhi | last post by:
Hi all, I am stuck in a situation where I want to sort the datagrid column in numerical order where it originally is in string format. For example suppose there are 3 fields id, name, age in datagrid where all are in string format. But in 'id' coloumn there are numbers like 1, 2 .... and also string data like A0001, B0034, and so on.. Now my problem is to somehow tell .Net that whenever possible, consider the data in 'id' field as...
2
7220
by: jediknight | last post by:
Hi, I have a listview which has columns of text and columns of numerical data. I need to be able to sort these columns into ascending/desending order whenever the user clicks on the column header. The text columns are sorted correctly but the numerical columns seem not to get sorted properly. For example I get the following result when I try to sort a numerical
0
1334
by: rn5a | last post by:
A DataGrid control displays records from a SQL Server 2005 DB table. The AllowSorting property of the DataGrid has been set to True & the SortExpressions of the BoundColumns have been set to the different columns so that users can sort the DataGrid by clicking the headers in the DataGrid. The DataGrid can be sorted using all the headers in the DataGrid except for the first column header. <asp:DataGrid ID="dg1" AllowSorting="true"...
1
7119
by: ECD | last post by:
Hello all, I can usually find solutions to my .NET problems by searching these groups, but I'm stumped on this one. I have a datagrid in VB.NET (2.0 framework). I want to disable sorting on the first column in the grid only. I havent found a way to reliably do this yet. I tried putting the following code in the datagrid's mouse down event Dim hti As DataGrid.HitTestInfo
0
8392
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8726
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8603
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6163
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4301
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
2
1604
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.