Connecting Tech Pros Worldwide Forums | Help | Site Map

Table In VB.net Application Form

Newbie
 
Join Date: Jun 2009
Posts: 6
#1: Jun 29 '09
I have created an ASP.net page with a nice looking table in it that takes values from an Access database (and changes colour depending on its value) and iterates the number of hours a child is with my wife (Childminding Planner) to each cell with column headers for each hour for a certain day. This works fine
But
I cannot for the life of me find a solution that will allow me to add a table to a VB.net app form that will do the same.

I even created a table myself out of loads of little textboxes thinking that i would be able to iterate them in an array sort of way, you know a control array. It turns out that control arrays aren't included into vb.net(i miss vb6 so much)

I don't know if i am putting in the wrong keywords for searching but can't find a solution anywhere.

Can anyone help me ? the code is in place, i just need to know how i can place a table object onto the form, It sounds simple enough but beyond me.

thanks in advance

OuTCasT's Avatar
Needs Regular Fix
 
Join Date: Jan 2008
Location: South Africa
Posts: 361
#2: Jun 30 '09

re: Table In VB.net Application Form


You could create the textboxes on the fly when retrieving the data from the database. So for every value returned from the db a textbox would be created for the item. You could specify where the controls are placed etc.
Newbie
 
Join Date: Jun 2009
Posts: 6
#3: Jun 30 '09

re: Table In VB.net Application Form


Hmmm

But i have a complication

For the next child that comes along in the stream read,in the same time slot my code reads if a value is there already in the box and adds that value to create a total value.

So the textbox i create dynamically will have to be referenced somehow.
Newbie
 
Join Date: Jun 2009
Posts: 6
#4: Jul 1 '09

re: Table In VB.net Application Form


To illustrate my issue

for the asp table i could do

if varDay = "Monday" and varHour = "08" then
table.Rows(x).colums(y).value = varNumber + varValueAlreadyThere
loop through how many hours the child is with my wife. Updating each field


This works great as i can loop though the fields and assign values

But using textboxes in the standalone app i have to

if varDay = "Monday" and varHour = "08" then
textbox1.text = 1 + textbox1.text
loop through how many hours the child is with my wife by assigning each individual textbox eg
if varNextHour = true then textbox2.text = varnumber + textbox2.text
if varNextHour = true then textbox3.text = varnumber + textbox3.text
if varNextHour = true then textbox4.text = varnumber + textbox4.text


and so on, loads of code. there must be a better way to do it.

I support i could make the gridview look better if there's is no other way

Or, is it possible to import the table used for ASP.net into vb.net stand alone app by referencing the resource ?
Reply

Tags
table, vb.net