Hi
That's my first post on this forum :)
I've got a problem with RadTreeList that I can't access edit form's textbox in OnItemDataBound event.
.aspx looks like this:
And code behind
And i get tb equal to null, so that's not what I'm expecting.
How I can access this control ?
I would be very very grateful for the answer,
Greets Maciek :)
That's my first post on this forum :)
I've got a problem with RadTreeList that I can't access edit form's textbox in OnItemDataBound event.
.aspx looks like this:
<EditFormSettings EditColumn-ButtonType="ImageButton" EditColumn-CancelImageUrl="~/Images/Actions/Cancel_16x16.png" EditColumn-InsertImageUrl="~/Images/Actions/Accept_16x16.png" EditColumn-UpdateImageUrl="~/Images/Actions/Accept_16x16.png" EditFormType="Template"> <EditColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1" InsertImageUrl="~/Images/Actions/Accept_16x16.png" UpdateImageUrl="~/Images/Actions/Accept_16x16.png" CancelImageUrl="~/Images/Actions/Cancel_16x16.png"></EditColumn><FormTemplate> <table> <tr><td></td><td>Dla jednostki</td><td>Jednostek podrzędnych</td></tr> <tr> <td>Limit wydatków łacznie</td> <td><telerik:RadNumericTextBox runat="server" id="tbExpenditureLimit" DbValue='<%# Bind("ExpenditureLimit") %>'/></td> <td><asp:Label runat="server" ID="lblSUM_ExpenditureLimit" Text='<%# Eval("SUM_ExpenditureLimit") %>' /></td> </tr>And code behind
protected void rtlOrgUnits_OnItemDataBound(object sender, TreeListItemDataBoundEventArgs e){ if (e.Item is TreeListDataItem) { TreeListDataItem itm = e.Item as TreeListDataItem; bool isExpenditureLimitBlocked = initalization by some params; if (isExpenditureLimitBlocked) { if (itm is TreeListEditableItem && (itm as TreeListEditableItem).IsInEditMode) { TreeListEditableItem editItem = (TreeListEditableItem)itm; var tb = editItem.FindControl("tbExpenditureLimit") as RadTextBox; if (tb != null) { tb.ReadOnly = true; tb.BackColor = Color.FromArgb(1, 215, 215, 215); } }}And i get tb equal to null, so that's not what I'm expecting.
How I can access this control ?
I would be very very grateful for the answer,
Greets Maciek :)