by
Roland Schumacher alias GENiALi
20. Februar 2006 -- 113
words -- 1 mal gelesen
Because I was looking for long.
I will miss a DataGrid in a WinForm app a new appearance.
This can be done with DataGridTableStyle.
public static DataGridTableStyle GetGridStyle()
{
DataGridTableStyle = tableStyle new DataGridTableStyle();
tableStyle.MappingName = "CATI_History";
Id = DataGridTextBoxColumn new DataGridTextBoxColumn();
ID.HeaderText = "DB ID";
ID.MappingName = "ID";
ID.Width = 2;
ID.ReadOnly = false ;
tableStyle.GridColumnStyles.Add(id);
= DataGridTextBoxColumn studNr new DataGridTextBoxColumn();
studNr.HeaderText = "studies No.";
studNr.MappingName = "Study number";
studNr.Width = 100;
studNr.ReadOnly = false ;
tableStyle.GridColumnStyles.Add(studNr);
return tableStyle;
}
You must bind the thing still to the DataGrid.
if(dgCatiLzData.TableStyles.Count_==_0)
{
dgCatiLzData.TableStyles.Clear();
dgCatiLzData.TableStyles.Add(Helper.GetGridStyle());
}
Unfortunately that brought a success. The problem of the row
tableStyle.MappingName = "CATI_History";
I have specified the table of the SQL DB here. Bound to the DataGrid
but I have a collection of type records. Searched how stupid.
The solution:
tableStyle.MappingName = "Records";
4e73def7-fac9-4188-8164-36e8427f6dab|0|.0
Tags: