radgrid针对不同的用户 [英] radgrid for the different users

查看:73
本文介绍了radgrid针对不同的用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用一个带有编辑删除按钮的radgrid,但是我想为用户(用户和管理员)使用相同的网格,对于管理员我想启用编辑和删除功能,对于没有编辑的用户,只要他们登录就可以使用删除按钮

i am using one radgrid with edit delete buttons ,but i want the same grid for both the users,user and admin,for admin i want to enable edit and delete, for the user without edit, delete button whenever they are login with their username, the same grid for both ,user and admin.how can i differentiate please help me .thank you.

推荐答案

您好,
如果用户是admin,则可以检查登录名并将按钮列设置为可见.
您去了:
Hi,
You can check login and set the buttons column visible if user is admin.
Here you go:
protected void Page_Load(object sender, EventArgs e)
{
    if(!IsPostBack)
    {
        if(Session["UserType"] != "Admin")
        {
            gvTitle.Columns[colIndex].Visible = false;
            // colIndex is the index of your edit and delete button column.
        }
    }
}




--Amit




--Amit


这篇关于radgrid针对不同的用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