Hi,
I have a RadToolbar and a RadGrid on one page. Depending on how many row are selected in the grid some buttons in the toolbar should be active or inactive.
To achieve this I run a javascript function every time a row gets selected or deselected in the grid and I go through a switch-case to set the buttons in the right state.
So far so good, this is just some background to my problem.
My problem is that, as far as I can see, the only way to get the buttons I want to change is through the toolBar.get_items().getItem() method which takes an integer for the index of the desired item. The problem with that is that I now have to identify button by order in which they are placed, resulting in maintenance hell should the order of the buttons change.
Rather, I would like to ask the RadToolBarItemCollection collection to get me an item by specifying it's Value or CommandName.
Obviously it's not very hard to write a small function that gives me this behaviour myself, but I was wondering if it doesn't already exist and maybe I've overlooked it.
Or that there is a similar but easier approach to getting a specific button from a toolbar through it's Value or CommandName or something similar.
Regards,
Mink
I have a RadToolbar and a RadGrid on one page. Depending on how many row are selected in the grid some buttons in the toolbar should be active or inactive.
To achieve this I run a javascript function every time a row gets selected or deselected in the grid and I go through a switch-case to set the buttons in the right state.
So far so good, this is just some background to my problem.
My problem is that, as far as I can see, the only way to get the buttons I want to change is through the toolBar.get_items().getItem() method which takes an integer for the index of the desired item. The problem with that is that I now have to identify button by order in which they are placed, resulting in maintenance hell should the order of the buttons change.
Rather, I would like to ask the RadToolBarItemCollection collection to get me an item by specifying it's Value or CommandName.
Obviously it's not very hard to write a small function that gives me this behaviour myself, but I was wondering if it doesn't already exist and maybe I've overlooked it.
Or that there is a similar but easier approach to getting a specific button from a toolbar through it's Value or CommandName or something similar.
Regards,
Mink