Click here to Skip to main content
15,884,237 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: beginner : binding ListBox Pin
dominioYP28-Sep-12 5:38
dominioYP28-Sep-12 5:38 
Questionbeginner : listView, add scrollBar Pin
dominioYP26-Sep-12 3:50
dominioYP26-Sep-12 3:50 
QuestionTrying to set focus on DataGrid with DataGridTemplateColumn Pin
abollmeyer23-Sep-12 3:44
abollmeyer23-Sep-12 3:44 
AnswerRe: Trying to set focus on DataGrid with DataGridTemplateColumn Pin
abollmeyer24-Sep-12 14:13
abollmeyer24-Sep-12 14:13 
QuestionOn ContextMenu MouseLeave Pin
Kenneth Haugland21-Sep-12 3:46
mvaKenneth Haugland21-Sep-12 3:46 
AnswerRe: On ContextMenu MouseLeave Pin
Kenneth Haugland21-Sep-12 13:42
mvaKenneth Haugland21-Sep-12 13:42 
QuestionWPF DataGrid Not SHowing Any Data Pin
Kevin Marois20-Sep-12 11:30
professionalKevin Marois20-Sep-12 11:30 
AnswerRe: WPF DataGrid Not SHowing Any Data Pin
Kenneth Haugland20-Sep-12 11:47
mvaKenneth Haugland20-Sep-12 11:47 
Not exactly sure but the http://msdn.microsoft.com/en-us/library/system.windows.controls.datagrid.autogeneratecolumns.aspx[^] seems to give an answer:
XML
<!-- The DataGrid.DataContext is a DataTable that contains a list of customers.  The DataTable columns are  
     Title, FirstName, MiddleName, LastName, Suffix, CompanyName, EmailAddress, and Phone.-->
<DataGrid Name="DG1" ItemsSource="{Binding}" AutoGenerateColumns="True" AutoGeneratingColumn="DG1_AutoGeneratingColumn" />

and in the code behind:
C#
//Access and update columns during autogeneration
private void DG1_AutoGeneratingColumn(object sender, DataGridAutoGeneratingColumnEventArgs e)
{
    string headername = e.Column.Header.ToString();

    //Cancel the column you don't want to generate
    if (headername == "MiddleName")
    {
        e.Cancel = true;
    }

    //update column details when generating
    if (headername == "FirstName")
    {
        e.Column.Header = "First Name";
    }
    else if (headername == "LastName")
    {
        e.Column.Header = "Last Name";
    }
    else if (headername == "EmailAddress")
    {
        e.Column.Header = "Email";

    }

}


You could use the code and step through the code with the debugger, at least then you could see whats going on.

modified 20-Sep-12 18:10pm.

GeneralRe: WPF DataGrid Not SHowing Any Data Pin
Pete O'Hanlon20-Sep-12 11:59
mvePete O'Hanlon20-Sep-12 11:59 
GeneralRe: WPF DataGrid Not SHowing Any Data Pin
Kenneth Haugland20-Sep-12 12:10
mvaKenneth Haugland20-Sep-12 12:10 
AnswerRe: WPF DataGrid Not SHowing Any Data Pin
Pete O'Hanlon20-Sep-12 12:01
mvePete O'Hanlon20-Sep-12 12:01 
GeneralRe: WPF DataGrid Not SHowing Any Data Pin
Kevin Marois20-Sep-12 13:23
professionalKevin Marois20-Sep-12 13:23 
GeneralRe: WPF DataGrid Not SHowing Any Data Pin
Pete O'Hanlon20-Sep-12 13:58
mvePete O'Hanlon20-Sep-12 13:58 
Questionstackedbarseries chart: change the axes display Pin
ashlyacht19-Sep-12 10:03
ashlyacht19-Sep-12 10:03 
Question[XML] XML binding Pin
Jayme6519-Sep-12 7:10
Jayme6519-Sep-12 7:10 
Questionplay streaming videos from internet in wpf Pin
sudeep kushwaha17-Sep-12 18:31
sudeep kushwaha17-Sep-12 18:31 
AnswerRe: play streaming videos from internet in wpf Pin
Mycroft Holmes17-Sep-12 20:05
professionalMycroft Holmes17-Sep-12 20:05 
QuestionItemsControl with Horizontal orientation Pin
Kenneth Haugland17-Sep-12 7:25
mvaKenneth Haugland17-Sep-12 7:25 
AnswerRe: ItemsControl with Horizontal orientation Pin
Abhinav S17-Sep-12 7:49
Abhinav S17-Sep-12 7:49 
AnswerRe: ItemsControl with Horizontal orientation Pin
Kenneth Haugland17-Sep-12 8:04
mvaKenneth Haugland17-Sep-12 8:04 
GeneralRe: ItemsControl with Horizontal orientation Pin
Abhinav S17-Sep-12 17:25
Abhinav S17-Sep-12 17:25 
GeneralRe: ItemsControl with Horizontal orientation Pin
Kenneth Haugland17-Sep-12 20:24
mvaKenneth Haugland17-Sep-12 20:24 
AnswerRe: ItemsControl with Horizontal orientation Pin
Kenneth Haugland17-Sep-12 9:35
mvaKenneth Haugland17-Sep-12 9:35 
QuestionWPF Editable ComboxBox Question Pin
Kevin Marois14-Sep-12 10:46
professionalKevin Marois14-Sep-12 10:46 
AnswerRe: WPF Editable ComboxBox Question Pin
SledgeHammer0114-Sep-12 11:17
SledgeHammer0114-Sep-12 11:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.