Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-09-07
1
Medium Priority
?
298 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

721 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