By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,681 Members | 1,864 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,681 IT Pros & Developers. It's quick & easy.

datagrid buttoncolumn - visible property

P: 63
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.

Nov 25 '08 #1
Share this Question
Share on Google+
1 Reply

P: 55
Hope this works for you:

if (Session["Status"].ToString() == "user")
DataGrid.Columns[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.
Nov 27 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.