I have a problem using InformationLayer.GetItemsInLocation(Location);
My InformationLayer is binded to an ObservableCollection<MyClass> myObjektCollection
<Map:InformationLayer Name="myObjektLayer" ItemsSource="{Binding myObjektCollection }" ItemTemplate="{StaticResource informationLayerFlyttObjektTemplate}" Visibility="Visible" />
While adding MyClass items to myObjektCollection , I can see that both InformationLayer(myObjektLayer) and myObjektCollection increases.
If I ,just after adding a new MyClass item to myObjektCollection, try to call
InformationLayer(myObjektLayer).GetItemsInLocation(myLocation); returns no items found.
If I later, after refreshing the map call the same method InformationLayer(myObjektLayer).GetItemsInLocation(myLocation); returns with expected items.
I know that myLocation is valid.
Ex.
myObjektItemCollection.Add(myClass);
InformationLayer(myObjektLayer).GetItemsInLocation(myLocation) - No result
In method MapMoved()
InformationLayer(myObjektLayer).GetItemsInLocation(myLocation) - OK result
Is there any method I should call on InformationLayer or Observablecollection before I call InformationLayer(myObjektLayer).GetItemsInLocation(myLocation)?
I tried:
InformationLayer(myObjektLayer).BeginInit();
myObjektItemCollection.Add(myClass);
InformationLayer(myObjektLayer).EndInit();
InformationLayer(myObjektLayer).GetItemsInLocation(myLocation)? No result
RadGridView1.CurrentCell.Value =
"sometext"
;
<
telerik:RadGridView
x:Name
=
"RadGridView1"
ItemsSource
=
"{Binding Items}"
Margin
=
"0"
RowIndicatorVisibility
=
"Collapsed"
IsReadOnly
=
"True"
AutoGenerateColumns
=
"False"
CanUserFreezeColumns
=
"False"
CanUserResizeColumns
=
"True"
MouseDoubleClick
=
"RadGridView1_MouseDoubleClick"
IsFilteringAllowed
=
"True"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Name"
DataMemberBinding
=
"{Binding BusinessItem.Name}"
Width
=
"*"
/>
...
Hi there,
I am currently evaluating your RadGridView and I must say that I'm quite surprised. Your RadGridView control is easy and straight forward to use compare to other bigger brands in the market. It's very unfortunate that I had wasted several weeks evaluating other grid controls.
I'm currently having a problem with MultipleSelect when it's set to True. Please have a look at the following sample,
XAML code:
<Window x:Class="WpfApplication1.Window1" |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
Title="Window1" Height="412" Width="447" |
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
xmlns:WpfApplication1="clr-namespace:WpfApplication1"> |
<Window.Resources> |
<ObjectDataProvider x:Key="viewModel" ObjectType="{x:Type WpfApplication1:CustomerViewModel}" /> |
</Window.Resources> |
<Grid> |
<telerik:RadGridView Name="uxdGrid" AutoGenerateColumns="False" |
ItemsSource="{Binding Source={StaticResource viewModel}, Path=CustomersList}"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="Customer Id" UniqueName="CustomerId" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</Grid> |
</Window> |
Code behind:
using System.Collections.Generic; |
using System.ComponentModel; |
using System.Windows; |
using System.Windows.Data; |
namespace WpfApplication1 |
{ |
/// <summary> |
/// Interaction logic for Window1.xaml |
/// </summary> |
public partial class Window1 : Window |
{ |
public Window1() |
{ |
InitializeComponent(); |
} |
} |
public class CustomerViewModel |
{ |
public CustomerViewModel() |
{ |
List<Customer> customers = new List<Customer>(); |
for (int i = 0; i < 10; i++) |
{ |
Customer customer = new Customer(); |
customer.CustomerId = i; |
customer.CustomerName = string.Format("Name {0}", i); |
customers.Add(customer); |
} |
_view = new ListCollectionView(customers); |
} |
private readonly ListCollectionView _view; |
public ListCollectionView CustomersList |
{ |
get |
{ |
return _view; |
} |
} |
} |
public class Customer : INotifyPropertyChanged |
{ |
private int _customerId; |
private string _customerName = string.Empty; |
public int CustomerId |
{ |
get |
{ |
return _customerId; |
} |
set |
{ |
_customerId = value; |
SendPropertyChanged("CustomerId"); |
} |
} |
public string CustomerName |
{ |
get |
{ |
return _customerName; |
} |
set |
{ |
_customerName = value; |
SendPropertyChanged("CustomerName"); |
} |
} |
private event PropertyChangedEventHandler _propertyChanged; |
public event PropertyChangedEventHandler PropertyChanged |
{ |
add |
{ |
_propertyChanged += value; |
} |
remove |
{ |
_propertyChanged -= value; |
} |
} |
/// <summary> |
/// Raises the property changed event. |
/// </summary> |
/// <param name="propertyName">The property name which value has been changed</param> |
protected void SendPropertyChanged(string propertyName) |
{ |
if (_propertyChanged != null) |
{ |
_propertyChanged(this, new PropertyChangedEventArgs(propertyName)); |
} |
} |
} |
} |
<Grid> |
<telerik:RadGridView Name="uxdGrid" AutoGenerateColumns="False" MultipleSelect="True" |
ItemsSource="{Binding Source={StaticResource viewModel}, Path=CustomersList}"> |
<telerik:RadGridView.Columns> |
<telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="Customer Id" UniqueName="CustomerId" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
</Grid> |
<
telerik:RadGridView
Name
=
"PeopleGrid"
Width
=
"{Binding ElementName=theRootElement, Path=ActualWidth}"
ItemsSource
=
"{Binding Source={StaticResource people}, Path=People}"
IsReadOnly
=
"True"
EditTriggers
=
"None"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewToggleRowDetailsColumn
ExpandMode
=
"Single"
/>
<
telerik:GridViewDataColumn
Header
=
"First Name"
DataMemberBinding
=
"{Binding FirstName}"
/>
<
telerik:GridViewDataColumn
Header
=
"Last Name"
DataMemberBinding
=
"{Binding LastName}"
/>
<
telerik:GridViewDataColumn
Header
=
"Age"
DataMemberBinding
=
"{Binding Age}"
/>
<
telerik:GridViewDataColumn
Header
=
"Marital Status"
DataMemberBinding
=
"{Binding MaritalStatus}"
/>
<
telerik:GridViewDataColumn
Width
=
"*"
>
<
telerik:GridViewDataColumn.CellStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"Template"
>
<
Setter.Value
>
<
ControlTemplate
>
<
StackPanel
Orientation
=
"Horizontal"
HorizontalAlignment
=
"Right"
>
<
Button
x:Name
=
"btn_EditPerson"
ToolTip
=
"Edit"
>
Edit
</
Button
>
<
Button
ToolTip
=
"Delete"
Command
=
"{Binding Source={StaticResource people}, Path=DeletePerson}"
CommandParameter
=
"{Binding .}"
>
Delete
</
Button
>
</
StackPanel
>
</
ControlTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
</
telerik:GridViewDataColumn.CellStyle
>
</
telerik:GridViewDataColumn
>
</
telerik:RadGridView.Columns
>
<
telerik:RadGridView.RowDetailsTemplate
>
<
DataTemplate
>
<!-- Additional Controls to Display Additional Info...has no affect on problem if I comment this part out -->
</
DataTemplate
>
</
telerik:RadGridView.RowDetailsTemplate
>
</
telerik:RadGridView
>