How Use format field DataGrid ColumnStyle Collection Editor? 
Author Message
 How Use format field DataGrid ColumnStyle Collection Editor?

I am abviously new to VS.net.  I have discovered the format field in the
DataGrid ColumnStyle Collection Editor. Unfortunately, I can not interpret
the help link in this form to take me to the information I need.

Basicaly, I have a money type field in a datagrid.  Right now when I type in
a number in the grid the number does not come out formatted.  I suppose the
answer to my problem is the option in the ColumnStyle Collection Editor
called format.  But how do I use it?

What syntax would I use in this instance?



Thu, 11 Aug 2005 00:08:38 GMT  
 How Use format field DataGrid ColumnStyle Collection Editor?
OK, Scratch that.  I discovered that it's as simple as putting a "C" (quotes
mine) in the format field.

However, I am having a hard time finding the syntax for changing the field
to upper case for example.  I have tried several combinations but have not
stumbled onto it yet.

Anyone?



Thu, 11 Aug 2005 03:36:09 GMT  
 How Use format field DataGrid ColumnStyle Collection Editor?
I'm not sure about how the col style works in regards to case, but you can
trap the events of the textbox that the col style displays for user input,
when the Leave / Validate event fires, just convert it to caps at that
point.
microsoft.VisualBasic.StrConv(Text,VbStrConv.UpperCase)

In our app, we created a 2 tables, 1 for TableStyles and one for
ColumnStyles, assigned a style id to both tables and added the properties
for the 3 objects (TableStyle, TextBoxColumnStyle & BooleanColumnStyle). We
run a stored proc to load the styles for the grid at run-time so you can
change the display without re-compiling your code.

HTH,

Jeremy


Quote:
> OK, Scratch that.  I discovered that it's as simple as putting a "C"
(quotes
> mine) in the format field.

> However, I am having a hard time finding the syntax for changing the field
> to upper case for example.  I have tried several combinations but have not
> stumbled onto it yet.

> Anyone?



Thu, 11 Aug 2005 04:13:29 GMT  
 How Use format field DataGrid ColumnStyle Collection Editor?
Hi Woody,

You can use the String.ToUpper  method. It returns a copy of this string in
uppercase.

For more information about formatting Windows Forms DataGrids, please read:

Formatting Windows Forms DataGrids at Design Time
http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskFormattingthe...
dAtDesignTime.asp

Hope this helps.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:


>Subject: Re: How Use format field DataGrid ColumnStyle Collection Editor?
>Date: Sat, 22 Feb 2003 11:36:09 -0800
>Lines: 10
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

>Newsgroups: microsoft.public.dotnet.languages.vb
>NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net 66.60.158.168
>Path: cpmsftngxa06!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>Xref: cpmsftngxa06 microsoft.public.dotnet.languages.vb:91979
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb

>OK, Scratch that.  I discovered that it's as simple as putting a "C"
(quotes
>mine) in the format field.

>However, I am having a hard time finding the syntax for changing the field
>to upper case for example.  I have tried several combinations but have not
>stumbled onto it yet.

>Anyone?



Fri, 12 Aug 2005 13:23:29 GMT  
 How Use format field DataGrid ColumnStyle Collection Editor?
Thank you for your reply.

I am aware of String.ToUpper and as someone else mentioned, I could do this
using code as certain events fired.  The Format field seems the easiest
though.  I have tried several different syntax expressions to make it work
but have not stumbled onto the right way yet.  I have tried things like

String.ToUpper
String.ToUpper()
Me.String.ToUpper
UCase Etc....

But none of them seem to work in the Format field of the
DataGridColumnStyleCollection Editor.

Is this field not designed for this kind of thing?  It's so easy with
numbers.



Quote:
> Hi Woody,

> You can use the String.ToUpper  method. It returns a copy of this string
in
> uppercase.

> For more information about formatting Windows Forms DataGrids, please
read:

> Formatting Windows Forms DataGrids at Design Time

http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskFormattingthe...
Quote:
> dAtDesignTime.asp

