Posted 12/24/2007 3:56:25 AM | | | | i want to forbidden "Print" and "Export Excel" buttons for some roles. how can we do? "Happy new years" |
| Posted 1/16/2008 11:29:56 AM | | | I'm guessing you are talking about the "Print" and "Export to Excel" buttons on our Grid control??? You can remove these buttons by setting the "AAlowPrint" and "AllowExportToeXcel" properties to false.
Jeremie Desautels VP, Product Marketing c360 Solutions |
| Posted 1/16/2008 12:17:41 PM | | | I have almost the same question:
how to remove the "save and close" and "Save and New" buttons on an edit page?
I think it should be Instance.ButtonMenu.Items.Remove("name_of_button")
but I can't find the button names anywhere.. |
| Posted 1/16/2008 12:32:13 PM | | | The name of the button is not the indexer for the "ButtonMenu.Items" collection. Therefore, to remove a button from this collection you must get a reference to the button in question and remove it from the collection. Something like this:Instance.ButtonMenu.Items.Remove(Instance.ButtonMenu.Items[4]); Also, keep in mind that there is a property called "IncludeStandardButtons" which you can set to "false" to remove all the buttons at once.
Jeremie Desautels VP, Product Marketing c360 Solutions |
| Posted 1/16/2008 12:56:05 PM | | | thanks for the quick reply 
I tried your code, but it returns an outofrangeexception (I tried values from 0 to 4)
I also tried the removeAt (int index) method which should give the same result, but is easier to use (am I right?), but it also returns an outofrangerexception.
|
| Posted 1/16/2008 1:05:02 PM | | | "4" was just an example. You need to figure out the index of the button you actually want to remove (I don't know by heart the index of the "Save" and the "Save and Close" button").
Jeremie Desautels VP, Product Marketing c360 Solutions |
| Posted 1/16/2008 2:18:05 PM | | | I know it was an example 
But it was my mistake, I was trying to remove the buttons from the buttonbar, before it was built, so that's why I got the outofrangeexception.
maybe useful information for other users:
"Save" is index[0]
"Save and Close" is index[1]
"Save and New" is index[2]
Thanks for helping me with this Jeremy! |
| |
|