tags:

views:

738

answers:

1

Hii, I am using DataView control to bind a gridview. In dataview data is coming from a table 'cloneUserEntry'. cloneUserEntry table contains a column 'Visibility' whose value is true or false (boolean type). I want to display rows whose visibility is true. So how to set row filter to filter rows whose column 'visiility' contains only true. I am using code as following..

Boolean var=true ;
gvUserDataReadOnly.DataSource = new DataView(cloneUserEntry, string.Format("Visibility = #{0}#", var),  "FirstName ASC", DataViewRowState.CurrentRows);

but this is not working. can anyone ell me how to do this task..?? Thanks in advance..

+1  A: 

Try removing the # characters from the filter statement, i.e., "Visibility = true" instead of "Visibility = #true#". The # are used when filtering using DateTime objects.

Matt Davis
Thanks..It is working..
Devashri