我有一个 DropDownList,它根据所选值填充 GridView。然后,我有一个 FormView,我想根据从 DataGrid 中选择的字段来填充数据。
我的 GridView 有 DataKeyNames="ID",然后我使用以下命令来更新所选字段:
<项目模板>
)">更新
我的 FormView 的 ObjectDataSource 使用以下内容:
当用户单击网格中的“更新”时,我似乎仍然无法让 FormView 填充正确的数据,或者根本无法填充任何数据。
有什么想法吗?
I have a DropDownList that populates a GridView according to the selected value. I then have a FormView that I want to populate with data depending on what field was selected out of the DataGrid.
My GridView has DataKeyNames="ID", and I then use the following to update the selected field:
<ItemTemplate>
<a href="#" onclick="addEdit(<%# Eval("ID") %>)">Update</a>
</ItemTemplate>
My FormView's ObjectDataSource uses the following:
<asp:ControlParameter ControlID="grvMain" Name="pID" PropertyName="SelectedValue"
Type="Int32" />
I still can't seem to get the FormView populated with the correct data, or any data at all for that matter, when user clicks on Update in the grid.
Any ideas?
发布评论
评论(1)
添加以下内容到 gridview
应该创建一个选择按钮。
Add the following, to the gridview
Should create a select button.