ASP.Net Grideview - Editing wrong row, after a where clause has been applied

I have a standard gridview that is bound to a linq datasource.  Editing/Updating worked fine till I started to filter the datasource.

When the user clicks the search button the datasource correctly filters the grid but when I select 'Update' on one of the rows
- The where clause is no longer used and I see all of the row again
- The wrong row is showing the edit controls in the grid.

Below is the code behind the 'Search' button.

 User_LinqDataSource.Where = "User_FirstName.Contains(@First)"
 User_LinqDataSource.WhereParameters.Clear()
 User_LinqDataSource.WhereParameters.Add("First", TextBox1.Text.Trim)

I am very new to databound controls so I hope this is an easy one for somebody.

Visual Studion 2010
vb.net
jongrossexAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jongrossexConnect With a Mentor Author Commented:
added an order by to the datasource and it all started to work as expected.
0
All Courses

From novice to tech pro — start learning today.