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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with grdiview databinding on Edit command

Status
Not open for further replies.

alan6895

Programmer
Aug 3, 2007
48
US
I've created a search routine that uses a search string and some drop-down options to create a SQL query. I then assign this query to grdBrowse.SelectCommand = "query" on the search button click. This works fine and pulls the searched data correctly. The problem is when I click on the auto-generated Edit linkbutton. The gridview forgets my query string. That is, when I click the Edit linkbutton, the grid fills with nothing and hides itself. Doesn't the SelectCommand action assign a select command until it's changed? I'm really confused by that fact that it runs fine when searching, but editing breaks it. Has anyone had this problem or know of a solution? I'll keep looking around, but I'm hoping somebody knows what's up. Thanks!
 
An important part I forgot is that the data in the gridview is being filled by a SqlDataSource control, which is what has it's SelectCommand populated by the Search button click.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top