> Hope this helps.

> Regards,

> Felix Wu
> =============
> This posting is provided "AS IS" with no warranties, and confers no
rights.

> --------------------


> >Subject: Re: How Use format field DataGrid ColumnStyle Collection Editor?
> >Date: Sat, 22 Feb 2003 11:36:09 -0800
> >Lines: 10
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

> >Newsgroups: microsoft.public.dotnet.languages.vb
> >NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net
66.60.158.168
> >Path: cpmsftngxa06!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
> >Xref: cpmsftngxa06 microsoft.public.dotnet.languages.vb:91979
> >X-Tomcat-NG: microsoft.public.dotnet.languages.vb

> >OK, Scratch that.  I discovered that it's as simple as putting a "C"
> (quotes
> >mine) in the format field.

> >However, I am having a hard time finding the syntax for changing the
field
> >to upper case for example.  I have tried several combinations but have
not
> >stumbled onto it yet.

> >Anyone?



Fri, 12 Aug 2005 23:59:49 GMT  
 How Use format field DataGrid ColumnStyle Collection Editor?
Hi Woody ,

If you are using the database, you can use the "upper" function in the SQL
statement to convert a given column to upper case. For example:

select upper(name) as name from Users

Hope this helps.

Regards,

Felix Wu
=============
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

Quote:
>Subject: Re: How Use format field DataGrid ColumnStyle Collection Editor?
>Date: Mon, 24 Feb 2003 07:59:49 -0800
>Lines: 81
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

>Newsgroups: microsoft.public.dotnet.languages.vb
>NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net 66.60.158.168
>Path: cpmsftngxa06!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>Xref: cpmsftngxa06 microsoft.public.dotnet.languages.vb:92186
>X-Tomcat-NG: microsoft.public.dotnet.languages.vb

>Thank you for your reply.

>I am aware of String.ToUpper and as someone else mentioned, I could do this
>using code as certain events fired.  The Format field seems the easiest
>though.  I have tried several different syntax expressions to make it work
>but have not stumbled onto the right way yet.  I have tried things like

>String.ToUpper
>String.ToUpper()
>Me.String.ToUpper
>UCase Etc....

>But none of them seem to work in the Format field of the
>DataGridColumnStyleCollection Editor.

>Is this field not designed for this kind of thing?  It's so easy with
>numbers.



>> Hi Woody,

>> You can use the String.ToUpper  method. It returns a copy of this string
>in
>> uppercase.

>> For more information about formatting Windows Forms DataGrids, please
>read:

>> Formatting Windows Forms DataGrids at Design Time

>http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskFormattingthe...
i
>> dAtDesignTime.asp

>> Hope this helps.

>> Regards,

>> Felix Wu
>> =============
>> This posting is provided "AS IS" with no warranties, and confers no
>rights.

>> --------------------


>> >Subject: Re: How Use format field DataGrid ColumnStyle Collection
Editor?
>> >Date: Sat, 22 Feb 2003 11:36:09 -0800
>> >Lines: 10
>> >X-Priority: 3
>> >X-MSMail-Priority: Normal
>> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
>> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

>> >Newsgroups: microsoft.public.dotnet.languages.vb
>> >NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net
>66.60.158.168
>> >Path: cpmsftngxa06!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>> >Xref: cpmsftngxa06 microsoft.public.dotnet.languages.vb:91979
>> >X-Tomcat-NG: microsoft.public.dotnet.languages.vb

>> >OK, Scratch that.  I discovered that it's as simple as putting a "C"
>> (quotes
>> >mine) in the format field.

>> >However, I am having a hard time finding the syntax for changing the
>field
>> >to upper case for example.  I have tried several combinations but have
>not
>> >stumbled onto it yet.

>> >Anyone?



Sat, 13 Aug 2005 12:39:08 GMT  
 How Use format field DataGrid ColumnStyle Collection Editor?
