title: why my e.item in radgrid ItemCommand event always null
body: <p>I'm using RadGrid control, and I cread a group of command button, as insert , update, save , delete. When I click insert button, RadGrid can enter insert mode, But when I click save button after entering data, the e.item is always null? how can i fetch Radgrid values of item in editmode/insermode ?</p>
  
  <p>Here is the partial code:
  asp:</p>
  
  <pre><code>  &lt;telerik:RadGrid ID="RadGridLandBlock" runat="server" Culture="zh-CN" GroupPanelPosition="Top"  AutoGenerateColumns="false"  
         Width="1000px" Height="500px"  Skin="Metro" 
        OnNeedDataSource="RadGridLandBlock_NeedDataSource" 
        OnItemCommand ="RadGridLandBlock_ItemCommand" 
        OnItemCreated ="RadGridLandBlock_ItemCreated"  
         OnInsertCommand="RadGridLandBlock_InsertCommand" 
        &gt;
        &lt;ClientSettings&gt;
            &lt;Selecting AllowRowSelect="True"  /&gt;
            &lt;Scrolling AllowScroll="true"  /&gt;
            &lt;Resizing AllowColumnResize="true" ResizeGridOnColumnResize="true" AllowResizeToFit="true" /&gt;    
        &lt;/ClientSettings&gt;
        &lt;MasterTableView ClientDataKeyNames="PK_Land"  DataKeyNames="PK_Land" EditMode="InPlace" CommandItemDisplay="Top"    &gt;
            &lt;NoRecordsTemplate&gt;
                No Record
            &lt;/NoRecordsTemplate&gt;
            &lt;CommandItemSettings ShowRefreshButton="false"  /&gt;
            &lt;CommandItemTemplate &gt;
                &lt;div id="RadGridCommand" style="padding: 10px 10px;" &gt;
                    &lt;telerik:RadButton ID="InsertBtn" CommandName="InsertBtn"    CommandArgument  ='&lt;%#Eval ("PK_Land") %&gt;' runat="server" Skin="Metro" Text="插入"  Enabled='&lt;%#! RadGridLandBlock.MasterTableView.IsItemInserted %&gt;' &gt;&lt;/telerik:RadButton&gt;
                    &lt;telerik:RadButton ID="DeleteBtn" CommandName="DeleteBtn"    runat="server" Skin="Metro"  Text ="Delete"  Enabled='&lt;%#! RadGridLandBlock.MasterTableView.IsItemInserted %&gt;' OnClientClicked="confirmDelete" &gt;&lt;/telerik:RadButton&gt;
                    &lt;telerik:RadButton ID="EditBtn" CommandName="EditBtn" runat="server" Skin="Metro" Text="Edit"  Enabled='&lt;%# RadGridLandBlock.EditIndexes.Count == 0 %&gt;'&gt;&lt;/telerik:RadButton&gt;
                    &lt;telerik:RadButton ID="SaveBtn" CommandName="SaveBtn" runat="server" Skin="Metro"  Text="Save"  Enabled='&lt;%# RadGridLandBlock.MasterTableView.IsItemInserted %&gt;' &gt;&lt;/telerik:RadButton&gt;
                    &lt;telerik:RadButton ID="CancelBtn" CommandName="CancelBtn" runat="server" Skin="Metro"  Text="Cancel"  Enabled='&lt;%# RadGridLandBlock.EditIndexes.Count &gt; 0 ||RadGridLandBlock.MasterTableView.IsItemInserted %&gt;' &gt;&lt;/telerik:RadButton&gt;
                &lt;/div&gt;
            &lt;/CommandItemTemplate&gt;
            &lt;Columns&gt;
                  &lt;telerik:GridBoundColumn DataField="PK_Land" DataType="System.Guid"  HeaderText="PK_Land" ReadOnly="True" SortExpression="PK_Land" UniqueName="PK_Land"&gt;
                  &lt;/telerik:GridBoundColumn&gt;
                  &lt;telerik:GridBoundColumn DataField="PK_BookID" DataType="System.Int32"  HeaderText="PK_BookID" ReadOnly="True" SortExpression="PK_BookID" UniqueName="PK_BookID"&gt;
                  &lt;/telerik:GridBoundColumn&gt;
                  &lt;telerik:GridBoundColumn DataField="LandBlockName" DataType="System.Char"  HeaderText="LandName" ReadOnly="false" SortExpression="LandBlockName" UniqueName="LandBlockName"&gt;
                  &lt;/telerik:GridBoundColumn&gt;
                  &lt;telerik:GridBoundColumn DataField="CapacityRate" DataType="System.Char"  HeaderText="Capacity" ReadOnly="false" SortExpression="CapacityRate" UniqueName="CapacityRate"&gt;
                  &lt;/telerik:GridBoundColumn&gt;       
                  &lt;telerik:GridBoundColumn DataField="PK_period" DataType="System.Int32"  HeaderText="PK_period" ReadOnly="false" SortExpression="PK_period" UniqueName="PK_period"&gt;
                  &lt;/telerik:GridBoundColumn&gt;       
                  &lt;telerik:GridBoundColumn DataField="PK_useridLastEditor" DataType="System.Int32"  HeaderText="PK_useridLastEditor" ReadOnly="false" SortExpression="PK_useridLastEditor" UniqueName="PK_useridLastEditor"&gt;
                  &lt;/telerik:GridBoundColumn&gt;       
            &lt;/Columns&gt;
        &lt;/MasterTableView&gt;
    &lt;/telerik:RadGrid&gt;
  </code></pre>
  
  <p>C#</p>
  
  <pre><code> protected void RadGridLandBlock_ItemCommand(object sender, GridCommandEventArgs e)
      {
          //insert btn clicked
          if (e.CommandName == "InsertBtn")
          {
              LabelTest.Text = "insert btn from itemcommand is fired";
              RadGridLandBlock.MasterTableView.IsItemInserted = true;
  
              RadGridLandBlock.Rebind();
          }
  //Save btn clicked
          if (e.CommandName=="SaveBtn")
          {
              LabelTest.Text = "SaveBtn from itemcommand is fired";
                  myCnn = new SqlConnection(myCnnstring);
                  myCnn.Open();
                  mysql = "insert into ld_landblock (PK_bookID,landblockname,capacityrate,pk_period,pk_userIDlasteditor) " +
                  " values(@pk_bookid, @landblockname,@capacityrate,@pk_period,@pk_userIDlasteditor)";
                  mycmd = new SqlCommand(mysql, myCnn);
                  GridEditFormItem editItem = e.Item as GridEditFormItem;
                  mycmd.Parameters.AddWithValue("@pk_bookid", Convert.ToInt32((editItem.FindControl("PK_BookID") as TextBox).Text));//HERE IS THE ERROR OCCURED)
                  mycmd.Parameters.AddWithValue.......
    }
  }
  
  
  
      protected void RadGridLandBlock_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
      {
         // RadGridLandBlock.MasterTableView.IsItemInserted = false;
          PK_bookID = Convert.ToInt32(ViewState["PK_BookID"]);
          PK_period = Convert.ToInt32(ViewState["PK_Period"]);
          (sender as RadGrid).DataSource = GetGridDatatable();
  
      }
  
  
      protected void RadGridLandBlock_ItemCreated(object sender, GridItemEventArgs e)
      {
  
  
      }
  </code></pre>
  
  <p>Thanks in advance.</p>