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

Unbound Datagrid error

5 Answers 158 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Lars Berg
Top achievements
Rank 1
Lars Berg asked on 01 Aug 2008, 02:34 PM
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:
        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?





5 Answers, 1 is accepted

Sort by
0
Milan
Telerik team
answered on 04 Aug 2008, 12:06 PM
Hi Lars Berg,

You are not doing anything wrong but currently the RadGridView control does not support unbound mode and the only way to feed data into the grid is to use its ItemsSource property. That feature could not make it in the official release. Luckily we don't have much work left to implement the feature, and we will ship it with a future service pack release.

Kind regards,
Milan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Brian Matuska
Top achievements
Rank 1
answered on 18 Jun 2009, 11:11 PM
Hello,

Does RadGridView now support unbound mode?
0
Milan
Telerik team
answered on 23 Jun 2009, 06:17 PM
Hello Brian Matuska,

Unfortunately this mode is still unsupported. Is this feature a must-have for your scenario?

All the best,
Milan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
David Cecil
Top achievements
Rank 1
answered on 03 Apr 2010, 02:06 AM
With the Q1 2010 release will the grid support unbound data?  If not, do you still plan on adding this at a later date?
0
Rossen Hristov
Telerik team
answered on 05 Apr 2010, 02:09 PM
Hello David Cecil,

You can add items to the Items property of the grid. I have attached a sample project. I hope this helps.

Kind regards,
Ross
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Lars Berg
Top achievements
Rank 1
Answers by
Milan
Telerik team
Brian Matuska
Top achievements
Rank 1
David Cecil
Top achievements
Rank 1
Rossen Hristov
Telerik team
Share this question
or