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

Problem with Data Binding To RadGridView WPF

4 Answers 85 Views
GridView
This is a migrated thread and some comments may be shown as answers.
EMRE ANDIC
Top achievements
Rank 1
EMRE ANDIC asked on 01 Dec 2010, 05:24 PM
Hi,
I have a WPF application. In a xaml, I have a RadGridView inside of a RadTileViewItem, and when I am trying to Bind some data to the RadGridView, it brings me rows with no datas.

Can you please help me.
Thanks.

4 Answers, 1 is accepted

Sort by
0
Yordanka
Telerik team
answered on 02 Dec 2010, 09:16 AM
Hi EMRE ANDIC,

We tried to reproduce your problem but to no avail. Please, check the attached sample project and let us know if you manage to reproduce it.
 
All the best,
Yordanka
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
EMRE ANDIC
Top achievements
Rank 1
answered on 02 Dec 2010, 10:41 AM
Hi Yordanka,
An example of  Xaml code is below,
 
            </telerik:RadTileViewItem>
            <telerik:RadTileViewItem Header="Bekleyenler Listesi" TileState="Maximized" FontWeight="Bold">
           
                    <telerik:RadGridView x:Name="GrdVwBekleyenler" ItemsSource="{Binding WTLQueue}" AutoGenerateColumns="False">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding ARAC_KODU}"  />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding DURUMU}"  />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding SIPARIS_NO}"  />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding SIRA_GRUBU}"  />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding DOLUM_TARIHI}" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding DRIVER_ID}" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding DRIVER_NAME}" />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding CARD_ID}"  />
                            <telerik:GridViewDataColumn DataMemberBinding="{Binding GRUP_KODU}" />
                        </telerik:RadGridView.Columns>

                    <telerik:RadContextMenu.ContextMenu>
                        <telerik:RadContextMenu x:Name="RdCntxtMenu">
                            <telerik:RadMenuItem x:Name="RmiCagrilanlaraAta" Header="Sürücüyü Çağrılanlara Ata" Click="RmiCagrilanlaraAta_Click" />
                            <telerik:RadMenuItem IsSeparator="True" />
                            <telerik:RadMenuItem Header="Vazgeç" />
                            <!--<telerik:RadMenuItem Header="Delete" />
                            <telerik:RadMenuItem IsSeparator="True" />
                            <telerik:RadMenuItem Header="Select" />-->
                        </telerik:RadContextMenu>
                    </telerik:RadContextMenu.ContextMenu>
                </telerik:RadGridView>
            </telerik:RadTileViewItem>

WTLQueue is my Queue list, and I am binding to my RadGridView.

 As a plus, your code has,
    <Window.Resources>
        <my:MyViewModel x:Key="MyViewModel"/>
    </Window.Resources>
    <Grid DataContext="{StaticResource MyViewModel}">   

In addition to this, there is an interesting event, when my application is run, it shows me empty lines, but it is obvious that, there is a data(I understand with its row color), but it does not show to me, and when I double click to RadTileViewItem(to change position) or  window(to maximize), it shows me my datas. Shortly, it is waiting for my click action to show records.

Also, before double click actions, my RadGridView's   IsLoaded property is false, after double click, it changes its situation to true.

I found that with TileStateChanged event handler
private void RadTileViewItem_TileStateChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
{
   bool b = MyGridView.IsLoaded;
}


Thanks.
0
Yordanka
Telerik team
answered on 02 Dec 2010, 03:59 PM
Hi EMRE ANDIC,

Could you send us a sample project that reproduces the problem ? To do this you need to open a support ticket. Thank you.

Greetings,
Yordanka
the Telerik team
Browse the videos here>> to help you get started with RadControls for WPF
0
EMRE ANDIC
Top achievements
Rank 1
answered on 03 Dec 2010, 09:33 AM
Hi Yordanka,
I created a new WPF project, and carried my objects to the new project, and it is working fine.

Thank you for your help.
Tags
GridView
Asked by
EMRE ANDIC
Top achievements
Rank 1
Answers by
Yordanka
Telerik team
EMRE ANDIC
Top achievements
Rank 1
Share this question
or