I have search for cascading comboboxes inside radgridview and found a couple of sample, but all of them use data in class.
My scenario is different.
I have 1 radgridview where ItemSource is bind to a SQL table (using LINQ to SQL binding). My table is similar to this:
- Customer_ID (GridViewComboBoxColumn1)
- Invoice_ID (GridViewComboBoxColumn2)
So, I want to apply combobox cascading on columns "Customer_ID" and "Invoice_ID". Right now, I am setting Customer_ID.ItemsSource and Invoice_ID.ItemsSource with results from a query I execute on Main_Loaded_Event (I query database asyn via WCF webservice, and then I use these lines to set itemssource:
((Telerik.Windows.Controls.GridViewComboBoxColumn)this.GridControl_1.Columns["Account_Invoice_ID"]).ItemsSource = e.Result.metodo_sp_Account_Invoice_SelectResult
So, this specific ItemsSource (Invoice_ID) already contains a "relation" data to Customer.
The problem is that I can't find how to link both comboboxes..
I tried to use BeginningEdit event from radgridview to filter the second combobox (Invoice_ID) but this is not working properly. This is what I have:
((Telerik.Windows.Controls.GridViewComboBoxColumn)(((Telerik.Windows.Controls.GridView.GridViewCellBase)(e.Cell)).Column)).ItemsSource = Customer_Invoices.Where(x => x.Customer_ID == SelectedCustomerID).
The problem with this approach, is that while editing a row, this filters ALL rows comboboxes, causing empty results on rows not being edited.
Is there any sample project for cascading comboboxes in a radgridview when using WCF webservices?