Filter Not Working

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();
 
N

Natty Gur

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
 
T

TJO

Thanks Natty, but I dont think so. Your code and mine is simlar.
something wierd is going on I need to look closer.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top