Question : Silverlight convert XAML to xaml.cs code at runtime


   
        eaderStyle>
           
        HeaderStyle>
   



Following code can create a column at runtime, but I would like to use multiple line column haeader as shown above.

DataGrid dataGrid1 = new DataGrid();
dataGrid1.AutoGenerateColumns = false;
DataGridTextColumn col1 = new DataGridTextColumn();
col1.Binding = new Binding();
col1.Width = DataGridLength.Auto;
col1.Header = "Auto";
dataGrid1.Columns.Add(col1);

Thanks,
Ashok

Answer : Silverlight convert XAML to xaml.cs code at runtime

Try

col1.Header = "Department\n" + "Dates";
Random Solutions  
 
programming4us programming4us