473,396 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Format datagrid column for the string datatype

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.
Nov 21 '05 #1
3 1676
Coen,

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

Cor
Nov 21 '05 #2
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.

"Cor Ligthert" wrote:
Coen,

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

Cor

Nov 21 '05 #3
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
Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Robert Schuldenfrei | last post by:
Dear NG, After being away from C# programming for a spell, I am trying my hand at what should be a simple task. I have been hitting my head against the wall this morning. I have a simple order...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
0
by: Leo | last post by:
Thanks for the Help in Advance! I am a beginner in VB.Net. I am trying to create a form which is displayed in a email for our customers to fill in a Request for quote. I would like them to type...
6
by: Hutty | last post by:
I've looked around and have yet to find anything that would answer my question regarding formating a column in a datagrid. My grid looks like this as far as data" AMHQCON|51300.01|-3147 The...
1
by: sianan | last post by:
I tried to use the following example, to add a checkbox column to a DataGrid in an ASP.NET application: http://www.codeproject.com/aspnet/datagridcheckbox.asp For some reason, I simply CAN'T get...
5
by: Nikolay Petrov | last post by:
I have a DataSet with one DataTable in it. When binded to a DataGrid, a get the column names in DataTable as headers for the columns in the DataGrid. When I created the DataColumns I set their...
1
by: Sharon | last post by:
Hello All, Is it possible to update Sql Table through DataGrid. I have a DataGrid which is being populated through a stored procedure, all i wanted to do is to update one field...
3
by: costas | last post by:
Hi everyone, I've created a form with a datagrid and a datatable here is a sample: private System.Windows.Forms.DataGrid dataGrid1; private DataTable A; public POS() { // //...
0
by: JamesOo | last post by:
I have the code below, but I need to make it searchable in query table, below code only allowed seach the table which in show mdb only. (i.e. have 3 table, but only can search either one only,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.