New Posts New Posts RSS Feed: Data binding a SortSequence property to a grid?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Data binding a SortSequence property to a grid?

 Post Reply Post Reply
Author
aschaff View Drop Down
Newbie
Newbie
Avatar

Joined: 28-May-2009
Posts: 13
Post Options Post Options   Quote aschaff Quote  Post ReplyReply Direct Link To This Post Topic: Data binding a SortSequence property to a grid?
    Posted: 25-Jun-2009 at 3:10pm

Hello. I have a unique challenge. I want to use an XtraGrid to allow users to create and modify Favorite entities. Favorite is an entity that contains a Name and a SortSequence property. I would like the user to enter the name, but then I would like the SortSequence property to automatically match the order of the row in the grid. In other words, if the user enters 5 items in the grid, I want SortSequence to be 1 for the first row, 2 for the second row, and so forth. If the user delets the third row in the grid, I want the Favorite entity with SortSequence 4 to change to 3 (moving up the favorites list now that the 3rd one is gone). Likewise 5 should change to 4 and so forth.

I hope I am explaining this well. I can bind a list of Favorite entities to an XtraGrid using the XtraGridBindingManager just fine. But I have no idea how to go about binding the SortSequence property to the row number of the grid so that when I delete/insert/move grid rows, the bound entities renumber their SortSequence appropriately.

Can anyone offer advice on how to do this? Obviously, if there is a way to data bind the SortSequence property I would be ecstatic, but I'm open to other creative work arounds if necessary.

-AJ
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down