datagrid buttoncolumn - visible property

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tuananh87vn
    New Member
    • Sep 2007
    • 63

    datagrid buttoncolumn - visible property

    hi,
    can anybody show me how to use the visible property of the datagrid's buttoncolumn. for example, if the login user is at 'user' level the column 'delete' will be invisible. otherwise, if 'admin' is logged in, the column comes visible?
    in this case, I use session to check who's logged in.

    thanks!
  • dmj07
    New Member
    • Aug 2008
    • 55

    #2
    Hope this works for you:

    if (Session["Status"].ToString() == "user")
    {
    DataGrid.Column s[IndexofColumn].Visible = false;
    }

    Obviously replace the session name you use for yours with the one I used "Status" and replace the IndexofColumn with the index of your button column e.g. could be 3 if its at the end of a 4 columned table.

    Comment

    Working...