I set up update notifications for AllBills and it filters successfully.
private ICollectionView _allBillsCollection;
public ICollectionView AllBills
{
get { return _allBillsCollection; }
set { _allBillsCollection = value; SetValue(ref _allBillsCollection, value); }
}
Update
Xaml:
<Window.Resources>
<local:IndexToBoolConverter x:Key="IndexToBoolConverter"/>
<ObjectDataProvider x:Key="selectColumn" ObjectType="{x:Type local:SelectOptions}" />
<local:RadioButtonCheckedConverter x:Key="RadioButtonCheckedConverter" />
</Window.Resources>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
<RadioButton IsEnabled="{Binding ElementName=cmb2, Path=SelectedIndex, Converter={StaticResource IndexToBoolConverter}}"
IsChecked="{Binding SOptions.EnumProperty,Converter= {StaticResource RadioButtonCheckedConverter}, ConverterParameter={x:Static local:Options.BillNo}}"
VerticalAlignment="Bottom"
Margin="10,5,0,2"
Content="Invoice No."
Width="90"
Padding="5"
FontFamily="Candara"
FontSize="15"
Style="{StaticResource LeftRoundedRadioButtonStyle}"
x:Name="rb1"
GroupName="group1"
/>
<RadioButton IsEnabled="{Binding ElementName=cmb2, Path=SelectedIndex, Converter={StaticResource IndexToBoolConverter}}"
IsChecked="{Binding SOptions.EnumProperty,Converter= {StaticResource RadioButtonCheckedConverter}, ConverterParameter={x:Static local:Options.BillDt}}"
VerticalAlignment="Bottom"
Margin="0,5,0,2"
Content="Invoice Date"
Width="100"
Padding="5"
FontFamily="Candara"
FontSize="15"
Style="{StaticResource MyRadioButtonStyle}"
x:Name="rb2"
GroupName="group1"
/>
<RadioButton IsEnabled="{Binding ElementName=cmb2, Path=SelectedIndex, Converter={StaticResource IndexToBoolConverter}}"
IsChecked="{Binding SOptions.EnumProperty,Converter={StaticResource RadioButtonCheckedConverter}, ConverterParameter={x:Static local:Options.Amt}}"
VerticalAlignment="Bottom"
Margin="-5,5,10,2"
Content="Amount"
Width="120"
Padding="5"
FontFamily="Candara"
FontSize="15"
Style="{StaticResource RightRoundedRadioButtonStyle}"
x:Name="rb3"
GroupName="group1"
/>
</StackPanel>
<TextBox IsEnabled="{Binding ElementName=cmb2, Path=SelectedIndex, Converter={StaticResource IndexToBoolConverter}}"
Text="{Binding FilterString,Mode=TwoWay,UpdateSourceTrigger=LostFocus }" x:Name="txt" />
Codebehind:
public class SelectOptions
{
public Options EnumProperty { get; set; }
public bool BooleanProperty { get; set; }
}
public enum Options
{
BillNo ,
BillDt,
Amt
}
public class RadioButtonCheckedConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
return value.Equals(parameter);
}
public object ConvertBack(object value, Type targetType, object parameter,
System.Globalization.CultureInfo culture)
{
return value.Equals(true) ? parameter : Binding.DoNothing;
}
}
ViewModel:
215998-7.txt
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.