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

Manipulate InPlace Insert Item Text Value Based Upon SelectedIndexChanged Event of InPlace RadComboBox

1 Answer 14 Views
Grid
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 08 Sep 2014, 02:01 PM
I have a RadGrid which uses InPlace editing, and this grid contains a RadComboBox and a RadTextBox. When the user changes the text choice of the RadTextBox, the value behind the choice is used to retrieve data using AutoPostBack, and the returned data needs to update the text value of the RadTextBox.

Here's what the .aspx code looks like:

<telerik:RadGrid ID="rgvMsgElementToMsgTemplate" runat="server" GridLines="None" AutoGenerateColumns="false" MasterTableView-NoMasterRecordsText="No Records To Display">
    <MasterTableView CommandItemDisplay="Top" NoDetailRecordsText="No Records To Display" EditMode="InPlace">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                <HeaderStyle Width="50px" />
            </telerik:GridEditCommandColumn>
            <telerik:GridTemplateColumn DataField="TMPLT_NM" HeaderText="Template" UniqueName="TMPLT_NM">
                 <HeaderStyle Width="200px" />
                 <ItemTemplate>
                     <asp:LinkButton ID="lblMessageTemplate" CommandName="EDIT" runat="server" Text='<%#Container.DataItem("TMPLT_NM")%>' />                                                                                   
                 </ItemTemplate>
                 <InsertItemTemplate>
                    <telerik:RadComboBox runat="server" ID="rcbTemplate" DataTextField="TMPLT_NM" DataValueField="AMCAT_ID" Width="190px" DropDownAutoWidth="Enabled"
                        OnSelectedIndexChanged="rcbTemplate_SelectedIndexChanged" AutoPostBack="true"></telerik:RadComboBox>
                    <asp:RequiredFieldValidator ID="rcbTemplateValidator" CssClass="redreq" ControlToValidate="rcbTemplate" InitialValue="-- Select an Item --" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                 </InsertItemTemplate>
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Version Id" UniqueName="TMPLT_VRS_ID" DataField="TMPLT_VRS_ID">
                <HeaderStyle Width="50px" />
                <ItemTemplate>
                    <%# Eval("TMPLT_VRS_ID")%>
                </ItemTemplate>
                <InsertItemTemplate>
                    <telerik:RadTextBox runat="server" ID="rtbVersion" DataField="TMPLT_VRS_ID" readonly="true" Width="50px"></telerik:RadTextBox>
                </InsertItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

My issue is that inside the SelectedIndexChanged event, I don't know how to access the InsertItem(s) defined in the .aspx from within this event. I have tried to use the NamingContainer, EditItems collection, the GetInsertItems() function, using a Try/DirectCast to FindControl to no avail.


Public Sub rcbTemplate_SelectedIndexChanged(sender As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)
 
' Somewhere in here I need to get to the each item inside the InPlace edit section of the grid...
 
End Sub

Is this even possible?

Thanks.

Jim











1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 11 Sep 2014, 11:05 AM
Hi James,

You can achieve the requested functionality using a client-side approach for better performance. I'm sending a sample RadGrid web site to demonstrate that. Please run the attached application and let me know if it helps you.

Regards,
Eyup
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
James
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or