Are you saying that the format field can not be used to do the same thing?
I am not trying to be smart, I am asking because I do not know.  If I can
use the format field to make it's contents appear in upper case (like for a
state field), I am asking how this is done.  If the field is not designed to
do this then fine, I will need to consider other solutions, like the one you
mentioned.

Thank you for responding.

Woody



Quote:
> Hi Woody ,

> If you are using the database, you can use the "upper" function in the SQL
> statement to convert a given column to upper case. For example:

> select upper(name) as name from Users

> Hope this helps.

> Regards,

> Felix Wu
> =============
> This posting is provided "AS IS" with no warranties, and confers no
rights.

> --------------------



> >Subject: Re: How Use format field DataGrid ColumnStyle Collection Editor?
> >Date: Mon, 24 Feb 2003 07:59:49 -0800
> >Lines: 81
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

> >Newsgroups: microsoft.public.dotnet.languages.vb
> >NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net
66.60.158.168
> >Path: cpmsftngxa06!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
> >Xref: cpmsftngxa06 microsoft.public.dotnet.languages.vb:92186
> >X-Tomcat-NG: microsoft.public.dotnet.languages.vb

> >Thank you for your reply.

> >I am aware of String.ToUpper and as someone else mentioned, I could do
this
> >using code as certain events fired.  The Format field seems the easiest
> >though.  I have tried several different syntax expressions to make it
work
> >but have not stumbled onto the right way yet.  I have tried things like

> >String.ToUpper
> >String.ToUpper()
> >Me.String.ToUpper
> >UCase Etc....

> >But none of them seem to work in the Format field of the
> >DataGridColumnStyleCollection Editor.

> >Is this field not designed for this kind of thing?  It's so easy with
> >numbers.



> >> Hi Woody,

> >> You can use the String.ToUpper  method. It returns a copy of this
string
> >in
> >> uppercase.

> >> For more information about formatting Windows Forms DataGrids, please
> >read:

> >> Formatting Windows Forms DataGrids at Design Time

>http://msdn.microsoft.com/library/en-us/vbcon/html/vbtskFormattingthe...
> i
> >> dAtDesignTime.asp

> >> Hope this helps.

> >> Regards,

> >> Felix Wu
> >> =============
> >> This posting is provided "AS IS" with no warranties, and confers no
> >rights.

> >> --------------------


> >> >Subject: Re: How Use format field DataGrid ColumnStyle Collection
> Editor?
> >> >Date: Sat, 22 Feb 2003 11:36:09 -0800
> >> >Lines: 10
> >> >X-Priority: 3
> >> >X-MSMail-Priority: Normal
> >> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
> >> >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106

> >> >Newsgroups: microsoft.public.dotnet.languages.vb
> >> >NNTP-Posting-Host: 168.158-60-66-fuji-dsl.static.surewest.net
> >66.60.158.168
> >> >Path: cpmsftngxa06!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
> >> >Xref: cpmsftngxa06 microsoft.public.dotnet.languages.vb:91979
> >> >X-Tomcat-NG: microsoft.public.dotnet.languages.vb

> >> >OK, Scratch that.  I discovered that it's as simple as putting a "C"
> >> (quotes
> >> >mine) in the format field.

> >> >However, I am having a hard time finding the syntax for changing the
> >field
> >> >to upper case for example.  I have tried several combinations but have
> >not
> >> >stumbled onto it yet.

> >> >Anyone?



Sun, 14 Aug 2005 22:56:42 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. DataGrid with Combobox ColumnStyle in Windows Forms

2. Datagrid and Columnstyles in vb.net

3. Format string fields on a datagrid

4. Format string fields on a datagrid

5. Format string fields on a datagrid

6. Wanted - Sample DB2 + ADO Insert using fields collection

7. Missing Field data using ADO & dataGrid

8. Using DataGrid RowFilter with multiple fields/colums

9. format of fields used in word mail merge

10. How to set field's format using DAO

11. Help Changing Table's Field Type and Format using DOA

12. Referencing Field Properties InputMask and Format, using VB/VBA

 

 
Powered by phpBB® Forum Software