protected void FieldGrid_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "MoveUp")
     {
         IList <InputField> inputFields;
         if (((GridView)sender).ID == "MerchantFieldGrid")
         {
             inputFields = InputFieldDataSource.LoadForProductTemplate(_ProductTemplateId, InputFieldScope.Merchant);
         }
         else
         {
             inputFields = InputFieldDataSource.LoadForProductTemplate(_ProductTemplateId, InputFieldScope.Customer);
         }
         int itemIndex = AlwaysConvert.ToInt(e.CommandArgument);
         if ((itemIndex < 1) || (itemIndex > inputFields.Count - 1))
         {
             return;
         }
         InputField selectedItem = inputFields[itemIndex];
         InputField swapItem     = inputFields[itemIndex - 1];
         inputFields.RemoveAt(itemIndex - 1);
         inputFields.Insert(itemIndex, swapItem);
         for (int i = 0; i < inputFields.Count; i++)
         {
             inputFields[i].OrderBy = (short)i;
         }
         inputFields.Save();
     }
     else if (e.CommandName == "MoveDown")
     {
         IList <InputField> inputFields;
         if (((GridView)sender).ID == "MerchantFieldGrid")
         {
             inputFields = InputFieldDataSource.LoadForProductTemplate(_ProductTemplateId, InputFieldScope.Merchant);
         }
         else
         {
             inputFields = InputFieldDataSource.LoadForProductTemplate(_ProductTemplateId, InputFieldScope.Customer);
         }
         int itemIndex = AlwaysConvert.ToInt(e.CommandArgument);
         if ((itemIndex > inputFields.Count - 2) || (itemIndex < 0))
         {
             return;
         }
         InputField selectedItem = inputFields[itemIndex];
         InputField swapItem     = inputFields[itemIndex + 1];
         inputFields.RemoveAt(itemIndex + 1);
         inputFields.Insert(itemIndex, swapItem);
         for (int i = 0; i < inputFields.Count; i++)
         {
             inputFields[i].OrderBy = (short)i;
         }
         inputFields.Save();
     }
     else if (e.CommandName == "Copy")
     {
         int        inputFieldId = AlwaysConvert.ToInt(e.CommandArgument);
         InputField copy         = InputField.Copy(inputFieldId, true);
         if (copy != null)
         {
             // THE NAME SHOULD NOT EXCEED THE MAX 100 CHARS
             String newName = "Copy of " + copy.Name;
             if (newName.Length > 100)
             {
                 newName = newName.Substring(0, 97) + "...";
             }
             copy.Name = newName;
             copy.ProductTemplateId = _ProductTemplateId;
             _ProductTemplate.InputFields.Add(copy);
             _ProductTemplate.InputFields.Save();
         }
     }
     ((GridView)sender).DataBind();
 }