title: Kendo Grid - PopUp Editing: Differentiate between 'Edit' and 'Add'
body: <p>I have a Kendo grid which has custom edit buttons and a toolbar which allows you to add new. </p>
  
  <p>The edit/new functionality uses only one template.</p>
  
  <p>How can I tell if I am in 'Edit' mode vs 'New' mode.</p>
  
  <p>My code(Kendo Grid):</p>
  
  <pre><code> @(Html.Kendo().Grid(Model.OtherBreeds)
                .Name("grdOtherBreeds")
                .HtmlAttributes(new { @class = "grid" })
                .Columns(columns =&gt;
                {
                    columns.Bound(c =&gt; c.OrganizationName);
                    columns.Bound(c =&gt; c.Prefix);
                    columns.Bound(c =&gt; c.Name);
                    columns.Bound(c =&gt; c.MemberId);
                    columns.Template(e =&gt; { })
                        .ClientTemplate(KendoTemplates.ActionColumn.WithEdit().WithDelete().Get())
                        .Visible(true)
                        .Title(Resources.Actions)
                        .Width(Constants.GridCommandColumnWidth);
                })
                .DataSource(dataSource =&gt; dataSource
                    .Ajax()
                    .PageSize(50) //? standard page size when grid is only UI element on screen?
                    .Model(model =&gt;
                    {
                        model.Id(p =&gt; p.Id);
                        model.Field(p =&gt; p.OrganizationName);
                        model.Field(p =&gt; p.Prefix);
                        model.Field(p =&gt; p.Name);
                        model.Field(p =&gt; p.MemberId);
                    })
                )
                .Events(e =&gt; e.DataBound(KendoEventHandlers.DataBound.WithNoData(Resources.NoOtherBreedsForCustomer).Get()))
                .Sortable()
                .Pageable()
                .Filterable()
                .Editable(editable =&gt; editable.Mode(GridEditMode.PopUp).TemplateName("OtherBreedTemplate").Window(w =&gt; w.Width(500).Title("Add Other Breed")))
                .ToolBar(toolbar =&gt;
                {
                    toolbar.Template(KendoTemplates.Toolbar.WithAdd("Add Other Breed").Get());
                })
                )  
  </code></pre>