Home Forums WinForms controls Xceed Grid for WinForms Addhandler problem when refreshing the grid

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13214 |

    Hi all,
    I used this example http://www.xceedsoft.com/Forums/ShowPost.aspx?PostID=1714 to capture a right-click on a cell. Now I have a problem when I need to refresh the grid: As there might be new rows I need to subscribe to them. Currently I subscribe to ALL cells again so after refreshing the grid 3 times the event is fired 4 times 🙁
    What is the best way to prevent this? Is there a property to find out whether a cell is already subscribed to a handler? Do I need to keep internal records storing which cells are already subscribed? Or should I just frist remove and then add? I would like to have the <b>fastest</b> solution for the user. Maybe someone could post an example? I guess I’m not the first with this problem… 😉

    Imported from legacy forums. Posted by Kai (had 1851 views)

    User (Old forums)
    Member
    Post count: 23064

    Don’t subscribe to all the cells each time.
    Catch the <b>AddingDataRow</b>-event of the gridcontrol, and in that eventhandler subscribe to the cells in the newly added datarow.

    Imported from legacy forums. Posted by Tommy (had 3021 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.