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

Re: Sorting data in datagrid view

Thanks Nicholas,
Sounds good, but if I display the computed column in the grid, how will
the user add new rows using the data grid view?

Nicholas Paldino [.NET/C# MVP] wrote:
Ashutosh,

You might want to select the data normally, and then create a computed
column on the data set that is returned. This computed column would be a
computed value with the parsed value of the integer.

You would then display that, and it should sort correctly.

Another option is to have the query create a new computed column that
does the conversion on the DB side and then display that column instead.
Nov 4 '08 #1
1 2136
Ashutosh,

Before updating (or when the column is changed), you would have to
generate a value for the original column that the computed column is based
on.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ashutosh" <sm*******@nospam.nospamwrote in message
news:O5**************@TK2MSFTNGP03.phx.gbl...
Thanks Nicholas,
Sounds good, but if I display the computed column in the grid, how will
the user add new rows using the data grid view?

Nicholas Paldino [.NET/C# MVP] wrote:
>Ashutosh,

You might want to select the data normally, and then create a
computed column on the data set that is returned. This computed column
would be a computed value with the parsed value of the integer.

You would then display that, and it should sort correctly.

Another option is to have the query create a new computed column that
does the conversion on the DB side and then display that column instead.

Nov 4 '08 #2

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

Similar topics

12
by: pmud | last post by:
Hi, I am using teh following code for sorting the data grid but it doesnt work. I have set the auto generate columns to false. & set the sort expression for each field as the anme of that...
1
by: Deep Silent Ocean | last post by:
Hi All I have one specific question for DataGrid In the Form Load event of the Form, I am binding data with DataGrid. On clicking Row the CurrentRowIndex is updated and it gives me correct...
2
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child...
1
by: Gary | last post by:
Hi, We are facing a typical problem with sorting a datagrid in Windows application ( c# ) The scenario We have a datagrid which is binded to a dataview which conatins two columns say Name...
1
by: Rushabh Dadbhawala | last post by:
Problem: I am fetching data from the database, storing it in a dataSet, and binding it with a Data Grid. The DataGrid controls allows sorting. The problem is that when the data is sorted on one...
1
by: Newbie | last post by:
Hello! I need help in making my datagrid sortable by clicking a column header. In the datagrid's property builder, Allow Sorting is checked. I am using a Bound column and it's Sort Expression...
5
by: DKC | last post by:
Hi, Using VB.NET. I have a datagrid having a strongly typed array of objects as its data source. The data from the array of objects is displayed by means of a table style, which is fine, but...
0
by: Carl Tribble | last post by:
I have a datagrid in which I want to allow user to edit data and to sort the list by clicking a column header. When they have sorted the list, and subsequently make edits, the list automatically...
0
by: Brian Henry | last post by:
Here is another virtual mode example for the .NET 2.0 framework while working with the list view. Since you can not access the items collection of the list view you need to do sorting another...
0
by: Nathan Franklin | last post by:
Hello Guys, I have been trying to work this our for so long, but I just can't seem to find the answer. I am loading a datatable from a an access database using an oledbdataadapter. I then...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.