in

C1 Community

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

Adding sort capability to dynamically databound webgrid

Last post 03-28-2008 4:05 PM by Dbishop9. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 03-25-2008 12:12 PM

    Adding sort capability to dynamically databound webgrid

    I have a webgrid with template fields that is dynamically databound to a dataset. All access to data must be done with parameterized stored procedures. I have no problems editing, updating, paging, or deleting items, however, when I try to add sorting; I am either able to sort & can no longer edit (i get index out of range error for edit item index when updating) or I am able to do all my editing, but cannot sort. I've seen different methods online, however, they all show direct access to the tables aka autoediting directly through a sqldatasource; or they simply say rebind in the sorting command, which doesn't work as they explain it. All of the C1 examples that have sorting or sorting/editing all show sqldatasource binding only. I must use stored procedures. I just want to add sorting to an existing webgrid that is dynamically databound to a dataset. Can someone please help?

  • 03-27-2008 1:43 AM In reply to

    Re: Adding sort capability to dynamically databound webgrid

    Could you please post your code that replicates this issue?
     
    Regards,
    Patrick
    <Dbishop9> wrote in message news:203196@10.0.1.98...

    I have a webgrid with template fields that is dynamically databound to a dataset. All access to data must be done with parameterized stored procedures. I have no problems editing, updating, paging, or deleting items, however, when I try to add sorting; I am either able to sort & can no longer edit (i get index out of range error for edit item index when updating) or I am able to do all my editing, but cannot sort. I've seen different methods online, however, they all show direct access to the tables aka autoediting directly through a sqldatasource; or they simply say rebind in the sorting command, which doesn't work as they explain it. All of the C1 examples that have sorting or sorting/editing all show sqldatasource binding only. I must use stored procedures. I just want to add sorting to an existing webgrid that is dynamically databound to a dataset. Can someone please help?



    http://helpcentral.componentone.com/cs/forums/p/74743/203196.aspx#203196

  • 03-28-2008 4:05 PM In reply to

    Re: Adding sort capability to dynamically databound webgrid

    Thanks anyway PatrickS, I finally figured it out. I added case statements to the queries for the order by, then in the code behind I have to keep track of what column & direction I'm sorting by way of a couple session variables, and at certain points rebind the grid so I can access the templated controls dynamically.

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