Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more: , +
I'm using wpf c# and Entity Framework

I have a DataGrid on that show data from database

when users click on datagrid that row will show items in ComboBox (Load on of columns in combobox)

but problem is combobox doesn't show Normal list
https://i.stack.imgur.com/vIj3u.png[^]

Code Behind CS :
C#
DENAF1399Entities dbms = new DENAF1399Entities();

private void Window_Loaded(object sender, RoutedEventArgs e)
{
    var qre = dbms.Database.SqlQuery<Q_View>("SELECT * FROM Q_View");
    datagrid1.ItemsSource = qre.ToList();
}

private void datagrid1_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
    Q_View QVkala = datagrid1.SelectedItem as Q_View;
    if (QVkala != null)
    {
        combobox1.ItemsSource = QVkala.NAMES;
    }
}


What I have tried:

I tried

-Change Fonts of combobox

-use new combobox

but didn't work

please help me
Posted
Comments
[no name] 21-Oct-20 16:45pm    
Could be the type of collection (NAMES); or the width of the item's data template; or the "reading direction". Use the "Visual Tree inspector" on the control properties (that thing at the top of the app window).

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900