Reshaper and DataPager

2 posts, 0 answers
  1. Inger Marie
    Inger Marie avatar
    60 posts
    Member since:
    Nov 2010

    Posted 13 Aug 2015 Link to this post

    I have thisRadDataPager

     <telerik:RadDataPager x:Name="radDataPager" Grid.Row="1" Source="{Binding ItemCollection}" DockPanel.Dock="Bottom" PageSize="400" DisplayMode="First, Last, Next, Previous, Text" />

     I bind to it in the ItemsSource of a RadGridView:

      <Controls:RadGridView x:Name="_rgvAdSales"
                                  SelectedItem="{Binding Selected​Item, Mode=TwoWay}"
                                  ItemsSource="{Binding PagedSource, ElementName=radDataPager}"
                                  EnableRowVirtualization="False"
                                  AutoGenerateColumns="False"
                                  SelectionMode="Extended">...​

     

    My columns look like this:

           <Controls:GridViewDataColumn Header="Name" DataMemberBinding="{Binding ​Name}" IsReadOnly="True" />

     

    Resharper draws a lin​e under Name (the path of the binding in the column) and says this:

        Cannot resolve property 'Name' in data context of type 'Telerik.Windows.Data.IPagedCollectionView'

     

    I have tried to add d:DataContext, but I cannot get that to work.

     

     ​

    If I bind the ItemsSource of RadGridView directly to the ItemCollection on the ViewModel, then resharper does not give any warnings.

    Do you know of any good way (ie. not causing performance loss) to tell resharper the datatype of the ItemSource or datacontext of the column?


    Thanks,

     

          

  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 18 Aug 2015 Link to this post

    Hi Inger Marie,

    Can you please confirm whether it is a design-time only error? Do you have any similar binding errors at runtime? Generally, GridViewColumns are not visual elements and having DataContext is an inheritance consequence for deriving from FrameworkContentElement.
    Actually, the binding that is assigned as DataMemeberBinding should not be practically evaluated as it is not directly used. In the majority of scenarios, RadGridView uses member access expressions to emulate the assigned binding definition, since the .net expression engine is faster than the default WPF binding logic. 

    Regards,
    Ivan Ivanov
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top