Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
180
Wants new row at top in wingrid
posted

Hi

I am binding datagrid with binding list. I add new object in this list at index 0 but datagrid is adding at bottom.

Dot Net grid insert at top with Same behaviour  but I want to use ultrawingrid.

 

Please suggest how can add new row at top by using binding list.

 

Thanks in advance

- Neeraj

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi Neeraj,

    When a new item is added to the list, the grid's get a notificaiton from the IBindingList. This notification includes information about what change (in this case ItemAdded) and an index. My guess is that the IBindingList implementation is always passing in the last index, rather than the correct index. So the grid has no choice but to place the item at the bottom where the IBindingList is telling it to.

    You might be able to work around this in a number of ways.

    One thing you can try is refrehing the grid rows:

    grid.Rows.Refresh(ReloadData);

    If that doesn't work, then another option might be to use th grid.Rows.Move method to explicitly move the row where you want it.

Children
No Data