如何根据条件启用/禁用radgrid的行双击编辑属性
我有以下代码
Javascript
function RowDblClick(sender, eventArgs)
{
window.radopen("SourceFileAdmin.aspx?SourceSystemFileId=" + eventArgs.getDataKeyValue("SourceSystemFileId"), "UserListDialog");
}
Aspx 网格代码
<telerik:RadGrid ID="RadGrid" runat="server" AllowPaging="True" AllowSorting="True"
GridLines="None" ShowGroupPanel="True" Skin="Black" AutoGenerateColumns="False"
Width="100%" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" PagerStyle-Mode="NumericPages"
OnItemInserted="GridItemInserted"
onitemdatabound="GridItemDataBound">
.............................................
........................................
..................................................
<ClientSettings>
<Selecting AllowRowSelect="true" />
<ClientEvents OnRowDblClick="RowDblClick" />
</ClientSettings>
</telerik:RadGrid>
<asp:Button ID="AddSrcButton" runat="server" Text="Add New" OnClientClick="return ShowInsertForm();" />
我的实际问题是根据用户权限禁用或启用 RowDblClick 属性 这是我在 aspx.cs 文件中的示例代码,我想在其中设置 radgrid 的编辑或查看权限
this.AddSrcButton.Enabled = this.Privilige.CanModify;//the value will be true or false
this.RadGrid.Enabled=this.Privilige.CanModify;
//该值将为 true 或 false ,基于此值我想启用/禁用我的 rowdblclick,任何人都可以提供帮助找出我哪里做错了
I have the following code
Javascript
function RowDblClick(sender, eventArgs)
{
window.radopen("SourceFileAdmin.aspx?SourceSystemFileId=" + eventArgs.getDataKeyValue("SourceSystemFileId"), "UserListDialog");
}
Aspx Grid Code
<telerik:RadGrid ID="RadGrid" runat="server" AllowPaging="True" AllowSorting="True"
GridLines="None" ShowGroupPanel="True" Skin="Black" AutoGenerateColumns="False"
Width="100%" AllowAutomaticInserts="false" AllowAutomaticUpdates="false" PagerStyle-Mode="NumericPages"
OnItemInserted="GridItemInserted"
onitemdatabound="GridItemDataBound">
.............................................
........................................
..................................................
<ClientSettings>
<Selecting AllowRowSelect="true" />
<ClientEvents OnRowDblClick="RowDblClick" />
</ClientSettings>
</telerik:RadGrid>
<asp:Button ID="AddSrcButton" runat="server" Text="Add New" OnClientClick="return ShowInsertForm();" />
My actual question is to disable or enable RowDblClick property based on the user permission
This is my sample code in the aspx.cs file where i want to set the edit or view permission for radgrid
this.AddSrcButton.Enabled = this.Privilige.CanModify;//the value will be true or false
this.RadGrid.Enabled=this.Privilige.CanModify;
//the value will be true or false ,based on this value i want to enable/disable my rowdblclick,can any one help out to figure out where i am doinfg wrong
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过编程方式在服务器端设置行双击,
但要注意,要重新启用页面,您可能需要全部刷新才能再次加载客户端 JavaScript,除非您将其移至 .cs 文件中
You can set the row double click on the server side programatically
Beware though to renable the page you will probably need to refresh it all to get the clientside javascript to be loaded again, unless you move that into the .cs file