Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formatting Datagrid Cells

Status
Not open for further replies.

Maricus

Programmer
Mar 9, 2001
41
KE
Hi Guys

It's long since I was here.
I need help. I would like to change the data types of each row cell in ONE SINGLE COLUMN to vary. I am trying to write a parameters module using the grid approach. Each row show be formatted to text, check box, combo, etc as appropriately as the data type that I pass.

Maricus
 
<change the data types of each row cell in ONE SINGLE COLUMN

You seem to be flying in the face of 50 years of database theory. There's probably a simpler way to accomplish what you want, although I'm not saying that for sure. You're just doing something absolutely unique, that probably none of the very advanced people on this forum have ever conceived of doing. No doubt I'm not the only one curious about why. :)

So, Why are you trying to do this? Each row has always in my experience represented a record in a database. Why not in your case? Data type of a field doesn't vary from record to record. Why do you want to do that?

Bob
 


I think I understand what you are doing.

You do not want to really change the data type, just format the cells, or have them changed to a control (i.e. Boolean fields show just a check box)

For this, use something like a ListView, or a FlexGrid, or use the DataRepeater, as Bob has mentioned before.
 
Thanks for the reply.

Take this situation. I have a table of parameters like below:

1. Auto Account No? [ ]
2. Statement Message [-------------------]
3. Default Trandsactions Type (.) Check ( ) Cash ( ) Transfer
4.
....
I would like these entries to be loaded from a table with datatype defined. On screen they should be formatted as shown above.

Since I do not want to use tab form with direct labels,how can I achieve this. Give me suggestions with example.
 
Thanks for the reply.

Take this situation. I have a table of parameters like below:

1. Auto Account No? [ ]
2. Statement Message [-------------------]
3. Default Trandsactions Type (.) Check ( ) Cash ( ) Transfer
4.
....
I would like these entries to be loaded from a table with datatype defined. On screen they should be formatted as shown above.

Since I do not want to use tab form with direct labels,how can I achieve this. Give me suggestions with example.

Maricus
 
All right. I don't know which database you're using for a back end, so I'll describe the types generically. Your table ought to be something like:

AutoAcctNo Integer (or long integer if could be more than 32768)
StatementMsg String (however many characters you need)
DefaultTrx Integer

Now, it looks like you're not completely separating in your mind the way the data are stored from the way that they are presented. You need to do this. Store data in accordance with relational database theory rules, present data in accordance with UI rules.

Now, here's how to do your "default transactions". Create a control array of 3 optionbuttons. Create a frame. Cut and paste the option buttons into the frame. In the click event of the optionbuttons, simply evaluate the index argument. Store the value of this argument in your database field (it will be 0, 1, or 2 depending on what's selected).

To pull the data from the record and display the right optionbutton selection, do the reverse. For example: [tt]optTrx(myRs!deftrx).value = true[/tt]

Post back with further questions if you need to.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top