Professional Web Applications Themes

Dynamically adding a row into an gridview - ASP.NET Data Grid Control

Hi All, I want to dynamically add a row in my gridview. I want to have a row beneath my headerrow with dropdowns in it, which I can use to filter on that column. I thought the GridView.RowCreated event would be my friend, by checking there if I would have an headerrow and then insert a new GridViewRow object. But alas, I cannot add rows to the GridView.Row collection, it seems to be read only, and I don't see any AddRow or InsertRow (or AddItem, InserItem) methods. Anyone knows how to deal with this or have any links for me, ...

  1. #1

    Default Dynamically adding a row into an gridview

    Hi All,

    I want to dynamically add a row in my gridview. I want to have a row beneath
    my headerrow with dropdowns in it, which I can use to filter on that column.
    I thought the GridView.RowCreated event would be my friend, by checking
    there if I would have an headerrow and then insert a new GridViewRow object.
    But alas, I cannot add rows to the GridView.Row collection, it seems to be
    read only, and I don't see any AddRow or InsertRow (or AddItem, InserItem)
    methods.

    Anyone knows how to deal with this or have any links for me, since google
    wasn't much of a help this time? I really would like to use the gridview and
    not the datagrid now that I am working in asp.net 2.0.

    regards,
    Henk




    Henk Guest

  2. #2

    Default Re: Dynamically adding a row into an gridview

    what's with the cross posting? you can't be that desperate. asp.net 2.0
    problems belong in the asp.net 2.0 newsgroup

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP [url]http://mvp.support.microsoft.com/default.aspx][/url]
    Got tidbits? Get it here... [url]http://tinyurl.com/27cok[/url]
    "Henk" <SomeOnethe.Net> wrote in message
    news:uRetbCNoEHA.132TK2MSFTNGP14.phx.gbl...
    > Hi All,
    >
    > I want to dynamically add a row in my gridview. I want to have a row
    > beneath
    > my headerrow with dropdowns in it, which I can use to filter on that
    > column.
    > I thought the GridView.RowCreated event would be my friend, by checking
    > there if I would have an headerrow and then insert a new GridViewRow
    > object.
    > But alas, I cannot add rows to the GridView.Row collection, it seems to be
    > read only, and I don't see any AddRow or InsertRow (or AddItem, InserItem)
    > methods.
    >
    > Anyone knows how to deal with this or have any links for me, since google
    > wasn't much of a help this time? I really would like to use the gridview
    > and
    > not the datagrid now that I am working in asp.net 2.0.
    >
    > regards,
    > Henk
    >
    >
    >
    >

    Alvin Bruney [MVP] Guest

Similar Threads

  1. Question adding a new row before header column in gridview
    By Punitha in forum Brainstorming Area
    Replies: 0
    Last Post: December 14th, 01:28 PM
  2. ASP.NET 2 GridView: Adding rows
    By Edward in forum ASP Components
    Replies: 0
    Last Post: January 14th, 08:42 PM
  3. Newbie, adding a row to Gridview in VB
    By verci in forum ASP.NET Building Controls
    Replies: 0
    Last Post: August 28th, 06:46 AM
  4. Dynamically adding DSN?
    By Phyte@Omegabyte in forum Coldfusion - Advanced Techniques
    Replies: 1
    Last Post: July 6th, 12:03 PM
  5. asp.net 2.0 GridView adding data row?
    By rob merritt in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: April 13th, 07:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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