I have a table "tbl_credit_memos" to store credit memo detial. The credit_memos table has among other, a field for 'CustomerNo' and a field for "InvoiceNo".
tbl_credit_memos is displayed in a wingrid call ug_Main.
I have a dropdown (udd_CustomerNo) that is bound to the CustomerNo column in ug_Main(both the value and display properties are "CustomerNo"). udd_CusomterNo is populated by information from a table called tbl_Customers.
I also have a dropdown (udd_InvoiceNo) that is bound to the InvoiceNo column in ug_Main(both the value and display properties are "InvoiceNo"). udd_InvoiceNo is populated by information from a table called tbl_Invoices.
The above works fine, however, I need the invoice dropdown(udd_invoiceNo) to only display those invoices that are for the CustomerNo selected in the udd_CustomerNo drop down. Any help would be greatly appreciated.
I am using VS2010(visual basic), windows forms, and 10.3 Win CLR2x. Thanks.
Hey Mike, have another Q. lets say when i select a portfolio in one dropdown, if the strategy dropdown has count (for that portfolio) >0, default the strategy to the first one in the strategy dropdown. can it work like that?
thanks
Al
OK. that's what it was. i should have been using the rootBand of the strategy_combo
UltraGridBand rootBand = STRATEGY_dropdown.DisplayLayout.Bands[0];
rootBand.ColumnFilters["PORTFOLIO_CODE"].FilterConditions.Add(FilterComparisionOperator.Equals, e.Cell.Row.Cells["PORTFOLIO_CODE"].Value);
thanks again Mike
The idea here is to filter the DROPDOWN in the second column. So "TRADING_STRATEGY" is a column in the dropdown. My guess is that rootBand is your grid's root band and not the root band of the dropdown and that's why it's blowing up, because there is no "TRADING_STRATEGY" column in the grid.
Hey Mike! thanks for responding. well, the grid is loaded by this time. i see the dropdowns and am able to select a value in PORTFOLIO_CODE. It's the rootBand.ColumnFilters["TRADING_STRATEGY"] line. i don't have a "TRADING_STRATEGY" column filter. no idea what even is.
i'm saying grid_AfterCellUpdate...
if columnkey=PORTFOLIO_CODE
{
the only columns i see in rootBand.ColumnFilters are all fields from table A (which is the PORTFOLIO, i'm not trying to filter that.) i'm trying to filter table B.PORTFOLIO_CODE.
}
table A( bound to portfolio_dropdown)
PORTFOLIO, PORTFOLIO_CODE
table B( bound to strategy_dropdown)
PORFOLIO_CODE, TRADING_STRATEGY
am i totally off the mark here?
Hi,
Yes, I'm here. :)
Key Not Found indicates that you are trying to access an item in a collection by key and there is no such item in the collection with that key.
So for this line of code, either there is no "TRADING_STRATEGY" column in the rootBand, or else there is no "PORTFOLIO_CODE" column in the band referred to by e.Cell.
Assuming that your column names are spelled correctly, perhaps this line of code is being hit before the DataSource has been bound to the control and so there are no columns at all?
Another possibility is that rootBand or e.Cell doesn't refer to what you think it does.