KiXforms Forum Index KiXforms
The Forum for the KiXforms Community
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Quick Links 
Site News
Downloads
Documentation
Donations
Script Archive
Tracking Systems

GridView: Changes for ValueType and Format

 
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Thu Jan 13, 2005 9:26 pm    Post subject: GridView: Changes for ValueType and Format Reply with quote

I'm considering changing the way the ValueType and Format properties currently work for GridView. By way of example, lets say you wanted to define a currency column, one would do this:

$Column.ValueType = "Currency" ; or 12
$Column.Format = "$0.00"

The proposed change is to do-away with the ValueType property, and just use the Format property for this purpose, if one wanted to define a default currency column, one would do this:

$Column.Format = "Currency"

And if you wanted to customize the format, would do this:

$Column.Format = "Currency:$0.00"

Format is treated as a true "format type and format string". Here's another example using boolean:

$Column.Format = "Boolean"

$Column.Format = "Boolean:True/False"

$Column.Format = "Boolean:Yes/No"

Anybody objections, thoughts other ideas ?

-Shawn
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Jan 14, 2005 3:25 pm    Post subject: Reply with quote

hmmm, how about this:

$Column = $GridView.Columns.Add("Age")
$Column.FormatType = "Number"
$Column.FormatString = "0.00"

$Column = $GridView.Columns.Add("BirthDate")
$Column.FormatType = "Date"
$Column.FormatString = "yyyy/MMM/dd"
Back to top
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Fri Jan 14, 2005 4:35 pm    Post subject: Reply with quote

I would suggest keeping structure the same as others you have already created in .gridview

like
.bounds = left,top,width,height

.CellFormat = category,symbol,decimal places,use of 1000 separator,type

categorys:
general
number
currency
accounting
date
time
percentage
fraction
scientific
text
special
custom

symbol:
$ or what ever is desiered

decimal places:
1
2
3...

use of 1000 separator:
true
false

type or format:
-1,213.10
(1,213.10)
1,213.10 in red
1/14/2005
01/14/2005
Jan 14, 2005
January 14 2005
14 Jan 2005...

but with all this in mind as far as programing on your part it might be easier for you to go with all of these seperated.

like:
.category =
.symbol =
.decimalplaces =
.useseparator =
.type =

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Jan 14, 2005 5:52 pm    Post subject: Reply with quote

hmmm, CellFormat - I like that property name ...

I did consider breaking-out all those different formatting specifiers into different properties, but decided that having a "format specifier" like "0.000" was easier to use (and remember) ... doing like this though:

$Column.CellFormat = category, symbol, decimal ...

works, but (imho) its awefully hard to remember what each parameter is (its easier with things like Bounds and Size though).

I like the "CellFormat" name because it "lines-up" with the CellType property, these are the two "most important" properties of the Column and Cell. So maybe they should be lined-up ... now im thinking something like:

$Column.CellType = "Combobox"
$Column.CellFormat = "Boolean"

And then, maybe be allowed to optionally provide a format specifier in the CellFormat property, like this:

$Column.CellFormat = "Boolean:True/False"

btw - thinking about changing the Items property name to the "ListItems" property, then the other list-related properties would "line-up" with that, like this:

$Column.ListItems = $items
$Column.ListIndex = 0

Also, thinking I might add a new way to populate the Items collection, like this:

$Column.ListItems = "Shawn", "Lori", "Jessica", "Chris"
Back to top
View user's profile Send private message
krabourn
KiXforms Aficionado
KiXforms Aficionado


Joined: 05 Mar 2003
Posts: 273
Location: San Antonio. TX

PostPosted: Fri Jan 14, 2005 6:03 pm    Post subject: Reply with quote

I am going to show my ignorance here.

Why are you seperating the optional paremeter with a Confused Is that .net syntax?
Quote:
$Column.CellFormat = "Boolean:True/False"


I like the idea of $Column.CellFormat = category, symbol, decimal ... as long as I can also set these individually, which I assume you are planning.

I might actually get excited if you allow populating a list from an array.

I am planning to rewrite my current rewrite to us the gridview this weekend. I have been too busy at work doing Cold Fusion and SQL.

_________________
Kelly
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Jan 14, 2005 6:15 pm    Post subject: Reply with quote

hmmm, good idea - lets start with how this would be done in dotnet, this is how you create a column of formatted numbers in dotnet:

Dim Column1 As New DataGridViewTextBoxColumn

Column1.ValueType = GetType(Int32)
Column1.CellTemplate.Style.Format = "0.00"

DataGridView1.Columns.Add(Column1)

So what I did originally, was to "port" this "strategy" over to Kix, and after distilling things down, came up with this:

$Column1 = $DataGridView1.Columns.Add()

$Column1.CellType = "TextBox"
$Column1.ValueType = "Number"
$Column1.Format = "0.00"

Don't need to add the column after cause its already added. Now after doing this, want to re-visting things to see what makes sense, what doesn't - whats intuitive and whats not.

-Shawn
Back to top
View user's profile Send private message
Shawn
KiXforms Developer
KiXforms Developer


Joined: 22 Feb 2003
Posts: 1983
Location: Canada

PostPosted: Fri Jan 14, 2005 6:23 pm    Post subject: Reply with quote

Actually, dotnet has a "loose" term for CellTypes for Columns - they call them ColumnTypes, so theoretically, it should look like this

$Column1 = $DataGridView1.Columns.Add()

$Column1.ColumnType = "TextBox"
$Column1.ValueType = "Number"
$Column1.Format = "0.00"

And cells would be "defined" like this:

$DataGridView1.Rows(0).Cells(0).CellType = "Textbox"
$DataGridView1.Rows(0).Cells(0).ValueType = "Number"
$DataGridView1.Rows(0).Cells(0).Format = "0.00"

This would be about as pure dotnet as we could get with kixtart. I'm ok with leaving it as-is for now ...
Back to top
View user's profile Send private message
benny69
KiXforms Advocate
KiXforms Advocate


Joined: 30 Oct 2003
Posts: 567
Location: Lincoln, Ne

PostPosted: Fri Jan 14, 2005 7:45 pm    Post subject: Reply with quote

Now that you explain it like that having:

$GridView.Columns(0).ColumnType = "TextBox"
$GridView.Columns(0).ValueType = "Number"

and:

$GridView.Cells(Row,Column).CellType = "TextBox"
$GridView.Cells(Row,Column).ValueType = "Number"

makes alot of sence and stays consistant with structure.

and I also like the idea of populating a list from an array.
can you do that with GridView to define the .HeaderText?

_________________
Wait don't order yet,... get KiXforms Designer .NET 2.0 (Beta)
KiXforms Designer .NET 2.0 (Beta)
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    KiXforms Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group