Thursday, November 8, 2007

ObjectDataSource SelectParameters

If you have a component being bound from an ObjectDataSource (like a drop-down menu, or a grid view) and you wish to change the value's parameters SelectParameters:

ObjectDataSource.SelectParameters(#).DefaultValue = value
GridView.DataBind()

Where # is which SelectParameter you'd like to change. If there's just one SelectParamter, default is 0. Then reference your object that uses that datasource, in this case a GridView, to rebind.

No comments: