Enable edit buttons with select cmd from code-behind

J

jmacduff

Big question: How to enable edit/update commands to work when setting
the sqldatasource select command from code behind.

Details:

I have a GridView using a sqldatasouce with the select and update
commands set. The gridview is part of a "admin" page where the admin
will view the data, then use the gridview edit/update buttons to update
the data.......that all works great.

However now we want to add a "search" function since the dataset is
pretty big.... so in the codebehind I do this:

//update the select command with a search syntax
this.MusicNamesqlSource.SelectCommand = "EXEC foo.foo_SearchDB " + "'"
+ this.foodbAccess.SafeSqlLiteral(szSearchTerm) + "'";

//rebind the gridview so the select command fires
this.MusicNamesGridView.DataBind();

So that works.. it does display the altered results.. however THEN the
edit buttons dont work! The update command hasnt changed.. but when the
user clicks "update" the update command doesnt work... it doesnt break
or anything.. it simply doesnt work :(

-Jeff
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top