Hi Every One
can we show or hide some column in grid view depending upon user role
mean if admin all column he can see if guest some he can see can we do this in grid view if yes how if no what will be the alternate way
thanks in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Oct 25, 2009, 5:54 AM
get the user role first
then
//Code for binding GriDView to database
if(role == "guest")
{
GridVIew1.Columns[3].Visible = false ;
GridVIew1.Columns[4].Visible = false ;
}
else if(role == "normal")
{
GridVIew1.Columns[5].Visible = false ;
GridVIew1.Columns[6].Visible = false ;
}
else
{
//show all
}