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

RadGrid WebuserControl Find RadNumericTextBox

1 Answer 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 11 Oct 2019, 04:00 PM

I have a Radgrid that when the EditCommandColumn button is clicked I load a WebUserControl.

                                                                       <EditFormSettings  UserControlName="BudgetItemControl.ascx" EditFormType="WebUserControl">
                                                                            <EditColumn UniqueName="EditCommandColumn1">
                                                                            </EditColumn>
                                                                            <PopUpSettings Modal="false" />
                                                                        </EditFormSettings>

 

On the WebUserControlI have the following bound field...

                            <telerik:RadNumericTextBox ID="txtQty" runat="server"  Text='<%# DataBinder.Eval(Container, "DataItem.Qty") %>' DisabledStyle-                 

                                BackColor="Transparent" 
                                EmptyMessage="Enter qty" Enabled="true" Font-Names="Arial" Font-Size="Small" ForeColor="#666699" MinValue="0"

                                RenderMode="Lightweight" 
                                Skin="Silk" TabIndex="7" Type="Number" Value="0" Width="190px" Visible="true"
                                onkeyup="javascript: onChange();" onkeypress="return isFloatNumber(this,event);" >

On the form with the grid I have the javascript OnChange() event

when I try to get_value

var txt=$find("<%= RadGrid1.ClientID%>").get_masterTableView().get_dataItems()[1].findControl("txtqty")

I receive the following error: Cannot read property 'findControl' of undefined.

I can get the value when using an asp control.

var txt1 = document.getElementById("TextBox2").value; (THIS WORKS)

How can I get the RadNumericTextBox value?

 

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 16 Oct 2019, 08:03 AM

Hi John,

 

To achieve this requirement, you can use the get_editItems() method instead of get_dataItems(). Then, you can use the $telerik.findControl() method by passing the get_editItems()[0].get_editFormItem() contaoner as the first argument:
https://www.telerik.com/support/kb/aspnet-ajax/details/access-telerik-controls-on-client-side

You can find a similar implementation using these methods here:
https://www.telerik.com/support/kb/aspnet-ajax/grid/details/set-focus-to-a-control-in-popup-edit-form-of-radgrid

I hope this will prove helpful. Feel free to give it a try and let me know about the result.

 

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
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or