RadGrid -- 不能编辑除最后一行之外的所有行 [英] RadGrid -- Not able to edit all rows except last row
问题描述
我只能编辑(双击)RadGrid 中的最后一行.当我选择任何其他行时,它会引发错误.
I am able to edit (double click) only the last row in a RadGrid. When I select any other row it throws an error.
从数据源中提取 DataKeyValues 时出现问题.请确保正确指定了 DataKeyNames,并且所有指定的字段都存在于数据源中.
There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.
有人遇到过这个问题吗?如果我可以编辑一行,为什么不能编辑其他行?
Has anyone faced this problem? If I'm able to edit one row why not others?
推荐答案
您必须在 MasterTableView
中声明 dataKeyNames
.
例如,如果您的表有三列(Column1,Column2,Column3
)
You have to declare the dataKeyNames
in your MasterTableView
.
For Example , if your table has three columns(Column1,Column2,Column3
)
<telerik:RadGrid ID="RadGrid1" runat="server">
<MasterTableView DataKeyNames="Column1,Column2,Column3">
</MasterTableView>
</telerik:RadGrid>
这篇关于RadGrid -- 不能编辑除最后一行之外的所有行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!