I'm not 100% certain I understand you question, but you can specify the column type when you create the column:
foreach (var definition in columnDefinitions) // Some list of what the column types are
{
var columnSpec = new DataColumn
{
DataType = definition.Type, // This is of type System.Type
ColumnName = defintion.Name // This is of type string
};
this.dataGrid.Columns.Add(columnSpec);
}
If you need to change the type once it's been created - you can't do that. The best you can do is delete the columns and recreate them with the new types.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…