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

Posted by Zhang JingChu under C# on 8/1/2011 | Points: 10 | Views : 1573 | Status : [Member] | Replies : 1
How do you dynamically assign a datagrid's headers in c#?

Consider the following XAML:

                <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?




Responses

Posted by: Gsudhesh on: 8/2/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved

check out the following link :

http://social.msdn.microsoft.com/Forums/en/silverlightdeveloper/thread/b9adb1c3-6082-417f-b9b7-634cb7bacd9f

Zhang JingChu, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response