I have a scenario where I will be showing a Customer data in a GridView. I have a Dictionary collection like this IDictionary<Customer, IList<CustomerOrder>>.
First Question Can I bind this dictionary to the ASP.Net GridView?
Now next question, I want to show following kind of UI i.e. Show multiple CustomerOrders in one row of Customer.
FName LastName OrderNumber MarkOrderCompleted(RadioButton)
ABC DEF 123 Radio Buttons Yes No
345 Radio Buttons Yes No
678 Radio Buttons Yes No
GHI JKL 213 Radio Buttons Yes No
546 Radio Buttons Yes No
768 Radio Buttons Yes No
FName and LastName would be populated from Customer object inside the Dictionary and OrderNumber and MarkOrderCompleted would be populated from CustomerOrders.
Below all thre is a submit button, which saves the radion buton status values to the database against the Order.
Immediate help would be really appreciated. Thanks in advance…
Do you have to have both Customer and CustomerOrder in the same Dictionary? I would have used a nested grid with two different collections. The nested grid uses the “DataKeyNames” attribute of the first grid as parameter. Example:
The Grid:
Code behind: