Hi.
I would like another help again
According to binding item source procedure what I have been looking in your Telerik's demo. For example, it should be some kind like....
=============================================================
1. Create class that contains properties with {get; set;}. No. of properties/fields should be depend on which fields we want to bind
such as...
public class Employee
{
public string Id {get; set;}
public string Name {get; set;}
public string Position {get; set;}
}
2. Create the collection such as List<>,ObservableCollection<> that will contain the item in each field such as...
ObservableCollection<Employee> empList = new ObservableCollection<Employee> ();
empList.Add(new Employee(){Id = '1', Name ='AAA', Position = 'A1A1'});
empList.Add(new Employee(){Id = '2', Name ='BBB', Position = 'B1B1'});
3. Set the item source with that collection for the RadGridView and the directly set binding to each field for display columns such as...
(I set the itemsource in the code behind)
<telerik:RadGridView x:Name="RadGridView1">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}" />
<telerik:GridViewDataColumn Header="Employee Name" DataMemberBinding="{Binding Name}" />
<telerik:GridViewDataColumn Header="Position" DataMemberBinding="{Binding Position}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
======================================================================================
Right??
Then the question is, if I want other RadGridViews that display some columns which might be somewhat (or entirely) different from first RadGridView (For example, create another GridView that also display Employee data similarly to the first one but with additional column called "Department", then another GridView but at this time with the column called "Address"). In order to create such an item source with the class, do I need to create another class with some different field again and again?
At this time, what I have done is create class with all fields that some columns might be appeared in every grid but some columns might not be appeared in some grid, create collection with data adding to specified field for each grid then binding that grid with specific field.
Is there anyway better than what I'm doing to create item source by just creating only one class or other methods that can create List<> or ObservableCollection<> with dynamically field?
If you don't understand what I'm trying to say please let me know.
Thanks
I would like another help again
According to binding item source procedure what I have been looking in your Telerik's demo. For example, it should be some kind like....
=============================================================
1. Create class that contains properties with {get; set;}. No. of properties/fields should be depend on which fields we want to bind
such as...
public class Employee
{
public string Id {get; set;}
public string Name {get; set;}
public string Position {get; set;}
}
2. Create the collection such as List<>,ObservableCollection<> that will contain the item in each field such as...
ObservableCollection<Employee> empList = new ObservableCollection<Employee> ();
empList.Add(new Employee(){Id = '1', Name ='AAA', Position = 'A1A1'});
empList.Add(new Employee(){Id = '2', Name ='BBB', Position = 'B1B1'});
3. Set the item source with that collection for the RadGridView and the directly set binding to each field for display columns such as...
(I set the itemsource in the code behind)
<telerik:RadGridView x:Name="RadGridView1">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Header="ID" DataMemberBinding="{Binding ID}" />
<telerik:GridViewDataColumn Header="Employee Name" DataMemberBinding="{Binding Name}" />
<telerik:GridViewDataColumn Header="Position" DataMemberBinding="{Binding Position}" />
</telerik:RadGridView.Columns>
</telerik:RadGridView>
======================================================================================
Right??
Then the question is, if I want other RadGridViews that display some columns which might be somewhat (or entirely) different from first RadGridView (For example, create another GridView that also display Employee data similarly to the first one but with additional column called "Department", then another GridView but at this time with the column called "Address"). In order to create such an item source with the class, do I need to create another class with some different field again and again?
At this time, what I have done is create class with all fields that some columns might be appeared in every grid but some columns might not be appeared in some grid, create collection with data adding to specified field for each grid then binding that grid with specific field.
Is there anyway better than what I'm doing to create item source by just creating only one class or other methods that can create List<> or ObservableCollection<> with dynamically field?
If you don't understand what I'm trying to say please let me know.
Thanks