I have a gridview bound to an ObjectDataSource, which is a dataset populated by SQL queries. The gridview works with the default SelectMethod configured in the ObjectDataSource. I would like to be able to change the SelectMethod based on user input, which would call a different query. I have one textbox for input and several buttons to pick the type of filter.
My gridview populates on with the default selectmethod if I create a button that does nothing but a postback. My other buttons run the following codes which returns nothing. Any ideas what I'm doing wrong?
If
e.CommandArgument ="Last_Name"ThenEmployeeData.SelectMethod =
"GetDataByLastName"EndIfIf e.CommandArgument ="First_Name"ThenEmployeeData.SelectMethod =
"GetDataByFirstName"EndIfgvPhoto.DataSourceID = EmployeeData.ID
gvPhoto.DataBind()
Thanks.
Lisa
Call EmployeeData.Databind() before the dvPhoto.DataBind()
Hope this help
No comments:
Post a Comment