I am creating an xamgrid in c#, there's no xaml at all. How can I add a button to a column purely through c#? Or even hyperlinked text if this is easier? Please be explicit about every small detail as I'm new to this!
Basically I am creating multiple grids with dynamic columns based on a set of configuration data so I have done everything in c# to create/build/bind grid. I have seen examples for creating data templates in xaml with button controsl within them, but cannot work out how to do this from c#.
Thanks.
Solved :-)
I use the Button.Click property when I create the button and set the tag as follows
Tag="{Binding}"
I can catch the value of the column defined by the Key.
Hope this helps anyone looking for a similar solution,
Mike
Hi Everyone,
I am looking to do a similar action. I was able to do it in XAML. I am having problems catching the event handler. Where is it supposed to fire from? Is there a delegate/event I need to set?
Thanks!
OK, thanks Steve
ColumnCommandBase is actually only supported on the HeaderRow level, not the DataRow level, which is why you have to use RowCommandBase.
If you want to use the same command, you can always pass in a flag to the parameter of the commandSource telling it where you are.
-SteveZ
Yes that would work, but I would rather use ColumnCommandBase instead of RowCommandBase- is that possible?