Filter Not Working

  • Thread starter Thread starter TJO
  • Start date Start date
T

TJO

I have the following code on an button event on my page that attempts to
change a DataGrids DataSource to a DataView filter.. When the page renders
there is not affect and I feel real stupid about it. A little help here?

DataView filterView = new DataView(filingCabinetDataSet1.FilingCabinet);

filterView.RowFilter = "LocationID = " +
Convert.ToInt32(drp_locationfilter.SelectedValue);

filterView.Sort = "LetterCategory, FileTitle";

grid_FilingRecs.DataSource = filterView;

grid_FilingRecs.DataBind();
 
Hi,

I'm not using datatables or datasets but are you missing assignment to
dataview :

DataView myView = DSOrder.Tables["OrderDetails"].DefaultView;
myView.Sort = "Quantity ASC";
myView.RowFilter = "OrderID = 10248";


Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
 
Thanks Natty, but I dont think so. Your code and mine is simlar.
something wierd is going on I need to look closer.
 
Back
Top