Hello,
I am trying to access some controls in the EditItemTemplate of a RadGrid EditForm. Two of the columns are GridTemplateColumns and have RadTextBoxes in the EditItemTemplates, one column is a GridDropDownColumn.
I have a LinkButton that launches a popup window for edit and add records. I want to pass the contents of the controls to the form and use the results that come back to change the value in one of the RadTextBoxes.
I can pop the window up just fine, but I am unable to retrieve the values from the edit controls to put in the querystring of the popup window url.
I have followed every example that I can find online and I am unable to retrieve the values from the RadTextBoxes or the RadComboBox on the client. I have tried finding the controls by their ID, as well as the column's UniqueName. All to no avail.
Can any one help me please?
The grid markup is:
(The columns that I want to capture are: UniqueName="Program", UniqueName="LicenseNum", UniqueName="ApplicantName")
<telerik:RadGrid ID="gvwFunds" ShowStatusBar="True" runat="server" AutoGenerateColumns="False"
PageSize="7" AllowPaging="True" Skin="Bootstrap" Visible="False" GroupPanelPosition="Top">
<PagerStyle Mode="NumericPages"></PagerStyle>
<MasterTableView Name="gtvPrograms" DataKeyNames="Programs_UID" EditMode="InPlace" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" ClientDataKeyNames="Program, License_Num, ApplicantName">
<CommandItemTemplate>
<asp:LinkButton ID="lbAddProgram" CommandName="InitInsert" runat="server"> <img style="border:0px;vertical-align:middle;" alt="" src="../../Custom/Images/AddRecord.png"/> Add New Program</asp:LinkButton>
</CommandItemTemplate>
<DetailTables>
<telerik:GridTableView Name="gtvFunds" DataKeyNames="Funds_UID" Width="100%" runat="server" EditMode="InPlace" CommandItemDisplay="Top">
<CommandItemTemplate>
<asp:LinkButton ID="lbAddFund" CommandName="InitInsert" runat="server"> <img style="border:0px;vertical-align:middle;" alt="" src="../../Custom/Images/AddRecord.png"/> Add New Fund</asp:LinkButton>
</CommandItemTemplate>
<Columns>
<telerik:GridDropDownColumn UniqueName="ddlFiscalCode" ListTextField="FiscalCode" ListValueField="FiscalCode"
ListDataMember="FiscalCodes" DataField="FiscalCode" HeaderText="Fiscal Code" DropDownControlType="RadComboBox" />
<telerik:GridTemplateColumn UniqueName="Fund" HeaderText="Fund">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txtFund" Skin="Bootstrap" runat="server" Enabled="False" ReadOnly="True">
</telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="ObjectCode" HeaderText="Object Code">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txtObjectCode" Skin="Bootstrap" runat="server" Enabled="False" ReadOnly="True">
</telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridBoundColumn HeaderText="Amount" DataField="Amount" UniqueName="Amount" DataFormatString="{0:#,##0.00}" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">
<FooterStyle HorizontalAlign="Right" />
<HeaderStyle HorizontalAlign="Right" />
<ItemStyle HorizontalAlign="Right" />
</telerik:GridBoundColumn>
<telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit">
</telerik:GridEditCommandColumn>
</Columns>
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</telerik:GridTableView>
</DetailTables>
<Columns>
<telerik:GridDropDownColumn UniqueName="Program" ListTextField="DESCR" ListValueField="CODE"
ListDataMember="ProgramList" DataField="ProgramCode" HeaderText="Program" DropDownControlType="RadComboBox">
</telerik:GridDropDownColumn>
<telerik:GridTemplateColumn UniqueName="LicenseNum" HeaderText="License #">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txtLicenseNum" Skin="Bootstrap" runat="server">
</telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="ApplicantName" HeaderText="Applicant Name">
<ItemTemplate>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadTextBox ID="txtApplicantName" Skin="Bootstrap" runat="server">
</telerik:RadTextBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit">
</telerik:GridEditCommandColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
Thanks,
Bob