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

Client - Get value of field on same row as another item?

1 Answer 34 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Keith
Top achievements
Rank 1
Keith asked on 09 Oct 2019, 12:10 PM

I have a RadListView similar to

<telerik:RadListView ID="RadListView1" runat="server" >
    <ItemTemplate>
        <asp:HiddenField ID="HiddenField1" runat="server" Value='<%#Eval("HiddenValue") %>' />
        <telerik:RadNumericTextBox ID="RadTextBox1" runat="server" ClientEvents-OnValueChanged="onValueChanged" DbValue='<%#Eval("Hours") %>' />
    </ItemTemplate>
</telerik:RadListView>

 

This data is bound server-side from another control.  There may be hundreds of lines with unique values.  When the text is changed in the RadNumericTextBox I wish to manipulate the data using the value in HiddenField1 in the onValueChanged function.

 

For example, when typing "5" into the RadTextBox1, onValueChanged will fire, and I would like to discover the value of HiddenField1 in this function.  I cannot seem to pin down how to access data in the specific row that I am accessing.

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 14 Oct 2019, 05:05 AM

Hello Keith,

 

You can check the provided RadDataForm sample here to achieve this requirement:
https://www.telerik.com/support/kb/aspnet-ajax/media-player/details/accessing-controls-in-listview

This requirement can be achieved both on client and server-side. In this case you will need the client-side approach, which will include the $telerik.findElement() method since the HiddenField is an asp:Control.  If you prefer, I can prepare a new sample targeting your scenario specifically.

 

Regards,
Eyup
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
ListView
Asked by
Keith
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or