Results 1 to 3 of 3

Thread: Datagrid footer...

  1. #1

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091

    Datagrid footer...

    I have a datagrid that has the footer showing. The problem I have is that the footer is actually a footer for each column, so the column separators are showing.

    What I would like is just something to pad the empty space I have after the last row in the grid.

    If it was normal HTML, I would just insert another row in the table with a colspan of how ever many columns I had, and a height of 100%.

    How would I do the same thing with a datagrid?

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

  2. #2
    C# Aficionado Lord_Rat's Avatar
    Join Date
    Sep 2001
    Location
    Cave
    Posts
    2,497
    In the databind event for the datagrid, test for e.itemtype being a footer.

    Then, programmatically remove the cells and then change the column span of the first cell to span all of your columns.

    What's even better is I'll show you how!

    PHP Code:
    if e.item.ItemType ListItemType.Footer then
    Dim numberofCells 
    as Integer e.Item.Cells.Count
    Dim x 
    as Integer
    For 0 to numberOfCells 2
    e
    .Item.Cells.removeAt(0)
    Next

    e
    .Item.Cells(0).Text "your text here" 'use   if you have no text
    e.Item.Cells(0).ColumnSpan = numberOfCells
    e.Item.Cells(0).HorizontalAlign = HorizontalAlign.Left
    e.Item.Cells(0).Attributes.Add("height","100%") 
    Last edited by Lord_Rat; Oct 9th, 2003 at 05:31 PM.
    Need to re-register ASP.NET?
    C:\WINNT\Microsoft.NET\Framework\v#VERSIONNUMBER#\aspnet_regiis -i

    (Edit #VERSIONNUMBER# as needed - do a DIR if you don't know)

  3. #3

    Thread Starter
    The Devil crptcblade's Avatar
    Join Date
    Aug 2000
    Location
    Quetzalshacatenango
    Posts
    9,091
    Thanks, I'll give it a shot.

    Laugh, and the world laughs with you. Cry, and you just water down your vodka.


    Take credit, not responsibility

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