GridView's UpdateMethod not firing

前端 未结 1 1951
星月不相逢
星月不相逢 2021-01-26 09:52

I\'ve got a GridView that I bind to a ObjectDataSource programmatically, like:

ObjectDataSource risks = new ObjectDataSource(\"Risks\", \"RetrieveProjectRisk\");         


        
1条回答
  •  再見小時候
    2021-01-26 10:15

    When you use ObjectDataSource, providing the UpdateMethod isn't enough.

    Your update method will need parameters as to which row to update. The gridview does not provide this on its own.

    You need to implement the RowUpdating to provide the UpdateParameters needed to updated your ObjectDataSource

    Take a look at this ObjectDataSource Example

    0 讨论(0)
提交回复
热议问题