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

[Solved] Dropdownlist in Batch Editing Grid

6 Answers 260 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shibu
Top achievements
Rank 1
Shibu asked on 21 Apr 2011, 10:07 AM
Hi There,
I am facing a problem regarding Binding a dropdownlist in a grid. it displays the items properly in the dropdownlist, but the problem is when i change the focus, it displays the value instead of Item.Please help me. And also i got an error in JQuery On_Edit

 function Grid_onEdit(e) {

            $(e.form).find('#MasterUsername').data('tComboBox').select(function (dataItem) {


                return dataItem.Text == e.dataItem['MasterUsername'];
                });
}

This is the error I got:

$(e.form).find("#MasterUsername").data("tComboBox") is undefined


This is my model

[UIHint("ClientUserName"), Required]
        public string MasterUsername { get; set; }

This is my editor templates

@(Html.Telerik().DropDownList()
            .Name("MasterUsername")
        .BindTo(new SelectList((IEnumerable)ViewData["Username"], "CMID", "Username"))
)


This is the Telerik Grid 
   .Columns(columns =>
        {
            
            columns.Bound(c => c.ClubID).Width(100).Visible(false);


            columns.Bound(c => c.API_ID).Width(100);
            columns.Bound(c => c.UserName).Width(200);
           
            columns.Bound(c => c.Password).Width(200);
            
            columns.Bound(c => c.IsDefaultSenderIDEnabled).Width(200)
            .ClientTemplate("<input type='checkbox' disabled='disabled' name='IsDefaultSenderIDEnabled' <#= IsDefaultSenderIDEnabled? checked='checked' : '' #> />");
            columns.Bound(c => c.IsSenderIDEnabled).Width(200)
           .ClientTemplate("<input type='checkbox' disabled='disabled' name='IsSenderIDEnabled' <#= IsSenderIDEnabled? checked='checked' : '' #> />");
            columns.Bound(c => c.DefaultSenderID).Width(200);
            columns.Bound(c => c.MasterUsername).Width(200);
            columns.Bound(c => c.MasterAccountID).Width(200).Visible(false);
         
        })


Please Help me..

6 Answers, 1 is accepted

Sort by
0
Carson
Top achievements
Rank 1
answered on 24 Aug 2011, 01:11 PM
There is a good example, here.
0
FinallyInSeattle
Top achievements
Rank 1
answered on 19 Oct 2011, 08:11 PM
The referenced Code Library sample (http://www.telerik.com/community/code-library/aspnet-mvc/grid/batch-editing-with-combobox-editor-template.aspx) is erroring out with "Error! The requested URL returned 500 - error.".  Could someone provide the necessary updates to run it?

Thanks in advance!
0
Georgi Krustev
Telerik team
answered on 20 Oct 2011, 08:11 AM
Hello Finallyinseattle,

 
Unfortunately, I was not able to observe the depicted issue locally. Here is a screen-cast showing what I have tested.

Best wishes,
Georgi Krustev
the Telerik team
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Kenneth
Top achievements
Rank 1
answered on 03 Nov 2011, 06:06 PM
@Finallyinseattle -- just downloaded the app, got the same 500 internal server error.  The error reads:

The database '1DF0E655B95BBB292FF79A636072EE27_EDITINGWITHCOMBOBOXEDITORTEMPLATE\BATCHEDITINGWITHCOMBOBOXEDITORTEMPLATE\APP_DATA\NORTHWIND.MDF' cannot be opened because it is version 661. This server supports version 655 and earlier. A downgrade path is not supported.
Could not open new database '1DF0E655B95BBB292FF79A636072EE27_EDITINGWITHCOMBOBOXEDITORTEMPLATE\BATCHEDITINGWITHCOMBOBOXEDITORTEMPLATE\APP_DATA\NORTHWIND.MDF'. CREATE DATABASE is aborted.
An attempt to attach an auto-named database for file C:\Documents and Settings\kenneth.xxxx\Desktop\257909_BatchEditingWithComboBoxEditorTemplate\BatchEditingWithComboBoxEditorTemplate\App_Data\Northwind.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

My SQLEXPRESS Server is running from the MSSQL10.SQLEXPRESS directory on my machine.  Is that not up to date enough to run this example?
0
Georgi Krustev
Telerik team
answered on 04 Nov 2011, 09:38 AM
Hello Kenneth,

 
Check this blog post for more information.

All the best,
Georgi Krustev
the Telerik team
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Kenneth
Top achievements
Rank 1
answered on 04 Nov 2011, 10:50 PM
Hi Georgi,

Thanks for the link.  It worked for me once I updated my SqlServer Express version.

Kenneth
Tags
Grid
Asked by
Shibu
Top achievements
Rank 1
Answers by
Carson
Top achievements
Rank 1
FinallyInSeattle
Top achievements
Rank 1
Georgi Krustev
Telerik team
Kenneth
Top achievements
Rank 1
Share this question
or