.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
Post a Comment