Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem setting RowFilter for datgrid

Status
Not open for further replies.

RandyBlackburn

Programmer
Oct 1, 2002
153
US
I have a web datagrid which is using a dataview as its data source. In the designer, the LeadGrid's data source is set to dvLeadSearch. dvLeadSearch's table is set to a dataset.table. It's rowFilter is originally set to "LeadLastName = 'kelly'" in the designer.

The first population of the grid works fine

The RowFilter is reset in the btnLeadSearch_Click sub-routine below. But when I databind in this routine, an empty grid is returned, even if I don't change anything.
This doesn't happen if I set the grid's data source to the dataset.

Code:
Private Sub btnLeadSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLeadSearch.Click
   LeadGrid.DataBind()
End Sub
 
You say that the RowFilter is set in the btnLeadSearch_Click event handler, but I don't see any code to do that. I do this all the time in Windows Forms apps (not in web apps), and all I have to do is change the RowFilter of the DataView and the correct records appear in the grid.

You may want to post this question in the ASP .NET forum (forum855).


I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
jebenson,

I thought I WAS putting this in the asp.net forum... my bad... thanks for pointing it out...

The code I provided shows only the databind in the btnLeadSearch_click. It turned out that it didn't matter what other logic (like setting the filter) I put in there, the databind is what is causing the empty grid to be returned. And if I leave the databind out, nothing happens, even if I change the rowfilter.

I better get to work posting this on the right forum

Thanks again,
Randy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top