I am trying to create a custom ValueEditor called DoubleValueEditor, and then have a control associated with that type.
The control that will appear when editing starts is a button that fills the cell with the text "Double {CellValue}".
When clicking the button, it will double the value in the cell and set it in the cell, then end edit mode.
I can get the button to appear, but am unable to have the button show the original value in the cell, and then set the cell value to the doubled amount when clicked.
Is there a sample I can access that shows this?
Thanks
Hello,
I am not quite sure exactly what you want to display in the cell but if you only want the content of the button to change when clicked you can use a Converter on the Content property.
I have created a sample demonstrating this. It is based on this thread which provides more details on hosting controls in a XamDataGrid cell: http://es.infragistics.com/community/blogs/andrew_smith/archive/2009/03/27/hosting-wpf-controls-in-a-xamdatagrid-cell.aspx
Please let me know if you have any questions.
Sincerely,
Valerie
Developer Support Supervisor - XAML
Infragistics
www.infragistics.com/support
Here is what I am looking for:
Not in Edit Mode: The cell looks like a normal cell - with value 5
Edit Mode Started: The cell changes to a button that shows the text Double and the cells original value - Double 5
The user clicks on the button
Edit mode ends, cell returns to normal cell - but now the value is 10.
It is actually how to create the button control, and make it have access to the cell value - to read and write.
Also, the editor and edit template needs to be assigned dynamically when the XamDataGrid raises the EditModeStarting, and be removed when the EditModeEnded is raised