Hi,
I would like to dynamically assign the id property of a RadToolBarButton dynamically in my code behind sicnce is is supposedly a readonly property. Is there any workaround to get this done? I really need to assign a fixed id to one of the buttons since it is being reference in my JQuery code using its id.
private void PopulateRadToolBar()
{
RadToolBarItemCollection rtb = RadToolBar.Items;
if (!String.IsNullOrEmpty(WebPart.RadToolBarValues))
{
var properties = WebPart.RadToolBarValues.Split(@";".ToCharArray());
rtb.Clear();
foreach (var singleProperty in properties)
{
var itemRow = singleProperty.Split(@",".ToCharArray());
button = new RadToolBarButton();
button.ID = itemRow[0]; // ERROR HERE SINCE ID IS A READ ONLY PROPERTY
button.Text = itemRow[1];
button.NavigateUrl = itemRow[2];
button.Target = itemRow[3];
button.ImageUrl = itemRow[4];
rtb.Add(button);
}
else
{
rtb.Clear();
}
}
}