I have populated a ComboBox
inside a ListView
. Screen shot is given below
As shown above it's displaying "M", "a", "c" instead of "Mac". Why it is separating the word into characters?
In code behind file I've written
ItemCategoryDAL itemCategoryDalObj = new ItemCategoryDAL(); DataTable dataTable = itemCategoryDalObj.GetAllItemCategory(); listView1.ItemsSource = dataTable.DefaultView;
And in .xaml file I've written:
<ListView Height="148" HorizontalAlignment="Left" Margin="23,12,0,0" Name="listView1" VerticalAlignment="Top" Width="447" > <ListView.View> <GridView> - - - - - - - - - - - - - - - - <GridViewColumn Header="Category Name" Width="150"> <GridViewColumn.CellTemplate> <DataTemplate> <ComboBox ItemsSource="{Binding Path=IC_NAME }" Width="120" /> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> - - - - - - - - - - - - - - - - - - </GridView> </ListView.View> </ListView>
I'm using Visual Studio 2010
Screen shot of dataTable
which I used as ItemSource
for the ListView.(Taken during debuging)