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

Gridview Databinding

1 Answer 20 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Abhishek Gairola
Top achievements
Rank 1
Abhishek Gairola asked on 05 Apr 2010, 12:36 PM
Hello guys,

I am using Version 3
I am starting to know the Databinding feature in a grid view.

I have a class AutoInputFiles in the namespace IPProxy and an observable collection of type<AutoInputFiles >

ObservableCollection

 

<IPProxy.AutoInputFiles> listAutoInputFiles = new ObservableCollection<IPProxy.AutoInputFiles>();

 


public

 

ObservableCollection<IPProxy.AutoInputFiles> ListAutoInputFiles

 

{

 

    get

 

    {

 

        return listAutoInputFiles;

 

    }

 

    set

 

    {

        listAutoInputFiles =

value;

 

    }

}


I have bound my grid to this collection

 

 

<

 

telerikGrid:RadGridView x:Name="rgvAIPInputFiles" ItemsSource="{Binding ListAutoInputFiles}" AutoGenerateColumns="False" >

 

 

 

    <telerikGrid:RadGridView.Columns>

 

 

 

        <telerikGrid:GridViewDataColumn Header="First Name" DataMemberBinding="{Binding ClientName}" />

 

 

 

    </telerikGrid:RadGridView.Columns>

 

 

 

</telerikGrid:RadGridView>

 

 

 

 

 

When I get response from the server I update my collection

public

 

void GetAutoInputFilesCompleted(object sender, GetAutoInputFilesEventArgs e)

 

{

    ListAutoInputFiles = e.Result;

 

    //rgvAIPInputFiles.ItemsSource = e.Result;

 

}


√ín page Initialization i set the datacontext 

this

 

.DataContext = ListAutoInputFiles;

 


I am not able to view any date in the grid.
If I directly set the datasource like 

rgvAIPInputFiles.ItemsSource = e.Result;

this works, however ListAutoInputFiles = e.Result; doesn't work

Can anyone help me with a small example on databinding or anything which I lack in the abovementioned code.

Thank you!



1 Answer, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Apr 2010, 07:30 AM
Hi Abhishek,

You need to implement INotifyPropertyChanged and raise PropertyChange for this property if you want ItemsSource={Binding ...} to catch this.

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