Listview Sorting


https://www.nevron.com/Forum/Topic7272.aspx
Print Topic | Close Window

By Marcus McCallum - 11 Years Ago
Hi,

I am using a the Listview control. I have created columns that can be sorted numerically. This all works well, until I come to refresh the data and add in new data. In some cases I then get this error

An unhandled exception of type 'System.ArgumentException' occurred in system.windows.forms.dll

Additional information: '0' is not a valid value for 'index'.

Does anyone have any idea what is going on? I have tried to clear the extended columns before refreshing and adding in new data and then adding the extended columns in again, but this error still occurs. It seems to only happen when the listview has been refreshed and in that case the new listview doesn't have any data.

Basically I would like to know how can I get the listview to get backs to its original state before I clicked a column to sort, i.e., remove the sorting capability till the new data has been entered?

Thanks,

Marcus
By Craig Swearingen - 11 Years Ago

Sorry I can't offer a work around suggestion but I saw this same exception a different way and reported it here:

http://forum.nevron.com/shwmessage.aspx?forumid=2&messageid=6454