in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Grid Pager when using runtime DataBinding

Last post 02-20-2008 3:41 AM by C1_SergeiS. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 02-11-2008 4:30 PM

    Grid Pager when using runtime DataBinding

    I am new with C1 Components. I am using the C1WebGrid in an aspx page. Using runtime databinding to populate the grid (from a DataSet). I defined in the designer the pager for my grid, 25 rows, using standard top&bottom < and > settings. Everything is working properly, but when I try to use the pager during execution, I got an exception "grdPaymentSummary: the PageIndexChanging event was not handled.". This of course does not happen if I define my DataBinding at design time.

     
    Is there a way to get default Pager behavior even if databinding is done at runtime ?

     

  • 02-12-2008 3:39 PM In reply to

    Re: Grid Pager when using runtime DataBinding

    Hi,
     
    If you are binding the grid at runtime, you need to set the paging as well as sorting at runtime. You may refer the paging sample shipped along with the control.
    If you have installed the complete ASP.Net suit, you may find the sample at:
    C:\Program Files\ComponentOne Studio.NET 2.0\C1WebGrid\Samples
     
    I hope it helps.
     
    Regards,
    Andrew
    <pascall> wrote in message news:201826@10.0.1.98...

    I am new with C1 Components. I am using the C1WebGrid in an aspx page. Using runtime databinding to populate the grid (from a DataSet). I defined in the designer the pager for my grid, 25 rows, using standard top&bottom &lt; and &gt; settings. Everything is working properly, but when I try to use the pager during execution, I got an exception "grdPaymentSummary: the PageIndexChanging event was not handled.". This of course does not happen if I define my DataBinding at design time.


    Is there a way to get default Pager behavior even if databinding is done at runtime ?

     



    http://helpcentral.componentone.com/cs/forums/p/74274/201826.aspx#201826

  • 02-12-2008 4:07 PM In reply to

    Re: Grid Pager when using runtime DataBinding

     Thanks for your answer Andrew,

    I checked the samples this morning. From what i understand, you bind the grid to a subset of your results (the SQL query returns the top-N items). Problem is that I have to calculate totals for the whole query and place them in the column footers of the grid. To calculate those totals, I referred to one of the samples: I use the ItemDataBound, ItemCreated and DataBound event of the grid. It is working fine as I return the full dataSet. Problem is that if i implement the paging as you suggest, I will have only a subset of data to work with... hence the totals won't be correct.

    Is there a way to bind the grid to the full dataSet but display only a subset of rows ? That I think could solve my problems.

    Regards,

    Pascal
     


     

  • 02-20-2008 3:41 AM In reply to

    Re: Grid Pager when using runtime DataBinding

    Hi,
     
    seems you checked CustomPaging sample that shows fully manual paging which is not your case. You only need to put the following line C1WebGrid.CurrentPageIndex = e.NewPageIndex; to the PageIndexChanging event handler and rebind grid to data there.
     
    Regards,
    Sergey.
    <pascall> wrote in message news:201864@10.0.1.98...

     Thanks for your answer Andrew,

    I checked the samples this morning. From what i understand, you bind the grid to a subset of your results (the SQL query returns the top-N items). Problem is that I have to calculate totals for the whole query and place them in the column footers of the grid. To calculate those totals, I referred to one of the samples: I use the ItemDataBound, ItemCreated and DataBound event of the grid. It is working fine as I return the full dataSet. Problem is that if i implement the paging as you suggest, I will have only a subset of data to work with... hence the totals won't be correct.

    Is there a way to bind the grid to the full dataSet but display only a subset of rows ? That I think could solve my problems.

    Regards,

    Pascal
     


     



    http://helpcentral.componentone.com/cs/forums/p/74274/201864.aspx#201864

Page 1 of 1 (4 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.