This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to bind an ObservableCollection to a RadGridView, but I don't see any rows in the GridView. I've read the documentation and seen the sample and can't figure out what could be wrong!
The sample is a simple sample
Here is the xaml:
I feel like I'm missing something really simple.
Thanks,
Ali
I'm trying to bind an ObservableCollection to a RadGridView, but I don't see any rows in the GridView. I've read the documentation and seen the sample and can't figure out what could be wrong!
The sample is a simple sample
public class SalesPerson
{
public string Name { get; set; }
public double SoldAmount { get; set; }
}
public partial class MainPage : UserControl
{
public ObservableCollection<
SalesPerson
> SalesPeople { get; set; }
public MainPage()
{
InitializeComponent();
SalesPeople = new ObservableCollection<
SalesPerson
>();
SalesPeople.Add(new SalesPerson() { Name = "Ali Rafiee", SoldAmount = 12.00 });
SalesPeople.Add(new SalesPerson() { Name = "Neda Rafiee", SoldAmount = 123.00 });
SalesPeople.Add(new SalesPerson() { Name = "Ryan Rafiee", SoldAmount = 1234.00 });
}
Here is the xaml:
<
telerik:RadGridView
Margin
=
"12,12,12,0"
ItemsSource
=
"{Binding SalesPeople}"
VerticalAlignment
=
"Top"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewDataColumn
Header
=
"Name"
DataMemberBinding
=
"{Binding Name}"
/>
<
telerik:GridViewDataColumn
Header
=
"Amount"
DataMemberBinding
=
"{Binding SoldAmount}"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
I feel like I'm missing something really simple.
Thanks,
Ali