Please Help - Allow Paging on Grid Properties Builder

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Please Help - Allow Paging on Grid Properties Builder

    Hi,

    I'm working on a grid when the database returns ... say 100 rows. I would
    like to use the Allow Page in the grid Properties, but don't really know how
    to code it right. I copied some code from the help, but it doesn't really
    work yet. The compiler complains on the following...

    private void InitializeComponent()
    {
    this.gridLegalEntityEmployee.SelectedIndexChanged += new
    System.EventHandler(this.gridLegalEntityEmployee_S electedIndexChanged);
    this.gridLegalEntityEmployee.PageIndexChanged += new
    System.EventHandler(this.gridLegalEntityEmployee_P ageIndexChanged );

    this.Load += new System.EventHandler(this.Page_Load);

    }

    private void gridLegalEntityEmployee_PageIndexChanged( object source,
    System.Web.UI.WebControls.DataGridPageChangedEvent Args e)
    {
    gridLegalEntityEmployee.CurrentPageIndex = e.NewPageIndex;
    gridLegalEntityEmployee.DataBind();
    }

    === Error ======
    this.gridLegalEntityEmployee_PageIndexChanged =>
    'cpNET.WebForm1.gridLegalEntityEmployee_PageIndexC hanged(object,
    System.Web.UI.WebControls.DataGridPageChangedEvent Args)' does not match
    delegate 'void System.EventHandler(object, System.EventArgs)'

    Here is some other sniplet code

    ================================================== ==============
    private void Page_Load(object sender, System.EventArgs e)
    {
    // Put user code to initialize the page here
    gridLegalEntityEmployee.AllowPaging = true;
    gridLegalEntityEmployee.PagerStyle.Mode = PagerMode.NumericPages;
    gridLegalEntityEmployee.PagerStyle.PageButtonCount = 15;
    gridLegalEntityEmployee.PageSize = 15;

    LoadLegalEntityEmployeeList();

    if (!Page.IsPostBack)
    {
    gridLegalEntityEmployee.DataBind();
    }
    }

    private void LoadLegalEntityEmployeeList()
    {
    LegalEntityEmployee leEmployee = new LegalEntityEmployee();

    // Retrieve data from database
    gridLegalEntityEmployee.DataSource = leEmployee.SelectAll();

    // Bind it to Databind
    gridLegalEntityEmployee.DataBind();
    }
    ================================================== ==============

    I know there is a stupid mistake I made here, but I just cant't see it. Any
    suggestion or recommeded is greatly appreciated. I really appriciate you
    guys help.

    Thanks a lot.

    Eddy


    Eddy Soeparmin Guest

  2. Similar Questions and Discussions

    1. TypeError: beforeNode has no properties-MX query builder
      Hi everybody Hope i can find some support in here.sad that this bundle is discontinued. Anyways,am working on Classifieds Ad tutorial found...
    2. Flex2: General question on approach to paging data in the Grid component
      What is the best way/preferred approach to working with large recordsets (100 to 200 rows) for the DataGrid? Is there inherent support for paging...
    3. Setting Control Properties with a Control Builder
      I have a control that requires a custom ControlBuilder to parse certain child tags as controls, but I also want to use other tags to set properties....
    4. alpha paging and data grid??
      Can someone please tell me why this is not working??? I used a sample that I found and it works great with the pubs database, however, as soon as...
    5. Grid Paging
      I am having trouble making the grid paging work. When I first come into the page the page count is 3. But when I click to go to page 2 and do the...
  3. #2

    Default Re: Please Help - Allow Paging on Grid Properties Builder

    you page index changed event is mapped to the wrong handler
    it should be
    System.Web.UI.WebControls.DataGridPageChangedEvent Handler instead of
    system.eventhandler

    "Eddy Soeparmin" <esoeparmin@clientprofiles.com> wrote in message
    news:OyTwWzjSDHA.940@TK2MSFTNGP11.phx.gbl...
    > Hi,
    >
    > I'm working on a grid when the database returns ... say 100 rows. I would
    > like to use the Allow Page in the grid Properties, but don't really know
    how
    > to code it right. I copied some code from the help, but it doesn't really
    > work yet. The compiler complains on the following...
    >
    > private void InitializeComponent()
    > {
    > this.gridLegalEntityEmployee.SelectedIndexChanged += new
    > System.EventHandler(this.gridLegalEntityEmployee_S electedIndexChanged);
    > this.gridLegalEntityEmployee.PageIndexChanged += new
    > System.EventHandler(this.gridLegalEntityEmployee_P ageIndexChanged );
    >
    > this.Load += new System.EventHandler(this.Page_Load);
    >
    > }
    >
    > private void gridLegalEntityEmployee_PageIndexChanged( object source,
    > System.Web.UI.WebControls.DataGridPageChangedEvent Args e)
    > {
    > gridLegalEntityEmployee.CurrentPageIndex = e.NewPageIndex;
    > gridLegalEntityEmployee.DataBind();
    > }
    >
    > === Error ======
    > this.gridLegalEntityEmployee_PageIndexChanged =>
    > 'cpNET.WebForm1.gridLegalEntityEmployee_PageIndexC hanged(object,
    > System.Web.UI.WebControls.DataGridPageChangedEvent Args)' does not match
    > delegate 'void System.EventHandler(object, System.EventArgs)'
    >
    > Here is some other sniplet code
    >
    > ================================================== ==============
    > private void Page_Load(object sender, System.EventArgs e)
    > {
    > // Put user code to initialize the page here
    > gridLegalEntityEmployee.AllowPaging = true;
    > gridLegalEntityEmployee.PagerStyle.Mode = PagerMode.NumericPages;
    > gridLegalEntityEmployee.PagerStyle.PageButtonCount = 15;
    > gridLegalEntityEmployee.PageSize = 15;
    >
    > LoadLegalEntityEmployeeList();
    >
    > if (!Page.IsPostBack)
    > {
    > gridLegalEntityEmployee.DataBind();
    > }
    > }
    >
    > private void LoadLegalEntityEmployeeList()
    > {
    > LegalEntityEmployee leEmployee = new LegalEntityEmployee();
    >
    > // Retrieve data from database
    > gridLegalEntityEmployee.DataSource = leEmployee.SelectAll();
    >
    > // Bind it to Databind
    > gridLegalEntityEmployee.DataBind();
    > }
    > ================================================== ==============
    >
    > I know there is a stupid mistake I made here, but I just cant't see it.
    Any
    > suggestion or recommeded is greatly appreciated. I really appriciate you
    > guys help.
    >
    > Thanks a lot.
    >
    > Eddy
    >
    >

    Alvin Bruney Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139