Hi,
I'm trying to add RibbonBarGalleryItems to a RibbonBarGalleryCategory at runtime like this (I'm pulling them out of a datatable);
RibbonBarGalleryCategory someCategory = (RibbonBarGalleryCategory)FindControlRecursive(
this
,
"radGalleryCategory1"
);
foreach
(DataRow R
in
someDatatable.Rows)
{
RibbonBarGalleryItem myitem =
new
RibbonBarGalleryItem();
myitem.ID =
"someIDgeneratedbyMyApp"
myitem.Text = R[
"Col1"
].ToString();
myitem.ToolTip = R[
"Co2"
].ToString();
myitem.ImageUrl =
"~/GlobalResources/somepic.png"
;
someCateogry.Items.Add(myitem);
}
This works fine - the items appear in the gallery OK on page_load and display in the browser.
However, when I click any of the gallery items to select them, I get an index out of range exception that's not handled.
Gallery items added at design time work fine. It's the ones that I'm adding at runtime that fail on selection.
Is there some method I should hook into when the RadRibbonGallery is initialised so that I pass in my gallery items then, so the ribbonbar is "aware" of them?
Thanks in advance,
Jonathan