title: Ext.Net:GridPanel with RowEditor Plugin
body: <p>when click the insert button(btnSinifEkle),my event fire via OnBeforeRecordInserted="tetikle4".even I click the cancel button,It is already inserted via OnBeforeRecordInserted and shown inside the grid. how I can avoid this.Plus when ever I click insert button ,record shown inside grid,even I dont tell update or cancel.</p>
  
  <p>thank you so much.</p>
  
  <pre><code>&lt;ext:XScript ID="XScript1" runat="server"&gt;
          &lt;script&gt;
              var sinifEkle = function () {
                  var grid = #{gridSinif};
                  grid.editingPlugin.cancelEdit();
  
                  // Create a record instance through the ModelManager
                  var r = Ext.ModelManager.create({
                      SinifAd: 'yeni sınıf',
  
                  }, 'Sinif');
  
                  grid.store.insert(0, r);
                  grid.editingPlugin.startEdit(0, 0);
              };
  
              var sinifSil = function () {
                  var grid = #{gridSinif},
                      sm = grid.getSelectionModel();
  
                  grid.editingPlugin.cancelEdit();
                  grid.store.remove(sm.getSelection());
                  if (grid.store.getCount() &gt; 0) {
                      sm.select(0);
                  }
              };
          &lt;/script&gt;
      &lt;/ext:XScript&gt;                
  
  
    &lt;ext:GridPanel ID="gridSinif" runat="server" Width="250" Height="300" Title="Sınıf tanımlama"
                                      Frame="true"&gt;
                                      &lt;Store&gt;
                                          &lt;ext:Store ID="SinifStore" runat="server" AutomaticResponseValues="false" OnAfterStoreChanged="tetikle"
                                              OnBeforeRecordUpdated="tetikle1" OnBeforeRecordDeleted="tetikle3" AutoSync="true" OnBeforeRecordInserted="tetikle4"&gt;
                                              &lt;Model&gt;
                                                  &lt;ext:Model ID="Model1" runat="server" IDProperty="SinifId" Name="Sinif"&gt;
                                                      &lt;Fields&gt;
                                                          &lt;ext:ModelField Name="SinifId" Type="Int" /&gt;
                                                          &lt;ext:ModelField Name="SinifAd" Type="String" /&gt;
                                                      &lt;/Fields&gt;
                                                  &lt;/ext:Model&gt;
                                              &lt;/Model&gt;
                                          &lt;/ext:Store&gt;
                                      &lt;/Store&gt;
                                      &lt;Plugins&gt;
                                          &lt;ext:RowEditing ID="RowEditing1" runat="server" ClicksToMoveEditor="1" AutoCancel="false" /&gt;
                                      &lt;/Plugins&gt;
                                      &lt;TopBar&gt;
                                          &lt;ext:Toolbar ID="Toolbar1" runat="server"&gt;
                                              &lt;Items&gt;
                                                  &lt;ext:Button ID="btnSinifEkle" runat="server" Text="Sınıf ekle" Icon="Add"&gt;
                                                      &lt;Listeners&gt;
                                                          &lt;Click Fn="sinifEkle" /&gt;
                                                      &lt;/Listeners&gt;
                                                  &lt;/ext:Button&gt;
                                                  &lt;ext:Button ID="btnSinifSil" runat="server" Text="Sınıf sil" Icon="Delete" Disabled="true"&gt;
                                                      &lt;Listeners&gt;
                                                          &lt;Click Fn="sinifSil" /&gt;
                                                      &lt;/Listeners&gt;
                                                  &lt;/ext:Button&gt;
                                              &lt;/Items&gt;
                                          &lt;/ext:Toolbar&gt;
                                      &lt;/TopBar&gt;
                                      &lt;ColumnModel ID="ColumnModel1" runat="server"&gt;
                                          &lt;Columns&gt;
                                              &lt;ext:Column ID="Column1" runat="server" Text="ID" DataIndex="SinifId" Width="35" /&gt;
                                              &lt;ext:Column ID="Column3" runat="server" Text="Sınıf adı" DataIndex="SinifAd" Flex="1"&gt;
                                                  &lt;Editor&gt;
                                                      &lt;ext:TextField runat="server" /&gt;
                                                  &lt;/Editor&gt;
                                              &lt;/ext:Column&gt;
                                          &lt;/Columns&gt;
                                      &lt;/ColumnModel&gt;
                                      &lt;Listeners&gt;
                                          &lt;SelectionChange Handler="#{btnSinifSil}.setDisabled(!selected.length);" /&gt;
                                      &lt;/Listeners&gt;
                                  &lt;/ext:GridPanel&gt;
  </code></pre>