Is it possible to set the text of a Textbox in code behind of a unbounded TemplateField ?
igEditors:TemplateEditor.Editor don't exist (Editor) and the textbox is readonly just for display a calculated information, i'm not in edition... in our case the xamDataGrid is used to display only our data. We have a column with a button to edit the current row in a new independant window (complex need). So all Template fields have a textbox binded to data, except 2 Template Fields with textbox that are calculated and i need to feed this textbox with a calculated data in code behind. Does it simply possible ? a textbox in a TemplateField cannot be accessed anywhere ?
Hello Stephane,
Is there a specific reason you are using a TemplateField and not an Unbound field? The following topic demonstrates how to wire up Fields with BindingType set as Unbound to present calculated data
https://www.infragistics.com/help/wpf/xamcalculationmanager-using-xamcalculationmanager-with-xamdatagrid
Let me know if this is more inline with what you are trying to achieve.
With a unbounded TextField i can display my calculated value, but we want to keep a similar appearance between all the columns and allow the copy / paste of text, that's why we try to use the TextBox in a TemplateField (unbound). In addition we would like to put the red border when the text is empty ...
For styling the XamDataGrid please refer to our online documentation and styling points. For marking an empty text with a red border you can do something like this with a trigger.
eg.
<Style TargetType="{x:Type ig:DataRecordCellArea}"> <Style.Triggers> <DataTrigger Value=""> <Setter Property="BorderBrush" Value="Red"/> <Setter Property="BorderHoverBrush" Value="Red"/> <Setter Property="BorderActiveBrush" Value="Red"/> <Setter Property="BorderSelectedBrush" Value="Red"/> <Setter Property="BorderThickness" Value="2"/> </DataTrigger> </Style.Triggers></Style>