This is a migrated thread and some comments may be shown as answers.

Reshaper and DataPager

1 Answer 81 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
Inger Marie
Top achievements
Rank 1
Inger Marie asked on 13 Aug 2015, 10:54 AM

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,

 

      

1 Answer, 1 is accepted

Sort by
0
Ivan Ivanov
Telerik team
answered on 18 Aug 2015, 10:55 AM
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
Tags
DataPager
Asked by
Inger Marie
Top achievements
Rank 1
Answers by
Ivan Ivanov
Telerik team
Share this question
or