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

ClientTemplate check box control required field problem

0 Answers 90 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.
shanker bangari
Top achievements
Rank 1
shanker bangari asked on 25 Oct 2010, 07:09 AM
Hi,

I am doing one application on mvc grid .Here am using one ClientTemplate control of checkbox . I am not given required filed validation of that property .But here it's asking that complesary required . How to remove that required, please give me any solution . am using 2010.2.923.235 this version . am also sending image file of my grid and my source code . shanker.B
my source code
 
 
<%= Html.Telerik()
            .Grid<SAMA.DataModels.Common.FiscalYear>()
            .Name("FiscalYearGrid")
                    .ToolBar(tbar => tbar.Insert().HtmlAttributes(new { @style = ((Permission)ViewData["CRUD"]).Insert ? "" : "display:none;" }))
            .DataKeys(keys => keys.Add(o => o.FiscalYearID).RouteKey("fiscalYearID"))
            .ClientEvents(events => events.OnError("OnTelerikError"))
            .DataBinding(dataBinding => dataBinding.Ajax()
                                                     .Select("FiscalYearDetail", "School")
                                                     .Insert("FiscalYear_Insert", "School")
                                                     .Update("FiscalYear_Update", "School")
                                                     .Delete("FiscalYear_Delete", "School"))  
            .Columns(columns =>
            {
                columns.Bound(o => o.Fiscal_Year).Title("Fiscal Year").Width(100);
                columns.Bound(o => o.StartDate).Width(150);
                columns.Bound(o => o.EndDate).Width(150);
                columns.Bound(o => o.CurrentFiscalYear).ClientTemplate("<input id=cfy type=checkbox disabled=true <#=CurrentFiscalYear?'checked':'' #> /> ").Width(150);
                columns.Command(commands =>
                    {
                        commands.Edit().HtmlAttributes(new { @style = ((Permission)ViewData["CRUD"]).Update ? "" : "display:none;" });
                        commands.Delete().HtmlAttributes(new { @style = ((Permission)ViewData["CRUD"]).Delete ? "" : "display:none;" });
                    }).Width(200);
            })
            .Editable(editing => editing.Mode(GridEditMode.InLine))
            .Pageable()
    %>
fields of grid
 
public class FiscalYear
    {
        
        public int FiscalYearID { get; set; }
        
        [Required]
        [StringLength(128, ErrorMessage="Not More than 128 Charecters")]
        public string Fiscal_Year { get; set; }
 
        [DataType(DataType.Date), Required]
        public DateTime StartDate { get; set; }
 
        [DataType(DataType.Date), Required]
        public DateTime EndDate { get; set; }
         
        public bool CurrentFiscalYear { get; set; }
 
    }

Tags
Grid
Asked by
shanker bangari
Top achievements
Rank 1
Share this question
or