Hi everyone, I'm newbie when it comes to WPF so i have some - maybe too basic question, but still.
I have a question on how to populate specific columns in radgrid view with columns in List that i got from my orm model.
For example - this is my code behind to set datacontext of a grid view P.S. I would like to put that into resources:
if I set ItemsSource="{Binding ElementName=myPage,Path=myList}" , i get populated all the columns, but i only want specific ones...so i tried somethink like that:
But I cannot get it to work...
Thank you in advance for the reply and help.
I have a question on how to populate specific columns in radgrid view with columns in List that i got from my orm model.
For example - this is my code behind to set datacontext of a grid view P.S. I would like to put that into resources:
public partial class MyClass : Page
{
public List<
MyTable
> myList { get; set; }
public Drzava()
{
using (MyModel dbContext = new MyModel())
{
myList = dbContext.MyTable.ToList();
}
InitializeComponent();
myGridView.DataContext = myList;
}
}
if I set ItemsSource="{Binding ElementName=myPage,Path=myList}" , i get populated all the columns, but i only want specific ones...so i tried somethink like that:
<
telerik:RadGridView
Name
=
"myGridView"
Margin
=
"12,65,12,12"
ItemsSource
=
"{Binding ElementName=myPage,Path=myList}"
AutoGenerateColumns
=
"False"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewColumn
DataContext
=
"{Binding Path=Id}"
></
telerik:GridViewColumn
>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
Thank you in advance for the reply and help.