Hello,
I need to show in a comboboxcolumn two properties of a complex object.
To achieve that I used the ValueConverter but it doesn't show me anything.
I attached a sample to show you how I do it.
Regards.
Hello Coso,
In the ComboBoxColumn set the SelectedValuePath and DisplayMemberPath properties.
Let me know if I can provide any further assistance.
Hello Duane,
I set the displamemberpath and selectedValuePath to property "Rue" but it doesn't work either.
Re hello Duane,
I changed the way to show the combobox by using a template column to have two different view (consulting and editing).
It solved my problem but now another appear, when I want to filter the filterselectioncontrol show me there's no data available.
I attached a sample to show you.
When using FilterSelectionControl a sample can be found on the following link on Changing UniqueValues Collection for custom filtering.
Thanks for the post I think I can achieve my goal with this but I need help.
I tried to change the sample to match with my case but there's some behavior that I can't reproduce :
- In this new version the Ok button is disabled if there's no item selected, which is the initial situation, is there an easy way to reproduce this behavior ?
- the text "No data available" is always visible, I find a way to hide it by adding items in the FilterItemCollection but it works only one time.
- the filter seems not to be applied when I click on Ok even if the AcceptChanges method is being called. Moreover if I check all the items I got a NullReferenceException (same behavior when clicking on the clear filters button).
- the search textbox is disabled.
Thanks for your help.
The Ok button by default sets the IsEnabled property from CanFilter that is disabled when unchecking Select All checkbox. E.g.:
<Button x:Name="AcceptButton" Margin="0,0,5,0" Width="73" Content="{TemplateBinding OKButtonText}" IsEnabled="{Binding Path=CanFilter, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}">
The "No data available" message uses a TextBlock element setting the Opacity to 0 that is defined from VisualState:
<VisualState x:Name="HideSelectionBoxWaterMark" > <Storyboard> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="ItemsBoxWatermark" Storyboard.TargetProperty="(UIElement.Opacity)"> <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/> </DoubleAnimationUsingKeyFrames> </Storyboard></VisualState>
In the AcceptChanges method possibly a condition to add a check for a null reference on RowsManager was missing:
RowsManager rm = cell.Row.Manager as RowsManager; if (rm == null){ return;}
if (rm == null){ return;}
The search textbox uses a FilterTextBoxWatermarked setting IsEnabled from the ItemSourceSet property value.
<igPrim:FilterTextBoxWatermarked Grid.Row="2" Grid.Column="1" Margin="8,7,6,1" HorizontalAlignment="Stretch" IsEnabled="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ItemSourceSet}" FilterSelectionControl="{Binding RelativeSource={RelativeSource TemplatedParent}}" />
Thank you for sharing your solution.
Sincerely,ValerieDeveloper Support Engineer Infragisticswww.infragistics.com/support
Hello Valerie,
Sorry for the late answer, I found a solution by adding a partial class with my data where I put a property that represent what I need.
With this I can use a TextColumn and filter it.
Do you have any other questions on this matter?
Valerie
Developer Support Engineer
Infragistics
www.infragistics.com/support
The issue is that the underlying value of the cell does not contain the full text that is populated during the display using the converter. Therefore when filtering, the filter is taking the value displayed in the listbox (ex Nom + Prenom) and trying to compare this to the partial value in the cell (ex Nom). Using MVVM the idea would be that your data is represented as it is maintain in your model and then the classes can be refactored in your ViewModel to support binding to the view. This would be your best and simplest approach to resolving this issue.
Please let me know if you have any questions.
Sincerely,
Thanks for your response. But I can't change my data representation, so I tried a last solution by taking one of yours (http://es.infragistics.com/community/forums/p/59382/301863.aspx#301863). It could be a solution for me but I have some troubles with it :
- The filters are not applied correctly,
- The ClearFilters button doesn't works,
- The empty data text appears some times,
- The select all checkbox behavior doesn't works.
What am I doing wrong ?