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

RadGrid Content(data) not appearing during runtime.

1 Answer 91 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sang
Top achievements
Rank 1
Sang asked on 12 Nov 2010, 07:54 PM

Hi,

I have used RadControls for WPF, and created a RadWindow and a RadGrid view, and entered some sample data into the RadGrid as per the following code:

<telerik:RadWindow
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
        x:Class="WpfApplication6.MainWindow"
        HorizontalAlignment="Stretch" 
        VerticalAlignment="Stretch">
            <telerik:RadWindow.Resources>
                <XmlDataProvider x:Key="GridEntries" XPath="/Categories/Details">
                <x:XData>
                    <Categories>
                        <Details>
                            <Source>ABC</Source>
                            <Title>DEF</Title>
                            <Date>12/11/10</Date>
                            <Location></Location>
                            <Type></Type>
                            <Category></Category>
                            <Severity></Severity>
                            <ScenarioActivated></ScenarioActivated>
                            <Videowall></Videowall>
                        </Details>
                        <Details>
                            <Source>DEF</Source>
                            <Title>XYZ</Title>
                            <Date>22/05/10</Date>
                            <Location></Location>
                            <Type></Type>
                            <Category></Category>
                            <Severity></Severity>
                            <ScenarioActivated></ScenarioActivated>
                            <Videowall></Videowall>
                        </Details>
                        <Details>
                            <Source>PQR</Source>
                            <Title>XYZ</Title>
                            <Date>30/09/10</Date>
                            <Location></Location>
                            <Type></Type>
                            <Category></Category>
                            <Severity></Severity>
                            <ScenarioActivated></ScenarioActivated>
                            <Videowall></Videowall>
                        </Details>
                    </Categories>
            </x:XData>
        </XmlDataProvider>
    </telerik:RadWindow.Resources>
    <telerik:RadGridView 
        HorizontalAlignment="Center" 
        VerticalAlignment="Center" 
        Height="200" Width="876" AutoGenerateColumns="True"
        ItemsSource="{Binding Source={StaticResource GridEntries}}"/>
    </telerik:RadWindow>
The code is functioning fine during design time and the sample data i have written in the RadGrid is appearing during design time. but, when i run this XAML in Expression Blend, the RadWindow and radgrid appears, with no fields and no sample data in it. Just an empty Radgrid with no data appears in a radWindow. Please help me solve this problem i am facing. Thanx.

1 Answer, 1 is accepted

Sort by
0
Vanya Pavlova
Telerik team
answered on 18 Nov 2010, 08:18 AM
Hi Sang,

 
Looking at your code snippet I noticed that you did not specified an xmlns attribute that should be set to an empty string, as shown:

<Categories xmlns="">
                        <Details>
                            <Source>ABC</Source>
                            <Title>DEF</Title>
                            <Date>12/11/10</Date>
                            <Location></Location>
                            <Type></Type>
                            <Category></Category>
                            <Severity></Severity>
                            <ScenarioActivated></ScenarioActivated>
                            <Videowall></Videowall>
                        </Details>

 


And you will be able to see the data in RadGridView at runtime mantaining the same way you are setting its ItemsSource. You should do that if you want t be able to apply queries to a data island that is inline within the XAML file. 

All the best,
Vanya Pavlova
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
Sang
Top achievements
Rank 1
Answers by
Vanya Pavlova
Telerik team
Share this question
or