Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datagrid sorting problem

Status
Not open for further replies.

tmar

MIS
Mar 24, 2007
62
US
I have a data grid with several columns, the first of which is an integer column which I have formated as N0.

When data is loaded in the grid I am able to sort by this column with no problem. I the user changes the value of one of the cells in the first column to be a different integer value (like from 10 to 15) and tries to resort by clicking on the column title, we get the following error.

"Object must be of type string" and one time when I was testing it I got an error stating "Object must be of type Int32".

Any ideas on what's going on and more importantly how to fix it?
 
Hi,

I started to receive this error today in a DGV, and I've managed to solve the issue.

I had a NULL value in the column I was trying to sort, which made the app error out.

It might be worth checking the dataset for NULL values. Just an idea.

Kat

I'm such a noob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top