Telerik RadGrid using RadDropdownList

1 Answer 11 Views
Grid
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Rakhee asked on 01 Jul 2025, 02:51 PM

Hi

Im using Visual Studio 2022 and c#

I have a telerik RadGrid within my apsx page and I have set editMode="batch"

One of the columns SOStatus is a raddropdownList, with set items. When I select from the dropdown list and click on saveChanges within BatchEditCommand the SOStatus is blank, even though I have selected something. Not sure why?

Here is my ASPX

<telerik:GridTemplateColumn UniqueName="SOStatus" DataField="SOStatus" HeaderText="SO Status">
                                        <HeaderStyle Width="80px" />
                                        <ItemStyle Width="80px" />
                                        <ItemTemplate>
                                            <%# Eval("SOStatus") %>
                                        </ItemTemplate>
                                        <EditItemTemplate>
                                            <telerik:RadDropDownList ID="rdSOStatus" runat="server"  DataValueField="SOStatus" DataTextField="SOStatus" Width="110%">
                                                 <Items>
                                                        <telerik:DropDownListItem Text="" />
                                                        <telerik:DropDownListItem Text="Sale" />
                                                        <telerik:DropDownListItem Text="Pull Forward" />
                                                        <telerik:DropDownListItem Text="Risk" />
                                                        <telerik:DropDownListItem Text="Drop for this week" />
                                                        <telerik:DropDownListItem Text="Drop" />
                                                    </Items>

                                            </telerik:RadDropDownList>
                                        </EditItemTemplate>
                                    </telerik:GridTemplateColumn>

 

 

and here is the BatchEditCommand c# code

protected void rg_SalesPlan_BatchEditCommand(object sender, GridBatchEditingEventArgs e)
        {

            var batchEditingCommands = (List<GridBatchEditingCommand>)e.Commands;

       
            foreach (GridBatchEditingCommand batchCommand in batchEditingCommands)
            {
                Hashtable oldValues = batchCommand.OldValues;
     
                Hashtable newValues = batchCommand.NewValues;
         

             
                string SOStatus = newValues["SOStatus"].ToString();
               
                string OrigSOStatus = oldValues["SOStatus"].ToString();
               

}

              
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
commented on 02 Jul 2025, 08:42 AM

if I use <asp:DropdownList> instead of RadDropDownList then the value selected populates within batch edit command. Why would this be?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 02 Jul 2025, 01:45 PM

Hi Rakhee,

Thank you for providing the details and the code snippet.

The behavior you are seeing is related to how the RadGrid Batch Editing mechanism collects and binds values from editors inside the grid cells. In Batch Edit mode, RadGrid has built-in logic to extract values from standard ASP.NET controls like <asp:DropDownList>. When using Telerik controls such as <telerik:RadDropDownList>, you need to explicitly get a reference to the complex control and bind its value correctly.

Please review the following resources that explain in detail how to access your RadDropDownList inside Batch Edit mode and how to bind or retrieve its selected value properly:

These articles show examples of:

  • How to get a reference to the RadDropDownList editor in your server-side code
  • How to bind its selected value during postback
  • How to ensure that the values are persisted and extracted correctly during BatchEditCommand

Using the approaches described in the above documentation should resolve the problem and allow you to capture the selected value as expected.

Please have a look through these resources. If you still experience any issues, open a support ticket and send a simple runnable project with a grid and RadDropDownList bound to dummy datasource which demonstrating the issue.

Regards,
Rumen
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
Tags
Grid
Asked by
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
Rumen
Telerik team
Share this question
or