Jump to content
Software FX Community

Embedded Custom Command buttons


jvwiv

Recommended Posts

I have a grid that displays items to be billed.  I have added a button to the grid next to each item I want to bill.  The button should retrieve the index of the item clicked and process a stored proc.  Unfortunately I can not determine how to find the key value, or any datavalues, associated with the item.  Any ideas?

Link to comment
Share on other sites

First, ensure you are using the GridFX:CommandButton control and its Command property is CustomCommand.  These are the defaults set by the wizard, so if you added it through that then you should be fine.

All you need to do now is handle Grid's ExecutingCustomCommand event.  That can be accessed via the Events tab in the Property Grid.  In the event handler, the "e" (event args) parameter should have everything you need.  However, the event args in the build you have doesn't include a grid item. To get the grid item for the button clicked, you can just use a static method on the GridItem class:

GridItem item = GridItem.FindContainingItem(e.Source)

We are in the midst of deploying a service pack update for Grid FX.  It should be available in the next day.  The good news is that the new version has a GridItem property in the event args.  I highly recommend the update.  Especially if you're using VS 2008.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...