ComboBox key value extraction

ComboBox key value extraction

Old forum URL: forums.lhotka.net/forums/t/7395.aspx


CyclingFoodmanPA posted on Tuesday, August 04, 2009

I have Csla application utilizing SL3 and Csla 3.7.  I have a ComboBox that is bound to a CslaDataProvider.  Upon pressing the search button, I extract values from DateTimePicker and the ComboBox to add to the provider.FactoryParameters.  I need to get they key value from the ComboBox and I know it involvs casting, but I am having a brain fart on how to do this.  For example, I type in the immediate window:

? NymexProductIdComboBox.SelectedItem
and I get:
{HO}
    base {Csla.Core.MobileObject}: {HO}
    Key: 5
    Value: "HO"

How do I get the Key value (5) out of this?

Thanks in advance
CyclingFoodmanPA

 

 

 

 

RockfordLhotka replied on Tuesday, August 04, 2009

I haven't looked to see if the SL3 combobox is finally decent, but the SL2 combobox needed help:

http://www.lhotka.net/weblog/SilverlightComboBoxControlAndDataBinding.aspx

CyclingFoodmanPA replied on Tuesday, August 04, 2009

You are the man Rocky.  That works for SL3.  Not sure how to determine which version of the ComboBox I am using (one for SL2 or SL3) but this fix fixed my problem.

CyclingFoodmanPA

Copyright (c) Marimer LLC