How do you dynamically assign a datagrid's headers in c#?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 1 of 1

Thread: How do you dynamically assign a datagrid's headers in c#?

  1. #1
    Join Date
    Dec 2005
    Posts
    180

    How do you dynamically assign a datagrid's headers in c#?

    How do you dynamically assign a datagrid's headers in c#?

    Consider the following XAML:
    Code:
                    <data:DataGrid  x:Name="dataGrid" AutoGenerateColumns="False"  Margin="1,1,1,1" >
                        <data:DataGrid.Columns>
                            <data:DataGridTextColumn
                                Header="Substantive"
                                Binding="{Binding Path=Substantive}"
                                IsReadOnly="True"
                                />
    
                            <data:DataGridTextColumn
                                Header=""
                                Binding="{Binding Path=Month[0]}"
                                IsReadOnly="True"
                                />
    
                            <data:DataGridTextColumn
                                Header=""
                                Binding="{Binding Path=Month[1]}"
                                IsReadOnly="True"
                                />
    
                        </data:DataGrid.Columns>
    
                    </data:DataGrid>
    In the C# code, how would I define the headers that are blank?
    Last edited by Complete; August 1st, 2011 at 10:23 PM. Reason: code
    Share on Google+

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center