Link to home
Start Free TrialLog in
Avatar of jdavey3
jdavey3

asked on

Display a view list in a combo box

I have a combo box below that display just the names of system fonts displayed, is it possible to display the  ListView called FontList below which displays the example of font, and populate a textbox with the font name from the selected font in the combobox
<ComboBox Margin="8,104,109,0" x:Name="Font" VerticalAlignment="Top" Height="24" IsSynchronizedWithCurrentItem="True" ItemsSource="{x:Static Fonts.SystemFontFamilies}"/>
 
 
<ListView ItemsSource="{x:Static Fonts.SystemFontFamilies}" Width="200" Height="200" x:Name="FontList">
		<ListView.View>
		<GridView>
		<GridViewColumn Header="Name"
			DisplayMemberBinding="{Binding Source}"/>
 
		<GridViewColumn Header="Sample">	
			<GridViewColumn.CellTemplate>
			<DataTemplate>
			<TextBlock FontFamily="{Binding}" FontSize="20"
			   Text="ABCabc" />
			   </DataTemplate>
			</GridViewColumn.CellTemplate>
	   </GridViewColumn>
		</GridView>
	   </ListView.View>
			   </ListView>

Open in new window

Avatar of Smart_Man
Smart_Man
Flag of Egypt image

just add the items in the ListView. you can get the id of the selected item in the combo box. and then use in the text box.

it is something like combo box.selected. list view .selected .......

i do not see great difficulty here. again , maybe i am missing something.

waiting for your reply
Avatar of jdavey3
jdavey3

ASKER

I am new to xaml where can I reference the ListView below and where can I reference the

<ComboBox Margin="8,104,109,0" x:Name="Font" VerticalAlignment="Top" Height="24" IsSynchronizedWithCurrentItem="True" ItemsSource="{x:Static Fonts.SystemFontFamilies}"/>

How can I select this back to a textbox
<GridViewColumn Header="Name"
DisplayMemberBinding="{Binding Source}"/>
are you using the Microsoft c# compiler ?

waiting for your reply
Avatar of jdavey3

ASKER

I am using Blend to design and write the xaml and c# visual studio 2008 if need for procedural code
hoping to be able to do it in xamll ?
you can bind teh controls easly in 2008 studio since they are written in c# and not xml

waiting for your reply
Avatar of jdavey3

ASKER

Where can I reference the ViewList below or is it possible, do I have to do it in C#

<ComboBox Margin="8,104,109,0" x:Name="Font" VerticalAlignment="Top" Height="24" IsSynchronizedWithCurrentItem="True" ItemsSource="{x:Static Fonts.SystemFontFamilies}"/>
Avatar of jdavey3

ASKER

I will go with c# in vs 2008, it may be more straight forward
ASKER CERTIFIED SOLUTION
Avatar of Smart_Man
Smart_Man
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial