I'm a bid fed up with WPF databounding and is trying out the non-databound road :)
Probably me thats doing something wrong, But I get this error:
"Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead."
I modified your FirstLook example by adding this method to the codebehind:
And removing the DataContext and ItemSource setters in the XAML file:
Why isn't this working - I'm not using ItemsSource?
Probably me thats doing something wrong, But I get this error:
"Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead."
I modified your FirstLook example by adding this method to the codebehind:
| private void LB() |
| { |
| System.Data.DataTable dv = ExamplesDB.GetCustomers(); |
| foreach (System.Data.DataRow dr in dv.Rows) |
| { |
| radGridViewFirstLook.Items.Add(dr); |
| } |
| } |
And removing the DataContext and ItemSource setters in the XAML file:
| <QuickStart:ExampleControl x:Class="Telerik.Windows.Examples.GridView.FirstLook.Example" |
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| xmlns:QuickStart="clr-namespace:Telerik.Windows.QuickStart;assembly=Telerik.Windows.QuickStart" |
| xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" |
| xmlns:e="clr-namespace:Telerik.Windows.Examples"> |
| <Grid> |
| <telerik:RadGridView Name="radGridViewFirstLook" ColumnsWidthMode="Fill" AutoGenerateColumns="False" Margin="0,0,-1,0"> |
| <telerik:RadGridView.Columns> |
| <telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="Customer ID" UniqueName="CustomerID" /> |
| <telerik:GridViewDataColumn Width="100" DataType="{x:Null}" HeaderText="Company Name" UniqueName="CompanyName" /> |
| <telerik:GridViewDataColumn Width="100" DataType="{x:Null}" HeaderText="Country" UniqueName="Country" /> |
| <telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="City" UniqueName="City" /> |
| <telerik:GridViewDataColumn Width="100" DataType="{x:Null}" HeaderText="Contact Name" UniqueName="ContactName" /> |
| <telerik:GridViewDataColumn Width="100" DataType="{x:Null}" HeaderText="Bool" UniqueName="Bool" /> |
| </telerik:RadGridView.Columns> |
| </telerik:RadGridView> |
| <telerik:RadPanelBar Height="6" Margin="232,0,284,-330" Name="radPanelBar1" VerticalAlignment="Bottom" /> |
| </Grid> |
| </QuickStart:ExampleControl> |
Why isn't this working - I'm not using ItemsSource?