예제 #1
0
 protected virtual void OnPageIndexChanged(MxDataGridPageChangedEventArgs e)
 {
     MxDataGridPageChangedEventHandler handler = (MxDataGridPageChangedEventHandler) base.Events[EventPageIndexChanged];
     if (handler != null)
     {
         handler(this, e);
     }
     this.EditItemIndex = -1;
     this.CurrentPageIndex = e.NewPageIndex;
     if (this.AutoDataBind)
     {
         this.DataBind();
     }
 }
예제 #2
0
 protected override bool OnBubbleEvent(object source, EventArgs e)
 {
     bool flag = false;
     if (e is MxDataGridCommandEventArgs)
     {
         MxDataGridCommandEventArgs args = (MxDataGridCommandEventArgs) e;
         this.OnItemCommand(args);
         flag = true;
         string commandName = args.CommandName;
         if (string.Compare(commandName, "Select", true, CultureInfo.InvariantCulture) == 0)
         {
             this.SelectedIndex = args.Item.ItemIndex;
             this.OnSelectedIndexChanged(EventArgs.Empty);
             return flag;
         }
         if (string.Compare(commandName, "Page", true, CultureInfo.InvariantCulture) == 0)
         {
             string commandArgument = (string) args.CommandArgument;
             int currentPageIndex = this.CurrentPageIndex;
             if (string.Compare(commandArgument, "Next", true, CultureInfo.InvariantCulture) == 0)
             {
                 currentPageIndex++;
             }
             else if (string.Compare(commandArgument, "Prev", true, CultureInfo.InvariantCulture) == 0)
             {
                 currentPageIndex--;
             }
             else
             {
                 currentPageIndex = int.Parse(commandArgument) - 1;
             }
             MxDataGridPageChangedEventArgs args2 = new MxDataGridPageChangedEventArgs(source, currentPageIndex);
             this.OnPageIndexChanged(args2);
             return flag;
         }
         if (string.Compare(commandName, "Sort", true, CultureInfo.InvariantCulture) == 0)
         {
             MxDataGridSortCommandEventArgs args3 = new MxDataGridSortCommandEventArgs(source, args);
             this.OnSortCommand(args3);
             return flag;
         }
         if (string.Compare(commandName, "Edit", true, CultureInfo.InvariantCulture) == 0)
         {
             this.OnEditCommand(args);
             return flag;
         }
         if (string.Compare(commandName, "Update", true, CultureInfo.InvariantCulture) == 0)
         {
             this.OnUpdateCommand(new MxDataGridUpdateEventArgs(args, false));
             return flag;
         }
         if (string.Compare(commandName, "Cancel", true, CultureInfo.InvariantCulture) == 0)
         {
             this.OnCancelCommand(args);
             return flag;
         }
         if (string.Compare(commandName, "Delete", true, CultureInfo.InvariantCulture) == 0)
         {
             this.OnDeleteCommand(new MxDataGridCancelEventArgs(args, false));
         }
     }
     return flag;
 }