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

[Solved] Editor Template with Telerik.ComboBox - Required field is always showing even with value

1 Answer 100 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.
Al Jeffrey
Top achievements
Rank 1
Al Jeffrey asked on 13 Dec 2010, 10:02 AM
I have an Editor template with Telrik.ComboBox. The comboBox is populated correctly and I can select from the list but when I click OK, even there is selected item, it keeps on giving me the validation error that my ITEM field is required. 

MODEL
[ScaffoldColumn(false)]
public decimal ItemID { getset; }
 
[DisplayName("Item")]
[UIHint("ClientItemLookUp"), Required]
public string ItemName { getset; }

VIEW

<%= Html.Telerik().Grid<PrDetailEntity>()
    .Name("itemList")
    .ToolBar(commands => commands.Insert().ButtonType(GridButtonType.Image))
    .DataKeys(keys =>
    {
        keys.Add(c => c.ItemID);
    })
    .DataBinding(dataBinding =>
    {
        dataBinding.Ajax()
            .Select("_SelectAjaxEditing", "Prentry")
            .Insert("_InsertAjaxEditing", "Prentry")
            .Update("_SaveAjaxEditing", "Prentry")
            .Delete("_DeleteAjaxEditing", "Prentry");
    })
    .Columns(columns =>
    {
        columns.Bound(o => o.ItemID).Width(50).Hidden(true);
        columns.Bound(o => o.ItemName);
        columns.Bound(o => o.ItemDescription);
        columns.Bound(o => o.Quantity).Width(100);
        columns.Bound(o => o.Uom).Width(100);
        columns.Bound(o => o.QuantityCost).Width(100);                   
        columns.Bound(o => o.ItemCost).Width(100);
        columns.Command(commands =>
        {
            commands.Edit().ButtonType(GridButtonType.Image);
            commands.Delete().ButtonType(GridButtonType.Image);
        }).Width(180).Title("Commands");
         
    })
    .Editable(
        editing => editing.Mode(GridEditMode.PopUp)
            .TemplateName("test")
            )
    .Footer(false)                 
%>

ClientItemLookUp.ascx
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<dynamic>" %>
 
<%= Html.Telerik().ComboBox()
    .Name("ItemList")
    .AutoFill(false)
    .HighlightFirstMatch(true)
    .HtmlAttributes(new { style = "width: 300px; " })
    .DataBinding(binding => binding.Ajax()
                                .Select("_GetVendorByName", "Entry")
                                .Delay(400)
                                .Cache(false)
    )
    .Filterable(filtering =>
    {
        filtering.FilterMode(AutoCompleteFilterMode.Contains);
        filtering.MinimumChars(1);
    })
 %>


Validation
select
 The Item field is required




1 Answer, 1 is accepted

Sort by
0
Georgi Krustev
Telerik team
answered on 14 Dec 2010, 05:15 PM
Hi Al Jeffrey,

 I am not sure where could be the problem. Here is a test project which I have created in my attempt to reproduce depicted issue. It is attached to this message.

Best wishes,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Grid
Asked by
Al Jeffrey
Top achievements
Rank 1
Answers by
Georgi Krustev
Telerik team
Share this question
or