Results 1 to 3 of 3

Thread: * Resolved - closed * ASP.NET newbie question about Table Control

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    The Big D
    Posts
    310

    * Resolved - closed * ASP.NET newbie question about Table Control

    Here is my issue. I have a table web form control (not the HTML table) on a webform. I build the table in code just fine. The question I have is I would like to add an effect to the table rows to change the backcolor of the row on mouseover and back to normal on mouseout.

    How can I do this?
    Last edited by VBGuy; Feb 26th, 2003 at 09:47 AM.

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Use JavaScript.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Dec 2002
    Location
    The Big D
    Posts
    310

    I know I have to do in in Javascript but...

    Here is the code to add 2 rows each with one cell. I dont know where or how to insert the appropriate code to get the javascript to render.

    Code:
            Dim i As Int32
            Dim x As Int32
    
            With Table1
                .BorderStyle = BorderStyle.Solid
                .BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1)
                .BorderColor = System.Drawing.Color.LightSteelBlue
                .CellPadding = 0
                .CellSpacing = 0
                .GridLines = GridLines.Horizontal
    
                For i = 1 To 2
                    Dim tr As New TableRow()
                    .Rows.Add(tr)
                    tr.HorizontalAlign = HorizontalAlign.Center
                    tr.VerticalAlign = VerticalAlign.Top
    
                    Dim td As New TableCell()
                    tr.Cells.Add(td)
                    td.VerticalAlign = VerticalAlign.Bottom
                    td.HorizontalAlign = HorizontalAlign.Left
                    td.Width = System.Web.UI.WebControls.Unit.Percentage(79)
                    td.Text = "SomeText <br>"                
                Next
            End With
    Like I said I am adding the rows and cells programmatically so how do I get the javascript in?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width