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!