DataView Row Filter isn't working

  • Thread starter Thread starter Kim
  • Start date Start date
K

Kim

I need to filter this datatable but when I do it gives me all the data
not filter not sure what Im doing wrong.


DataView dv = new DataView();
dv.RowFilter = "ClientID = " + clientid;
gridControl1.DataSource = dv;

I also tried adding this but it didn't work either:
dv.RowStateFilter = DataViewRowState.ModifiedCurrent;

when I added the Row State Filter after the Row Filter no records was
return.
Any help will be greatly appreciated.
Thanks
Kim
 
What about datatable? where is it? My advice u to use DefaultView property
of datatable
 
I modified this for you from some working production code:

<code>
DataView dv = new DataView( %DATATABLE% , %FILTER_STRING% ,
%ORDER_BY_STRING% , DataViewRowState.CurrentRows );
gridControl1.SetDataBinding( this.currentView , null );
</code>

Replace the %...% markers above with your variabIes and use the
SetDataBinding method instead of just setting the DataSource property.
Works great for me...

HTH,
Joel
 
Hello,
Have you tried putting single quotes around clientID?

something like
dv.RowFilter = "ClientID = '" + clientID + "'";??

Trying using it, it should help.

Maqsood Ahmed [MCP,C#]
Kolachi Advanced Technologies
http://www.kolachi.net
 
Back
Top