Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - Variable Height cells in a table

Reply
 
Old 12-10-2008   #1 (permalink)
Iain


 
 

Variable Height cells in a table

Hi all

Is it possible to add variable height cells to a table at run time.

Any assistance offered will be most gratefully received

Many thanks in advance

Iain




Definition
--------------
<asp:Table id="myTable" runat="server">
</asp:Table></p>


Code
-------
public void btnCreate_Click(object sender, System.EventArgs e)
{
myTable.BorderColor = System.Drawing.Color.White;

TableRow tRow = new TableRow();

for (int j=1; j<= 3; j++)
{
TableCell tCell = new TableCell();
tCell.Width = Unit.Pixel(10);
tCell.BorderWidth = 0;
tCell.Text = "Cell " + j.ToString();
if (j == 1)
{
tCell.BackColor = System.Drawing.Color.Red;
tCell.ForeColor = System.Drawing.Color.Blue;
tCell.Height = Unit.Pixel(100);
}
if (j == 2)
{
tCell.BackColor = System.Drawing.Color.Blue;
tCell.ForeColor = System.Drawing.Color.White;
tCell.Height = Unit.Pixel(50);
}
if (j == 3)
{
tCell.BackColor = System.Drawing.Color.Red;
tCell.ForeColor = System.Drawing.Color.Blue;
tCell.Height = Unit.Pixel(750);
}
tRow.Cells.Add(tCell);
}
myTable.Rows.Add(tRow);
}

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Typed datasets and table table adapters components not showing inToolbox .NET General
how do you create a dynamic table/pivot table .NET General
a little problem with .Range(.Cells(2,1),.Cells(2,49)). VB Script
Re: Brain Cells - Just FYI Vista General
Variable as hash table issue PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46