Hey,
I need to show filter drop down icon visible always in xamdatagrid((not only on hover/selected)). As user do not know he/she can do filtering until they hover or select.
So I am trying to set FilterCellEditorStyle in fieldsettings like below but i am facing this error. "'XamComboEditor' TargetType does not match type of element 'XamCheckEditor'." Can some one please let me know how i can resolve this and it should start working.
<Style x:Key="DropDownTest" TargetType="{x:Type igEditors:XamComboEditor}"><Setter Property="DropDownButtonDisplayMode" Value="Always" /></Style>
<igDP:XamDataGrid.FieldSettings><igDP:FieldSettings CellHeight="18" ExpandableFieldRecordHeaderDisplayMode="AlwaysDisplayHeader" AllowRecordFiltering="True" CellClickAction="SelectRecord"AutoSizeOptions="All" FilterCellEditorStyle="{StaticResource DropDownTest}" FilterClearButtonVisibility="Visible" FilterStringComparisonType="CaseInsensitive" ></igDP:FieldSettings></igDP:XamDataGrid.FieldSettings>
Please let me know as this is urgent or if any other way around to achieve this ?
Hello Saurabh,
Thank you for your post. I have been looking into it and I created a sample project for you following your scenario and everything seems to work ok on my side. If the sample doesn’t satisfies all your needs feel free to modify it, so it reproduces your behavior and send it back to me for further investigation.
Looking forward for your reply.
Hello Stefan,
I've verified your code and that is working because there is no bool type column in grid(XamCheckEditor). If you add a column type of bool then this code will throw an exception "'XamComboEditor' TargetType does not match type of element 'XamCheckEditor'..
Please have a look on the attachment
Stefan is not available today, so I am going to send you the code you requested.
Here is the code modified as Stefan suggested adding the FilterCellEditorStyle to each field instead of to the xamDataGrid’s FieldSettings. That way you can control which fields are affected.
Here is what your sample xaml would look like.
<Grid.Resources>
<Style x:Key="DropDownTest" TargetType="{x:Type igEditors:XamComboEditor}">
<Setter Property="DropDownButtonDisplayMode" Value="Always" />
</Style>
</Grid.Resources>
<igDP:XamDataGrid Name="xamDataGrid1" VerticalAlignment="Top">
<igDP:XamDataGrid.FieldSettings>
<igDP:FieldSettings
ExpandableFieldRecordHeaderDisplayMode="AlwaysDisplayHeader" AllowRecordFiltering="True"
CellClickAction="SelectRecord"
AutoSizeOptions="All"
FilterClearButtonVisibility="Visible" FilterStringComparisonType="CaseInsensitive" ></igDP:FieldSettings>
</igDP:XamDataGrid.FieldSettings>
<igDP:XamDataGrid.FieldLayouts>
<igDP:FieldLayout IsDefault="True">
<!-- TODO: You need to add all fileds to the root field layout in XAML-->
<igDP:Field Name="CategoryID" >
<igDP:Field.Settings >
<igDP:FieldSettings FilterCellEditorStyle="{StaticResource DropDownTest}" />
</igDP:Field.Settings>
</igDP:Field>
<igDP:Field Name="CategoryName" >
<igDP:Field Name="Description" />
</igDP:FieldLayout>
</igDP:XamDataGrid.FieldLayouts>
</igDP:XamDataGrid>
Let me know if you have any questions.
Hello Marianne,
My fields are auto generated. I set the datasource as i have more than 300 columns in my grid. So i can not declare each field and bind the fields in the way. If there is some other way then that should be great. Otherwise i think implementation for FilterCellEditorStyle must be change. If i am applying it to combo editor then it should apply on combo editor only.
If there is any other workaround then please let me know.
Thanks for you quick hint. I create one property and applied filtercelleditorstyle via converter and it's working fine.
Thanks
You are very welcome. Glad to be able to help you.
Hi Marrianne,
"Hello Marianne,
Thanks"
How exactly the above comment of the user solved the issue. I am facing the same issue.
Thanks, Nikhil