473,387 Members | 1,892 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,387 software developers and data experts.

drawing a line or rule programmatically in a web form

I have a page which displays a table that's being created in the code
behind, where the size of the table dependes on the amount of data
being returned ( eg it could contain one, three or fifty 'apples',
depending ).
All is fine there but I want to draw a dividing line between each
'apple' as it were, yet I'm finding it hard to get a handle on how to
do this!
Is there a way to put the html <HR> horizontal rule in the code behind
so it gets drawn on each loop, or should I be looking at using the
Drawing2D namespace?

Thanks for any tips,
Bob

Nov 19 '05 #1
3 3506
Bob,

You should set row border with css rules.

Eliyahu

"yer darn tootin" <bo*************@yahoo.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
I have a page which displays a table that's being created in the code
behind, where the size of the table dependes on the amount of data
being returned ( eg it could contain one, three or fifty 'apples',
depending ).
All is fine there but I want to draw a dividing line between each
'apple' as it were, yet I'm finding it hard to get a handle on how to
do this!
Is there a way to put the html <HR> horizontal rule in the code behind
so it gets drawn on each loop, or should I be looking at using the
Drawing2D namespace?

Thanks for any tips,
Bob

Nov 19 '05 #2
Thanks, I tried that on your suggestion but it isn't quite what I need.
The number of rows that make up the table is not set, it's different
each time depending on the number of items returned ( see below )
Private Sub LoadHeader(ByVal iItemID As Integer)

Dim oDS As New DataSet

oDS = oDal.ItemNo_ReadHeader(iLogID)
Dim oRW As DataRow
oRW = oDS.Tables(0).Rows(0)

With tblPrint

' need to put a horizontal rule in here, as we loop back
for each Item...

r = New TableRow
c = New TableCell

c.Controls.Add(New LiteralControl("Item Number"))
r.Cells.Add(c)

c = New TableCell

c.Controls.Add(New LiteralControl(oRW.Item("ItemNo")))

r.Cells.Add(c)
.Rows.Add(r)

Nov 19 '05 #3
I stumbled across the answer.... I was looking on MSDN at the
Control.Controls
property and saw this code example : Controls.Add(New
LiteralControl("<h3>Value: "))
( This is what I was looking for really, a way to render a HTML control
from within the code behind.)

With the example above I went and changed the "<h3>Value: " to "<hr>"
and it worked!

'Insert dummy row into table as a horizontal rule

r = New TableRow
c = New TableCell
c.ColumnSpan = 4
c.Controls.Add(New LiteralControl("<hr>"))
c.Width = Unit.Percentage(100)
r.Cells.Add(c)
.Rows.Add(r)

Nov 19 '05 #4

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

Similar topics

19
by: Atif | last post by:
Hello all, In my html page I want to add an image say of 800x600. Now I want that when ever I am given two coordinates on this image say (x1, y1)=(50, 100) and (x2, y2)=(200, 300), the java script...
3
by: Bob | last post by:
Hello, I am trying to draw a line across a page. The problem is that it is affecting the text subsequent text. I may be doing something wrong with the html but I am not sure. You can see the...
2
by: Anand Ganesh | last post by:
Hi All, In my application I am allowing the user to draw a line. But when the user clicks the start point and starts moving the mouse there is a series of line generated. When the mouse is up...
1
by: angus | last post by:
Dear All, I knew that if i want to make some printout in window form, i can use "System.Drawing.Printing" namespace. Is it possible to use this namespace in web form in asp.net? Thank you ...
3
by: Steve | last post by:
Hi All, I am sure this is a simple question, but how do I draw a line onto a windows form in VB.NET, or any shape for that matter. VB6 had a line and shape control that you could use. ...
0
by: SurajPrabhu | last post by:
Hi All, I am tying to build a ASP.net 2.0 based web page which displays a Analog Guage ( 0 to 180 degrees) with an Arrow in the middle. The application accepts the Percentage as input from a...
16
by: cj | last post by:
Back in VB4 there was a line tool in my toolbox that allowed me to put a decorative line on the form somewhere. Does VB.net 2003 offer this? It's not in the toolbox and I can't find it in the list...
2
by: rkgarimella9 | last post by:
Friends, i'm facing with a severe problem while coding an windows application. the problem is that i'm using a usercontrol consisting of three labels upon which three images are placed. the problem...
10
Mas Juliza Alias
by: Mas Juliza Alias | last post by:
I have a table (MSFlexgrid1) in a form (frmCalculate) containing 2 columns of Depth and Volume data. I want to draw a line graph of Depth Vs Volume in a new form (frmGraph) by using MSChart control....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.