Hi ,
I have copied my code below.
1. I want to set the maximum length of allowed characters in "Plan Name" field.
2. Plan Assets $ Million is displaying dollar sign. Please tell me how to correct it. whenever there is a decimal field is there in db , the front end is displaying the fields with '$'.
My XAML file code is below : <igGrid:XamDataGrid.FieldLayoutSettings><igGrid:FieldLayoutSettings AutoGenerateFields="False" SelectionTypeRecord="Single" ></igGrid:FieldLayoutSettings></igGrid:XamDataGrid.FieldLayoutSettings><igGrid:XamDataGrid.FieldLayouts><igGrid:FieldLayout ><igGrid:FieldLayout.Fields><igGrid:Field Name="PsPlanId" Label="Plan ID" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="True" AllowGroupBy="True" CellWidth="50" EditAsType="{x:Type System:String}"/> </igGrid:Field.Settings> </igGrid:Field><igGrid:Field Name="PlanName" Label="Plan Name"> <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="True" AllowGroupBy="True" CellWidth="20"/> </igGrid:Field.Settings></igGrid:Field> <igGrid:Field Name="Ein" Label="EmployerID" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="True" AllowGroupBy="True" CellWidth="20" EditAsType="{x:Type System:Int32}" /> </igGrid:Field.Settings></igGrid:Field>
<igGrid:Field Name="PlanTypeId" Label="Type of Plan" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="False" AllowGroupBy="True" CellWidth="20" CellValuePresenterStyle="{StaticResource ComboInPlanTypeStyle}"/> </igGrid:Field.Settings></igGrid:Field>
<igGrid:Field Name="DcAttributeTypeId" Label="DC Attribute" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="False" AllowGroupBy="True" CellWidth="20" CellValuePresenterStyle="{StaticResource buttonInCellStyle}"/> </igGrid:Field.Settings></igGrid:Field>
<igGrid:Field Name="IsDirectedPlan" Label="Directed Plan" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="False" AllowGroupBy="True" CellWidth="20" CellValuePresenterStyle="{StaticResource ComboInDirectedPlanTypeStyle}"/> </igGrid:Field.Settings></igGrid:Field>
<igGrid:Field Name="IsEsopPlan" Label="ESOP Plan" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="False" AllowGroupBy="True" CellWidth="20" CellValuePresenterStyle="{StaticResource ComboInDirectedPlanTypeStyle}"/> </igGrid:Field.Settings></igGrid:Field>
<igGrid:Field Name="ParticipantCount" Label="No of Participants" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="true" AllowGroupBy="True" CellWidth="20" EditAsType="{x:Type System:Int32}" /> </igGrid:Field.Settings></igGrid:Field>
<igGrid:Field Name="PlanAssets" Label="Plan Assets $ Million" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="true" AllowGroupBy="True" CellWidth="20" CellValuePresenterStyle="{StaticResource PlanAssetsCellvalue}" /> </igGrid:Field.Settings></igGrid:Field>
<igGrid:Field Name="ModifyDate" Label="Last Updated Date" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="true" AllowGroupBy="True" CellWidth="20" /> </igGrid:Field.Settings></igGrid:Field><igGrid:Field Name="ModifyUser" Label="Last Updated By" > <igGrid:Field.Settings> <igGrid:FieldSettings AllowEdit="true" AllowGroupBy="True" CellWidth="20" /> </igGrid:Field.Settings> </igGrid:Field></igGrid:FieldLayout.Fields></igGrid:FieldLayout></igGrid:XamDataGrid.FieldLayouts>
</igGrid:XamDataGrid>
Hello,
1) You can create a style for the XamTextEditor and use ValueConstraint property. You can read more about this in the following article in our help here.
2) This is because, the default editor for Decimal value is the XamCurrencyEditor. If you do not want the currency sign, you should use XamNumericEditor, register another editor for currency value type.
You can see how to do this, on the thread below:
http://forums.infragistics.com/forums/p/24455/89594.aspx#89594
Regards,
Alex.
Hi Alex,
I checked the link http://forums.infragistics.com/forums/p/24455/89594.aspx#89594 for fixing $ sign problem for decimal fields. Can you please tell me how to register the control. I saw one method and three parameters for that. I am confused . I dont knbow how to change the default currency editor to numeric editor. Can you please explain it more clearly and if possible few lines of code to do that.
Alex,
I want to display 10 blank rows when the grod is loaded. How to do that?
About the ValueEditor.
You have two options - you can set it directly in the Field, if you have defined your fields in the xaml like this:
<igDP:FieldLayout>
<igDP:FieldLayout.Fields>
<igDP:Field Name="Double Field" Label="Double Field">
<igDP:Field.Settings>
<igDP:FieldSettings ..
In the FieldSettins, you can set the following properties:
- EditAsType - the desired type
- EditorStyle - create a style for the desired Editor
- EditorType - set the type of the desired Editor
You can also use the static method I mentioned like this: (for example for value type Double, I will register a XamCurrencyEditor. The default for double is XamNumericEditor).
ValueEditor.RegisterDefaultEditorForType(typeof(double), typeof(XamCurrencyEditor), true);
Regarding the 10 blank records, it depends on what your datasource is. If you are binding to a collection, just add 10 object of your underlying class and bind to that collection. If you bind to a DataSet, you can add 10 DataRows in the table.
Hope this helps,