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

Batch Editing from Template Column DropdownList

3 Answers 324 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hakan
Top achievements
Rank 1
Hakan asked on 15 Jul 2013, 02:16 PM
Hello,

I am developing a batch editing grid using the instructions from this link. 
http://www.telerik.com/help/aspnet/grid/grdprogrammaticcreation.html

All looks good so far. But I want to make a dropdown column. I put a label at itemtemplate, and a dropdownlist as edititemtemplate.

 But I couldn't manage to get the SelectedValue. The namingcontainer GridDataItem object either returns null, or Telerik.Web.UI.GridBatchEditingHelper.PanelNamingContainer object. Which is not recognizable by Asp.Net.

Anyway what I need is a simple small project that binds a dropdowncolumn or a templatecolumn with dropdown, for batch editing. If we are able to use DropdownColumn instead of TemplateColumn would we so great. Thanks in advance.

3 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 18 Jul 2013, 01:14 PM
Hello Hakan,

When creating the grid programmatically and using template columns you should follow the approach demonstrated in this help article. Additionally I have created a sample website which illustrates how you can use a GridDropDownColumn when the grid is created programmatically and the EditMode is set to Batch. You can find the sample in attachments.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Hakan
Top achievements
Rank 1
answered on 18 Jul 2013, 02:20 PM
Hey Angel,

Sorry if I couldn't underlined the problem: What I have a problem with is the part that I take the selecedvalues.

Anyway, I managed to do it with GridTemplateColumn though.. When I put a RadDropDownList, grid took the value automatically.
0
Angel Petrov
Telerik team
answered on 23 Jul 2013, 11:19 AM
Hello Hakan,

I suppose that the selected value from the drop drown was set by using a data-binding expressions(<%#Eval()%>) and this was causing the problem. In the current implementation of the batch edit mode data-binding expression are not allowed in the EditItemTemplate. The mode is designed in such way that it will automatically fill the value in the input element. If however you have more than one control in the template things should be handled manually like explained in this help article.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Hakan
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Hakan
Top achievements
Rank 1
Share this question
or