Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Can a datagrid be transposed to have different datatypes in the cells of a colum

Hello. Here's what I am trying to finally get (on a Windows Forms application in C#) on a datagrid:

VariableA 3.50%
VariableB 10
VariableC 1.213
VariableD 25%

Ordinarily, the datagrid would be a single row of 4 cells with matching 4 columns (VariableA, VariableB, VariableC, VariableD). But once transposed, the look would be the one above.

Also, the datagrid is to be editable.

I've been stuck on this for ages now. It's not difficult to transpose but to have different formatting for the cells in the second column ... Can it be done?

Any leads would be appreciated. Thanks!
[664 byte] By [boxwalah] at [2007-11-11 8:44:15]
# 1 Re: Can a datagrid be transposed to have different datatypes in the cells of a colum
The simple answer unfortunately is no.

The only way this could be done is to use the datatype as text. If you then need to use them in some sort of mathmatical formula use the conversion functions e.g. cint(var)

Hope this helps
xnemsis at 2007-11-11 21:47:04 >