2

I have a kendo grid.There are 5 drop downs in that.All those are editor templates.When the grid is in edit mode I want to make first 4 drop downs as editable false and last one I want to keep as editable true.While adding a new row in grid I want to keep all the drop downs as editable true.How can I achieve this? Here is my kendo grid code:

         @(Html.Kendo().Grid<ClaimPro.Data.ClientAttributeDO>()
                     .Name("grdVerificationAttributes")
                     .Columns(columns =>
                     {

     columns.Bound(clientAttr => clientAttr.ClaimSource).EditorTemplateName("CDDL").Title(Resource.ClaimSource);
     columns.Bound(clientAttr => clientAttr.AreaLevel).EditorTemplateName("DDL").Title(Resource.AreaLevel);
     columns.Bound(clientAttr => clientAttr.claim_type_name).EditorTemplateName("DDL").Title(Resource.ClaimType);
     columns.Bound(clientAttr => clientAttr.claimant_type_name).EditorTemplateName("DDL").Title(Resource.ClaimantType);
     columns.Bound(clientAttr => clientAttr.Attribute_Value).EditorTemplateName("DDL").Title(Resource.AttributeValue);

                     })
                      .Scrollable()
                      .Sortable()
                      .Filterable()
                      .Selectable(selectable =>
                      {
                          selectable.Mode(GridSelectionMode.Single);
                          selectable.Type(GridSelectionType.Row);
                      }
                      )
                      .Events(events => events.Edit("onEdit"))
                      .Editable(editable => editable.Mode(GridEditMode.InCell)).Navigatable()
                      .DataSource(dataSource => dataSource
                          .Ajax()
                          .ServerOperation(true)
                          .Batch(true)
                          .Model(model => model.Field(c => c.Attribute_Value).Editable(true))
                          .Model(model => model.Field(c => c.ClaimSource).Editable(true))
                          .Model(model => model.Field(c => c.AreaLevel).Editable(true))
                          .Model(model => model.Field(c => c.claim_type_name).Editable(true))
                          .Model(model => model.Field(c => c.claimant_type_name).Editable(true))

                          .Read(read => read.Action("GetVerificationAttributesInfo", "ClientAttribute").Data("GetClientId")))
                              )

If I am using grid.closecell on Edit event,entire row is getting closed.But I want only first four column to be disabled.Can anyone please tell me how can I get particular dropdown Id or How to make particular cell diasble in edit mode.

Navya Rao
  • 21
  • 6
  • are you want to disable cell or entire column ? see this link http://www.telerik.com/forums/when-editing-a-grid-how-do-i-disable-specific-fields-by-row#nybmyAxjVE2FecbkBqVQzA – Frebin Francis Mar 03 '15 at 11:57
  • @FrebinFrancis I want to disable entire column while editing the grid.If I use grid.closecell,all the 5 columns are getting disabled.But I want to disable only first four column.. – Navya Rao Mar 03 '15 at 13:37
  • i didn't look for the Kendo Grid API documentation but i think there may be some way to identify the column using index in this event. – Frebin Francis Mar 03 '15 at 14:04
  • @NavyaRao if you are looking for a solution refer http://stackoverflow.com/questions/28898845/kendo-ui-grid-conditionally-editable-cell/28901133#28901133 – Harsh Mar 07 '15 at 09:42

0 Answers0