RIAS
asked on
Sorting a boolean column in datagridview +vb.net 2005 windows programming
Hi,
I am struggling on how to sort a boolean column in datagridview.
When grid is bound with datatable the column has no value in it.Now when I check the row the item value of the boolean column value is true and when uncheck it the value gets false.
When the column is sorted it sorts by the false and blank value.This is a problem how do I make blank and false same when sorted.Any suggestions?
I am struggling on how to sort a boolean column in datagridview.
When grid is bound with datatable the column has no value in it.Now when I check the row the item value of the boolean column value is true and when uncheck it the value gets false.
When the column is sorted it sorts by the false and blank value.This is a problem how do I make blank and false same when sorted.Any suggestions?
Otehr Question ..Isn't the column contains CheckBoxes A DatagridView CheckBoxColumn?
ASKER
Hi,
No its a not a checkbox column it is a
dtTemp.Columns.Add("Select ion", GetType(Object))
so it has a false or true value as I didnt want he checkboxes to appear in the column I created a column like the above.
No its a not a checkbox column it is a
dtTemp.Columns.Add("Select
so it has a false or true value as I didnt want he checkboxes to appear in the column I created a column like the above.
ASKER
Blank Value is dbnull value
I think that the column add method requires string,string
Me.datagriview1.Columns.Ad d("ColumnN ame" as string,HeaderText as string)
Me.datagriview1.Columns.Ad
ASKER
But how do you add a object column to datatable.Isn't this the way
dtTemp.Columns.Add("Select ion", GetType(Object))
dtTemp.Columns.Add("Select
a sory it is a datatable...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
also try
Me.DataGridView1.Sort(Me.D ataGridVie w1.Columns ("SortCol" ), System.ComponentModel.List SortDirect ion.Ascend ing)
Me.DataGridView1.Sort(Me.D
ASKER
Cheers!!!
2.Set the ThreeState of datagridviewCheckBoxColumn
me.DatagridviewCheckBoxCol