Skip to main content
Home Forums Silverlight Programming .NET RIA Services ComboBox in a DataForm
2 replies. Latest Post by xifan on July 9, 2009.
(0)
nbruckel...
Member
9 points
23 Posts
07-02-2009 11:47 AM |
How do I add a ComboBox to a DataForm and load it with data. I need to use a Combobox so I can make use of its SelectionChanged event.
Nathan
TomBeeby
Participant
1151 points
188 Posts
07-02-2009 9:25 PM |
whack something like this in your XAML:
<dataControls:DataFormTemplateField> <dataControls:DataFormTemplateField.DisplayTemplate> <DataTemplate> <TextBlock Text="hello" /> </DataTemplate> </dataControls:DataFormTemplateField.DisplayTemplate> <dataControls:DataFormTemplateField.EditTemplate> <DataTemplate> <ComboBox x:Name="combobox1" SelectionChanged="combobox1_SelectionChanged"> <TextBlock Text="One" /> <TextBlock Text="Two" /> <TextBlock Text="Three" /> </ComboBox> </DataTemplate> </dataControls:DataFormTemplateField.EditTemplate> </dataControls:DataFormTemplateField>
not sure how to go about populating the combobox... maybe capture the beginingedit event and do it that way
xifan
24 points
27 Posts
07-09-2009 5:08 PM |
Hard code!!
I saw one excellent article http://weblogs.asp.net/manishdalal/archive/2009/07/03/silverlight-3-combobox-control.aspx but it is on DataGrid, Another one http://www.microapplications.com/blog/archive/2009/05/07/330.aspx is on Webform, but it is too complicated.
is there any better way??