This is a migrated thread and some comments may be shown as answers.

ItemTemplate postback question

3 Answers 67 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 17 Dec 2010, 09:52 PM

I am having trouble accessing the value typed into the textbox on click of a submit button. the control is found however the text property is always empty. Please assist.

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click 
  
For Each item As RadListBoxItem In lbAssignedComponents.Items 
   Dim tbxPageComponentName As TextBox = item.FindControl("tbxPageComponentName") 
Next
  
End Sub

<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1"
    <telerik:RadListBox runat="server" ID="lbAvailableComponents" Height="200px" Width="342px" TransferMode="Copy" AllowTransfer="true" AllowTransferDuplicates="true" TransferToID="lbAssignedComponents" AutoPostBackOnTransfer="true"
        <ItemTemplate
            Component: <%# DataBinder.Eval(Container, "Text")%><br /> 
        </ItemTemplate
    </telerik:RadListBox
    <telerik:RadListBox runat="server" ID="lbAssignedComponents" Height="200px" Width="342px" AllowReorder="true" AllowDelete="true" AllowTransfer="false"
        <ItemTemplate
            Component: <%# DataBinder.Eval(Container, "Text")%><br /> 
            Unique Name: <asp:TextBox ID="tbxPageComponentName" runat="server"></asp:TextBox
        </ItemTemplate
    </telerik:RadListBox
</telerik:RadAjaxPanel>

3 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 21 Dec 2010, 05:41 PM
Any thoughts?
0
Chris
Top achievements
Rank 1
answered on 07 Jan 2011, 10:01 PM
I am still waiting on assistance. Is my question not clear enough?
0
Ryan
Top achievements
Rank 1
answered on 11 Jan 2011, 11:23 PM
I have the same issue as you. I read on another post that to persist the textbox state, you have to add the listboxitem on the server side during runtime. I modified my code, and was able to accomplish this.

For your reference:
http://www.telerik.com/community/forums/aspnet-ajax/listbox/problem-with-allowreorder-when-using-itemtemplate.aspx
Tags
ListBox
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Ryan
Top achievements
Rank 1
Share this question
or