Hi,
I have a grid that allows for the user to add new records located at the top. Two of the columns are titled "Description", "Type". For a new user they at first do not now that they can add text to the empty cells. Is it possible to have some Italic text that is kinda faded that reads "Add Description" or "Add Type" in the Add New Record Row? Kinda like you see in some forms on the web. Little visual clues for the user.
Thanks,
Bryan
Hello Bryan,
I have been looking into your requirement and have created a style for you which you can set to the specific Field’s Settings.EditorStyle property. The style uses a MultuDataTrigger to check if the Editro is actually in the AddNewRecord and if it’s Text property is empty and sets the NullText property along with some text decorations according to your requirement:
<Style TargetType="{x:Type igEditors:XamTextEditor}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions >
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=Self}, Path=Text}" Value="" />
<Condition Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:DataRecordPresenter}}, Path=IsAddRecord}" Value="True" />
</MultiDataTrigger.Conditions>
<MultiDataTrigger.Setters>
<Setter Property="NullText" Value="Add description" />
<Setter Property="FontStyle" Value="Italic" />
<Setter Property="Opacity" Value="0.4" />
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</Style>
Please let me know if this is what you were looking for and if I can further assist you on the matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Petar,
That works except all the empty cells at the add record tow all say the same thing. It it possible for the Description Column to have the text "Add description" and the Type Column to have the text "Add Type" wording.
Thanks
Hi Bryan,
I have created a sample project for you showing what I had in mind (Grid_all_editors.zip).
Hope this is what you needed. Let me know if you require any further clarification on the matter
What I did before I got your sample is just made multiple styles with different names then referenced them in the fieldsetting for each field.
I noticed in your example that you just added the EditorStyle in the Fieldsettings. Would both examples be the correct way of doing this?
Thanks a lot for your help.
Bryan,
There is really no difference when you run the two. They are both kind of the same and yes, they are both correct. The upside of your method is that you can reference one key to many Fields as in mine I wanted to visually illustrate which goes where so it would be easier to memorize
Best regards Petar
Just wondering, could this have been done using codebehind?
Usually everything done in xaml can be done in code, but I myself find it a lot more difficult especially when it comes to styling/retemplating ot binding and I usually end up using the XamlReader class to get me through.
Regards Petar.