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

GridTemplateColumn / RadComboBox cannot retrieve value

1 Answer 15 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 13 Oct 2014, 05:45 PM
I have a grid that using a combobox.  When I try to retrieve the values of the selected row, the GridBoundColumn work perfect, but the combobox comes up empty.  Here's my code:  

Thank you, Steve

Server Code:
public void AddReplenish(RadGrid gridReplenish)
{
    var replenish = iso.Get<Crane.OMS.ORM.OMS.Replenish>();

    foreach (GridDataItem dataItem in gridReplenish.Items)
    {
        if (dataItem.Selected)
        {
            GridDataItem steve = gridReplenish.Parent.Parent as GridDataItem;
            var rp = new Crane.OMS.ORM.OMS.Replenish();
            rp.Area = dataItem["area"].Text;
           rp.Area = dataItem["type"].Text;   **** this comes up empty

            replenish.Add(rp);
        }
    }
}


Client Code:
<div class="galGridViewWrapper">
                    <telerik:RadGrid ID="gridReplenish"
                        runat="server"
                        AutoGenerateColumns="false"
                        PageSize="7"
                        AllowPaging="true"
                        AllowMultiRowEdit="False"
                        EnableViewState="true"
                        GridLines="None"
                        OnPreRender="gridReplenish_PreRender"
                        OnNeedDataSource="gridReplenish_NeedDataSource">

                        <PagerStyle Visible="False" />
                        <MasterTableView EditMode="Batch" BatchEditingSettings-EditType="Row">
                            <Columns>
                                <telerik:GridBoundColumn DataField="ReplenishId" HeaderText="ReplenishId" Visible="false" >
                                </telerik:GridBoundColumn>

                                <telerik:GridBoundColumn DataField="Area" HeaderText="Area" ReadOnly="true">
                                </telerik:GridBoundColumn>

                                <%--                     <telerik:GridDropDownColumn UniqueName="Type" runat="server" ListTextField="Text" 
                                    ListValueField="Value" HeaderText="Type" DropDownControlType="RadComboBox" DataSourceID="XmlDataSource1">
                                </telerik:GridDropDownColumn>--%>


                                <telerik:GridTemplateColumn  UniqueName="Type" HeaderText="Type">
                                    <ItemTemplate>
                                        <telerik:RadComboBox runat="server" ID="Type"  AutoPostBack="true" DataTextField="Text" DataValueField="Value" DataSourceID="XmlDataSource1"></telerik:RadComboBox>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridBoundColumn DataField="CreateDateTime" HeaderText="CreateDateTime" Visible="false">
                                </telerik:GridBoundColumn>

                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="false">
                            <Selecting AllowRowSelect="True"></Selecting>
                            <ClientEvents />
                        </ClientSettings>
                    </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 16 Oct 2014, 10:45 AM
Hello Steve,

I've already replied to your ticket with ID: 868969. I suggest that we continue our conversation on the mentioned thread.

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