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

InsertItemTemplate Objects

3 Answers 149 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 07 Feb 2017, 03:07 PM

Hi All,

here is what I am trying to achieve;

While my Telerik data form is in InsertNewItem mode, I need to use user's data entries in any of the RadTextBox as they enter it, before they click on the "Insert" button. I need to be able to extract that data entry once they move focus away from that TextBox so that I can use it to run data query and fill other textboxes in the same InsertItem form template. Later the user will have the ability to click on Insert to add that new record to the SqlDataSource already linked to the Telerik DataForm.

your help is highly appreciated!

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 10 Feb 2017, 09:09 AM
Hi Muhammad,

You can achieve this requirement on both server and client-side:

Server:
1. Enable the AutoPostBack property of the textbox.
2. Use its OnTextChanged event handler.
3. Get a reference to the textbox using TextBox textBox=sender as TextBox;
4. Get a reference to the dataform item using textBox.NamingContainer.
5. Access other controls within the item using item.FindControl("AnotherControlID").
6. Apply the changes.

Client-side:
You can examine the RadGridEditComboClientHideModified.zip web site sample provided in the following post for a similar scenario:
http://www.telerik.com/forums/how-to-change-and-get-value-from-a-dropdownlist-in-a-radgrid-column#jIjRiaOYhkucLZ82pztwow


I hope this will prove helpful.

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Muhammad
Top achievements
Rank 1
answered on 10 Feb 2017, 01:48 PM

Thanks much Eyup, the server side solution works!

I'm however not able to fit the client side example to my needs, would you be able to provide an example for client side?

many thanks in advance.

0
Eyup
Telerik team
answered on 15 Feb 2017, 11:43 AM
Hello Muhammed,

I'm glad the provided solution has proven helpful.
As for client-side accessing, you can check the sample provided here:
http://www.telerik.com/support/code-library/accessing-controls-in-dataform

Regards,
Eyup
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DataForm
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Muhammad
Top achievements
Rank 1
Share this question
or