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

Hidden Fields inside InsertItemTemplate

1 Answer 322 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
GD
Top achievements
Rank 1
GD asked on 27 Mar 2019, 02:10 PM

     Hi,I have a problem with RadDataForm and HiddenField. I have a scenario like this:

 

 <telerik:RadDataForm runat="server" ID="radDataForm" DataSourceID="myDataSource">

   <InsertItemTemplate>

        <asp:HiddenField ID="hiddenField" runat="server" Value='<%# Bind("MyProperty") %>' />

         <telerik:RadComboBox ID="myCombo" runat="server" SelectedValue='<%# Bind("MyProperty2") %>' />

   </InsertItemTemplate>

</telerik:RadDataForm>

I Just semplify my code. The problem is that radComboBox (as other telerik controls) works fine and i bind my object passed in data source, while the property bounded throught asp:HiddenField doesn't work, even the value is not null.

Any suggestions?

 

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 01 Apr 2019, 11:26 AM
Hi Claudio,

Can  you elaborate a bit on the moment in which you are trying to access the Hidden field value? You can find an useful sample on how to access the controls inside the data item templates here:
https://docs.telerik.com/devtools/aspnet-ajax/controls/dataform/server-side-programming/access-controls-inside-templates#how-to-access-controls-inside-templates

You can also try binding the hidden field through the container dataitem like follows:
<asp:HiddenField ID="hiddenField" runat="server" Value='<%# DataBinder.Eval(Container.DataItem, "MyProperty") %>' />

Regards,
Vessy
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
DataForm
Asked by
GD
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Share this question
or