.net - DataGridView Sort issues -


so have data grid view named dtgque here properties of column.

'setting properties due date queduedate.name = "duedate" queduedate.valuetype = gettype(date) queduedate.headertext = "due date" queduedate.celltemplate = new datagridviewtextboxcell 

then after add bunch of rows column

dtgque.sort(dtgque.columns(3), system.componentmodel.listsortdirection.descending) 

but is not sorting 100% correct example here set of dates in order of how sorts. 9/8/2014, 9/2/2014/, 9/15/2014, 10/1/2014 see reason putting 9/2 after 9/8 not right.

my guess should either use:

queduedate.valuetype = gettype(string) queduedate.celltemplate = new datagridviewtextboxcell 

write custom sorting function each time datagridviewtextboxcell.value parsed string datatype date data type , use comparison.

or:

queduedate.valuetype = gettype(date) queduedate.celltemplate = new calendarcell 

have @ calendarcell here.

if data of appropriate type expected work/sort correctly.

hope helps!


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -