I have the following littel sub that fires when GridView1 row created:
Protected Sub xxxxx(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
Dim C_ID As String = GridView1.SelectedRow.Cells(0).Text
GetC_AttributesObjectDataSource.InputParameters("C_ID") = C_ID
GetC_AttributesObjectDataSource.DataBind()
End Sub
The problem is, there is an error, as some of you may see GetC_AttributesObjectDataSource.InputParameters("C_ID") = C_ID is the wrong part.
As an example, GetC_AttributesObjectDataSource.InputParameters("C_ID") = C_ID will only work with the correct method signature which is:
Protected Sub GetC_AttributesObjectDataSource_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.ObjectDataSourceSelectingEventArgs) Handles GetC_AttributesObjectDataSource.Selecting
Dim C_ID As String = GridView1.SelectedRow.Cells(0).Text
GetC_AttributesObjectDataSource.DataBind()
e.InputParameters("C_ID") = C_ID
End Sub
Well , the second one works but not on GridView1.RowCreated, instead it works with GetC_AttributesObjectDataSource.Selecting, which does not help me.
How can I do my proposed operation with the GridView1.RowCreated event?
polynaux
Member
195 Points
775 Posts
Incorrect method signature: ObjectDataSource funktionality for the GridView.RowCreated event
Jan 30, 2008 10:44 AM|LINK
Hi Guys,
I have the following littel sub that fires when GridView1 row created:
Protected Sub xxxxx(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated Dim C_ID As String = GridView1.SelectedRow.Cells(0).Text GetC_AttributesObjectDataSource.InputParameters("C_ID") = C_ID GetC_AttributesObjectDataSource.DataBind() End SubThe problem is, there is an error, as some of you may see
GetC_AttributesObjectDataSource.InputParameters("C_ID") = C_ID is the wrong part.
As an example, GetC_AttributesObjectDataSource.InputParameters("C_ID") = C_ID will only work with the
correct method signature which is:
Well , the second one works but not on GridView1.RowCreated, instead it works with GetC_AttributesObjectDataSource.Selecting, which does not help me.
How can I do my proposed operation with the GridView1.RowCreated event?
many thanks,
polynaux