Getting error after adding RadDataFilter to RedGrid

2 posts, 0 answers
  1. Manoj
    Manoj avatar
    43 posts
    Member since:
    Aug 2011

    Posted 23 Aug 2011 Link to this post

    Getting error following error in  NotifyPropertyChanged.
    [Arg_TargetInvocationException]
    Arguments:
    Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=5.0.60401.00&File=mscorlib.dll&Key=Arg_TargetInvocationException


    My data source is :

    ObservableCollection

     

     

    <AuditAssignment> _auditAssignments;

    public

     

     

    ObservableCollection<AuditAssignment> AuditAssignments

     

    {

     

     

    get

     

    {

     

     

    return _auditAssignments;

     

    }

     

     

    set

     

    {

     

     

    if (_auditAssignments != value)

     

    {

    _auditAssignments =

     

    value;

     

     

     

    this.NotifyPropertyChanged("AuditAssignments");

     

    }

    }

    }

    XAML code:

     

     

     

     

     

     

    <

     

     

    telerik:RadDataFilter Name="radDataFilter"

     

     

     

    Grid.Row="1" Grid.ColumnSpan="5"

     

     

     

     

     

     

     

     

    MinHeight="193" MaxHeight="250" Width="700"

     

     

     

     

     

     

     

     

    Source="{Binding Items, ElementName=radGridView}"

     

     

     

     

     

     

     

     

    Margin="1" >

     

     

     

     

     

     

     

     

     

    <i:Interaction.Triggers>

     

     

     

     

     

     

     

     

     

    <i:EventTrigger EventName="Loaded">

     

     

     

     

     

     

     

     

     

    <ei:CallMethodAction MethodName="radDataFilter_Loaded" TargetObject="{Binding}" />

     

     

     

     

     

     

     

     

     

    </i:EventTrigger>

     

     

     

     

     

     

     

     

     

    </i:Interaction.Triggers>

     

     

     

     

     

     

     

     

     

    </telerik:RadDataFilter>

     

     

     

     

     

     

     

     

     

    <!--Red Grid-->

     

     

     

     

     

     

     

     

     

    <telerik:RadGridView x:Name="radGridView" Grid.Row="2" Grid.ColumnSpan="5"

     

     

     

     

     

     

     

     

    AutoGenerateColumns="False" ItemsSource="{Binding Path=AuditAssignments, Mode=OneWay}">

     

     

     

     

     

     

     

     

     

    <telerik:RadGridView.Columns>

     

     

     

     

     

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding CustomerID}"

     

     

     

     

     

     

     

     

    Header="Policy Number" UniqueName="Policy Number" IsGroupable="False" />

     

     

     

     

     

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding AssignmentStartDate}"

     

     

     

     

     

     

     

     

    Header="Assignment StartDate" UniqueName="AssignmentStartDate" IsGroupable="False" />

     

     

     

     

     

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding AssignmentEndDate}"

     

     

     

     

     

     

     

     

    Header="Assignment EndDate" UniqueName="AssignmentEndDate" IsGroupable="False" />

     

     

     

     

     

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding ClassCodesCount}"

     

     

     

     

     

     

     

     

    Header="Class Codes Count" UniqueName="ClassCodesCount" IsGroupable="False" />

     

     

     

     

     

     

     

     

     

    <telerik:GridViewDataColumn DataMemberBinding="{Binding MaxExMod}"

     

     

     

     

     

     

     

     

    Header="Max ExMod" UniqueName="MaxExMod" IsGroupable="False" />

     

     

     

     

     

     

     

     

     

    </telerik:RadGridView.Columns>

     

     

     

     

     

     

     

     

     

    </telerik:RadGridView>

     

     

     

     

    >

    For datafilter events written code in view model

     

    public

     

     

    void radDataFilter_Loaded(object sender, System.Windows.RoutedEventArgs e)

     

    {

     

     

    AuditTracking auditTracking = null;

     

     

     

    if(AuditTracking.SelectedView is AuditTracking)

     

    auditTracking =

     

    AuditTracking.SelectedView as AuditTracking;

     

     

     

    RadDataFilter dataFilter = auditTracking.radDataFilter;

     

     

     

     

    int count = dataFilter.FilterDescriptors.Count;

     

     

     

    int zero = 0;

     

     

     

    if (count == zero)

     

    {

     

     

    // String filter.

     

     

     

     

     

     

     

     

    FilterDescriptor nameFilter = new FilterDescriptor("CustomerID", FilterOperator.Contains, "1", true);

     

    dataFilter.FilterDescriptors.Add(nameFilter);

     

     

    // DateTime filter.

     

     

     

     

     

     

     

     

    FilterDescriptor dateFilter = new FilterDescriptor("AssignmentStartDate", FilterOperator.IsGreaterThan, new DateTime(2007, 5, 1));

     

    dataFilter.FilterDescriptors.Add(dateFilter);
    }


    Also please suggest way of getting filter control object in view model. I have done it by creating public property in View. That is not good way I know.

  2. Manoj
    Manoj avatar
    43 posts
    Member since:
    Aug 2011

    Posted 26 Aug 2011 Link to this post

    Never mind. I have resolved it.
  3. DevCraft banner
Back to Top