Solved

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

Posted on 2011-09-07
1
296 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

752 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