Does anyone have an example of adding buttons into a grid?
I’m finding some examples with a google search on infragistics, but I don’t quite understand all of what I’m reading. I’ll start experimenting, but if anyone has an example that will get me farther faster, that would be appreciated.
If I get it figured out I’ll post what I did to make it work.
as for adding the event handlers?
You could just hand type them into the initialize and destroy methods, just copy what you see for a wizard added section but mod it to fir your new button
looks like there is a built in wizard for the handler
and once you have an event handler built in you just do your code action off of that method
Is there a way to get a list of available arguments to use on an event handler? I’ve got it working to where I can click the button and get the message to pop up, but I need to get information from the row being clicked on. I’m trying to find some info in the object explorer but am having a tough time.
private void workGrid_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs args)
{
// ** Place Event Handling Code Here **
MessageBox.Show("Cell Clicked");
}
So I couldn’t figure out how to get anything else from the properties other than the key or the cell text (which there is none in this case) so I just ended up putting a foreach loop in there. It’s probably not the best way to do it, but that’s all I could figure out for now. If anyone has any better suggestions, let me know.
private void workGrid_ClickCellButton(object sender, Infragistics.Win.UltraWinGrid.CellEventArgs args)
{
// ** Place Event Handling Code Here **
foreach (var row in workGrid.Rows)
{
if (row.Activated)
MessageBox.Show(row.Cells["Calculated_TotalQtyLeft"].Value.ToString());
}
}
I use this on a deployed dashboard customisation. This happens to be on an AfterRowChange method - so basically I’m always setting my textbox equal to the value from the current row. You can hack this around a bit for your purposes.