Hello,
I'm using two cascading ComboBoxColumns in my grid
I've followed this thread to achieve same cascading logic with comboboxes, but with LINQ to SQL Datasource - no luck
This is the part where I got stuck, I've created an extra field AvailablePersons, but I can't get selected ID from first ComboBoxColumn:
Thank You for any help
I'm using two cascading ComboBoxColumns in my grid
<
telerik:RadGridView
x:Name
=
"RadGridView1"
ItemsSource
=
"{Binding Assigns}"
>
<
telerik:RadGridView.Columns
>
<
telerik:GridViewComboBoxColumn
Header
=
"Client"
ItemsSource
=
"{Binding}"
DataMemberBinding
=
"{Binding ClientID}"
DisplayMemberPath
=
"Name"
SelectedValueMemberPath
=
"ID"
/>
<
telerik:GridViewComboBoxColumn
Header
=
"Personalist"
ItemsSourceBinding
=
"{Binding AvailablePersons}"
DataMemberBinding
=
"{Binding PersonID}"
DisplayMemberPath
=
"Name"
SelectedValueMemberPath
=
"ID"
/>
</
telerik:RadGridView.Columns
>
</
telerik:RadGridView
>
I've followed this thread to achieve same cascading logic with comboboxes, but with LINQ to SQL Datasource - no luck
DataClassesDataContext db = new DataClassesDataContext();
((GridViewComboBoxColumn)this.RadGridView1.Columns[0]).ItemsSource = db.Clients;
this.AddHandler(RadComboBox.SelectionChangedEvent, new SelectionChangedEventHandler(comboSelectionChanged));
private void comboSelectionChanged(object sender, SelectionChangedEventArgs e)
{
RadComboBox comboBox = (RadComboBox)e.OriginalSource;
if (comboBox.SelectedValue == null
|| comboBox.SelectedItem.GetType() != typeof(Client))
return;
Assign assign= comboBox.DataContext as Assign;
assign.ClientID = (int)comboBox.SelectedValue;
}
This is the part where I got stuck, I've created an extra field AvailablePersons, but I can't get selected ID from first ComboBoxColumn:
public IEnumerable<
Person
> AvailablePersons
{
get
{
return from p in db.Persons
where p.ClientID == this.ClientID //???????????????????????????
select p;
}
}
Thank You for any help