Hi I have a problem with the CellControlAttached event. The problem is that this event doesn't fire with a column template that I have created. Can anybody provide an example on how to use this event?
Thank you in advance
Is your TemplateColumn bound or unbound? There was an issue identified with The CellControlAttached not being raised for unbound TemplateColumn cells. Is this your case?
The template column is bound, but the event don't fired.
If you want I send you an example ?
Thanks
Hi,
So, what Darrell meant when he asked you if your TemplateColumn was bound or unbound, he was referring to whether or not the key of the column was associated with a property on your object.
For example:
If we had a class called Person, which had a property called Name.
A bound TemplateColumn would be:<iggrid:TemplateColumn Key="Name"/>
an unbound TemplateColumn would be:
<iggrid:TemplateColumn Key="foo"/>
The bug was that the event wouldn't be raised in the second case. If your key was associated with a property, such as in the first case, the event does work. This bug has been fixed and will be in the next Service Release.
-SteveZ
Can you suggest a hack to get round this whilst we all wait patiently for the next service release?
Myles
Hi Myles,
What are you trying to use the event for?
I generally recommend that instead of using that event, unless for Conditional styles, that you used a ValueConverter for the binding, which you're using.
Ah, ok.
Currently there isn't another way to achieve this until the SR comes out. However, it should be released within the next week or so.
Ok thanks Stephen, I think I did not say all !
We have the datatemplate inside a resourse dictionaty that is in a silverlight class library in another pakage.
We have added the reference to this class library and the using to our main page but we cannot catch the button click event anyhow. Actually we are able to do it with the cell clicked event but is not what we want because the event is raised everytime we click on a cell.
Thank you again for your support.
Hi Sergio,
You can attach the event in the DataTemplate.
<DataTemplate>
<Button Click="MyButton_Clicked"/>
</DataTemplate>
Is there another event apart the cellattached event , that allows to access the cell content, after the xamwebgrid data have been loaded? We have a button inside the cell in a column template bound at run time. We are trying to catch the button click event but we could not so far.
Thank you for your attention.
Sergio