extra datagrid header...

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default extra datagrid header...

    I was wondering if there is a way I can add an extra header to a datagrid?

    I found this solution on the internet - but it seems quite old and didn't
    work for me.

    [url]http://www.dotnet247.com/247reference/msgs/13/69744.aspx[/url]

    It recommends the following:

    Private Sub DataGrid1_PreRender(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles DataGrid1.PreRender
    Dim dgitem As New DataGridItem(0, 0, ListItemType.Header)
    Dim mycell As New TableCell
    mycell.ColumnSpan = 1 'Set it to the colspan that you want
    mycell.Text = "PRESS RADIO TV"
    dgitem.Cells.Add(mycell)
    DataGrid1.Controls(0).Controls.AddAt(0, dgitem)
    End Sub

    But I get an error:

    Specified argument was out of the range of valid values. Parameter name:
    index

    I appreicate your help,


    KS


    saleek Guest

  2. Similar Questions and Discussions

    1. Adding extra rows to a DataGrid?
      Hi everyone, I'm using a DataGrid to show records from a SQL query. The problem is, I'd really like to have two "extra" rows for every one...
    2. datagrid header
      Is it possible to have an overall header that spans across all columns? An example would be a class schedule for student Ben. |Ben |English ...
    3. #25160 [NEW]: Extra characters in header under certain conditions
      From: jeff at mos dot org Operating system: Windows 2000 PHP version: 4.3.2 PHP Bug Type: IIS related Bug description: ...
    4. DataGrid header and <TH>
      Hello Vaclav, You might use the HeaderStyle of the DataGrid which will create Th on the client side. You can also attach style attribute to this...
    5. LWP Extra Header Lines
      Hi, Does anyone know how to add extra request header lines with LWP? I've seen this way but thought I'd see if there's a 'better' way: my...
  3. #2

    Default Re: extra datagrid header...

    Check out this article,
    [url]http://www.extremeexperts.com/Net/Articles/ExtendingDataGrid.aspx[/url]

    --
    -Saravana
    [url]http://dotnetjunkies.com/WebLog/saravana/[/url]
    [url]www.ExtremeExperts.com[/url]



    "saleek" <saleek@discussions.microsoft.com> wrote in message
    news:78193D06-BE43-4301-B0A0-0EC2A5FF87A1@microsoft.com...
    > I was wondering if there is a way I can add an extra header to a datagrid?
    >
    > I found this solution on the internet - but it seems quite old and didn't
    > work for me.
    >
    > [url]http://www.dotnet247.com/247reference/msgs/13/69744.aspx[/url]
    >
    > It recommends the following:
    >
    > Private Sub DataGrid1_PreRender(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles DataGrid1.PreRender
    > Dim dgitem As New DataGridItem(0, 0, ListItemType.Header)
    > Dim mycell As New TableCell
    > mycell.ColumnSpan = 1 'Set it to the colspan that you want
    > mycell.Text = "PRESS RADIO TV"
    > dgitem.Cells.Add(mycell)
    > DataGrid1.Controls(0).Controls.AddAt(0, dgitem)
    > End Sub
    >
    > But I get an error:
    >
    > Specified argument was out of the range of valid values. Parameter name:
    > index
    >
    > I appreicate your help,
    >
    >
    > KS
    >
    >

    Saravana Guest

Posting Permissions

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

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 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139