Hi I have a relatively simple need.
I'm binding data to a grid and in one column I'm binding an int that is either a 0, 1, or 2.
When this grid is displayed I want a button to show up instead of an int and the button will show a different picture either a padlock for 2 or a stopwatch for 1 etc.
Just wondering what the key steps are to doing this. Where do I assign an Image to the button based on the bound underlying int.
I also need the buttons to look a lot more presentable...do I just mess with the appearance values. is there anyway to get some preconfigured buttons...it seems it just fills the whole cell with a button...
Also, how do I tie a generic event up to the button that will give me control and the underlying int value when clicked.
Hi,
I you have three possible options, then a button doesn't really make sense, does it?
I think a dropdown would be better than a button. There's a sample of exactly what you are describing here using a ValueList:
http://community.infragistics.com/forums/p/17549/63689.aspx#63689
If you'd really use a button, then I'm not sure how that would work. I guess each click of the button would cycle the value to the next value and then wrap around from the beginning? That would be trickier to implement.
Okay.. I'm still not sure I understand completely. But it sounds like you want to examine the value in a cell and then set the image on the button based on that value.
If that's the case, then I would use the InitializeRow event and set the ButtonAppearance on the cell to an Appearance whose Image property is the image you want.
Sorry if I wasn't clear.
My grid is bound to a dataset. That dataset will have columns with ints. These ints are coming from the database with 3 different values. The values are controlling what the buttons do in the button click event. And they're controlling what they display to the user.
See, a note can either be open, locked or in-use. A user can click the button to open a note either way. But they need to be able to see what the state of the note is in through an image or text on the button.