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

Batchediting Mode + RadDropDownList

1 Answer 16 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Reini
Top achievements
Rank 1
Reini asked on 02 Oct 2014, 03:36 PM
Hi,

i have two problems with a grid in batch editing mode and RadDropDownList inside the grid. I set the databinding in code behind for both. The databinding of the RadDropDownList  is in the prerender section of the grid:

protected void rgPmls_PreRender(object sender, EventArgs e)
{RadDropDownList rcbCarrier =    (RadDropDownList)rgPmls.FindControl(rgPmls.MasterTableView.ClientID + "_CarrierId").FindControl("rcbCarrier");

Carrier getCarrier = new Carrier();
rcbCarrier.DataSource = getCarrier.GetCarrier();
rcbCarrier.DataTextField = "Carrier";
rcbCarrier.DataValueField = "CarrierId";
rcbCarrier.DataBind();
}

Here is the grid:

<telerik:RadGrid ID="rgPmls" runat="server" AllowAutomaticDeletes="True"
           AllowAutomaticInserts="True" Skin="Windows7" OnItemInserted="rgPmls_ItemInserted"
           OnItemUpdated="rgPmls_ItemUpdated" AllowAutomaticUpdates="True" AllowPaging="True"
           AutoGenerateColumns="False" Width="1650px" OnBatchEditCommand="rgPmls_BatchEditCommand" Culture="de-DE"  OnItemCommand="rgPmls_ItemCommand" OnNeedDataSource="rgPmls_NeedDataSource" OnPreRender="rgPmls_PreRender">
           <MasterTableView CommandItemDisplay="Top" DataKeyNames="LoadingscheduleId"
               HorizontalAlign="NotSet" EditMode="Batch" AutoGenerateColumns="False">
               <BatchEditingSettings EditType="Cell" />
<Columns>
<telerik:GridTemplateColumn HeaderText="Reeder" HeaderStyle-Width="110px" UniqueName="CarrierId" DataField="CarrierId">
    <ItemTemplate>
        <%# Eval("Carrier") %>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadDropDownList runat="server" ID="rcbCarrier" DataValueField="CarrierId"
            DataTextField="Carrier" Width="100">
        </telerik:RadDropDownList>
    </EditItemTemplate>
    <HeaderStyle Width="110px" HorizontalAlign="Center" />
</telerik:GridTemplateColumn>
</Columns>
<ClientSettings AllowKeyboardNavigation="true">
<Scrolling AllowScroll="True" FrozenColumnsCount="3" UseStaticHeaders="True" />
</ClientSettings></telerik:RadGrid>

The databinding works fine and I can see all the items in the RadDropDownList. But I have the problems when I update the grid:

First problem: When I update the grid in batch editing mode all works fine at the first time and i get the selectedvalues of the RadDrobDownList. When I update
the grid a second time with a new seleted item, I get no value back.

Second problem: When the RadDropDownList has only one item, I also get no value back

What do I forget?

Thx for help.

Regards Thomas

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 07 Oct 2014, 12:15 PM
Hi Thomas,

I have already provided an answer regarding this matter in the official support ticket you have opened. After further research it seemed that the problem was caused by the way the values were accessed on the server.

If other community members experience such type of issues I would like to ask them to share the entire page markup and code-behind of the page thus enabling us to examine the implementation.

Regards,
Angel Petrov
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
Reini
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or