This question is locked. New answers and comments are not allowed.
is it possible to hide the Edit/Delete/Add commands for the Grid depending on the role of a user??
Also:
Is anyone able to point me in the direction of an example for having a combobox appear in a grid edit field for lookup of valid entries?
Also:
Is anyone able to point me in the direction of an example for having a combobox appear in a grid edit field for lookup of valid entries?
5 Answers, 1 is accepted
0
Hello Michael,
I replied to the combobox question in your other forum thread.
Regards,
Atanas Korchev
the Telerik team
You can hide/show the buttons using a simple condition in the grid declaration:
columns.Command(commands =>{ if ((bool)ViewData["CanEdit"] == true) // In your controller set a flag indicating whether the user can edit { commands.Edit(); }});I replied to the combobox question in your other forum thread.
Regards,
Atanas Korchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Michael
Top achievements
Rank 1
answered on 10 Mar 2011, 08:24 AM
Thankyou,
All working well and most importantly "as expected"
however I now can't see why the same principle yields me errors when trying to add a conditional tabstrip??
i get an error on the @if((bool)... line informing me that im missing a semi-colon??
help...please
All working well and most importantly "as expected"
however I now can't see why the same principle yields me errors when trying to add a conditional tabstrip??
@if((bool) ViewBag.CanEdit){ tabstrip.Add() .Text("Handicapper Results Entry") .Content( ); }i get an error on the @if((bool)... line informing me that im missing a semi-colon??
help...please
0
Hello Michael,
Atanas Korchev
the Telerik team
This should work:
@(Html.Telerik().TabStrip()
.Name("tabstrip")
.Items(items =>
{
if (ViewBag.CanEdit)
{
items.Add().Text("Tab");
}
})
)
I am also attaching a sample application.
Atanas Korchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Michael
Top achievements
Rank 1
answered on 11 Mar 2011, 04:27 AM
Thank you for the sample
Could it be that my code wasnt working because I had split the lines??
because essentially i have the same code as you except that i had .Text on the next line??
Could it be that my code wasnt working because I had split the lines??
because essentially i have the same code as you except that i had .Text on the next line??
0
Hi Michael,
Atanas Korchev
the Telerik team
It shouldn't be the split lines. I tried this in my project and it worked as expected. Could you please modify the attached project so it no longer works? I am really not sure what is wrong at your side.
Regards,Atanas Korchev
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!