Format datagrid column for the string datatype

G

Guest

I have a datagrid bound to a dataset's table. I'm using a tablestyle and so I
can, with the column.format property, format numeric and date typed
datacolumns. But I need to format a column of type string. The column.format
way is of no effect then. How to make this work?

Any ideas are welcome.
Coen.
 
C

Cor Ligthert

Coen,

Are you using a datatabletextboxcolumn, in my opinion is that already a
string?

Cor
 
G

Guest

Hi Cor, nice to meet again.

I'using the next syntax:

Dim tsOrder As New DataGridTableStyle
tsOrder.MappingName = "Order"
column = New DataGridTextBoxColumn
column.MappingName = "OrderCode"
column.HeaderText = "Ordercode"
column.Width = 100
tsOrder.GridColumnStyles.Add(column)
grdOrder.TableStyles.Add(tsOrder)

With this I hoped to be able using the format property:
column.Format = "<a format string>", but this Order column is of type
'string' and formatting doesn't work. For numeric or date datatypes this is
not a problem, but this Order column has to be a the string datatype.

Regards Coen.
Btw any news about IndexOutOfRange exception handling? Please in the other
post.
 
C

Cor Ligthert

Coen,

When it is not an editing column I know a trick however otherwise I would
not know either.

Maybe Ken knows it, because once I told to use the databiding events for
that, however that was wrong (what I knew however was to quick sending) and
than I thought that he had a solution or said it did not work. However I
don't know anymore which it was from the two.

From the other question I am quiet sure. The microsoft developpers have
probably used a try and catch to evaluate if there was an empty relation and
fixed that in the catch. Try this than you have the same behaviour.

If Not IsDate("30:60:2005") Then MessageBox.Show("blabla")

I placed Kens name in the subject from this message.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top