InsertItemTemplate Objects

4 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    5 posts
    Member since:
    Jan 2016

    Posted 07 Feb Link to this post

    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!

  2. Eyup
    Admin
    Eyup avatar
    3331 posts

    Posted 10 Feb Link to this post

    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.
  3. Muhammad
    Muhammad avatar
    5 posts
    Member since:
    Jan 2016

    Posted 10 Feb in reply to Eyup Link to this post

    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.

  4. Eyup
    Admin
    Eyup avatar
    3331 posts

    Posted 15 Feb Link to this post

    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.
Back to Top