I think I'm getting close but am now hitting the dreaded "object reference not set to an instance of an object" from the findcontrol.
So at first I'm using the ItemDataBound event to set add the textbox control to the panelbar and that's working well:
protected void RadScoringPanel_ItemDataBound(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)
if (e.Item.Level == 2)
TextBox tb = new TextBox();
tb.Text = "0";
tb.Style["text-align"] = "center";
tb.Style["border-bottom"]="solid 1px #cccccc";
tb.Width = Unit.Pixel(70);
but then later when I try to find the control to get the value I'm getting the object reference error:
foreach (RadPanelItem panelitem in RadScoringPanel.GetAllItems())
if (panelitem.Level == 2)
string sItemValue = (panelitem.Value).ToString();
TextBox txtScore = (TextBox)panelitem.FindControl(sItemValue);
Any thoughts on why the result of this is null which causes the object reference error? If I retrieve the variable for the panelitem.Value it is correct. The source code shows the "id" for each of the controls as id="ctl00_ctl00_RemotePrimary_RemoteMain_RadScoringPanel_i0_i0_i2_5" with the "5" at the end being the actual value from the panelitem. Is the additional code before the "5" causing the issue?