Solved

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

Posted on 2011-09-07
1
294 Views
Last Modified: 2012-05-12
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
0
Comment
Question by:jongrossex
1 Comment
 

Accepted Solution

by:
jongrossex earned 0 total points
ID: 36500480
added an order by to the datasource and it all started to work as expected.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question