hidden columns that contain a "key" field

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

  1. #1

    Default hidden columns that contain a "key" field


    I've seen several examples where people include a "key" column in the
    datagrid so that they know which row to update during the update phase.

    The examples I've seen look like this:

    <asp:BoundColumn Visible=True DataField="ID"
    HeaderText="ID"></asp:BoundColumn>

    When I do this in my own form, the column is not only not visible, but it is
    not sent to the browser.

    How can I get it to be sent, but remain hidden?


    Boban Dragojlovic Guest

  2. Similar Questions and Discussions

    1. "Page" and "Rect" props of the Field prop in Javascript API
      Page property of the Field property in Javascript Acrobat API returns an array of pages that this field exists in. On the other hand, "rect" property...
    2. "Deleted Hidden Page And Image Content" - Doesn't work?
      Hi All Whenever I try and crop a PDF all the cropped information is still in the document. Granted it is hidden/masked but it is still there. When...
    3. Compare 2 fields & delete everything in "field 2" that occurs in "field 1"
      Is it possible to compare 2 fields and delete everything in "field 2" that also occurs in "field 1" ? FIELD1 800-555-1212 for...
    4. Request.Form("Field Name") Versus Request.QueryString("Field Name")
      I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the...
    5. dr("field").toString returns "400.0000" instead of "400"
      I have just installed VS.NET 2003 on my computer. I have a project that I have been developing on VS.NET 2002. I haven't upgraded this project to...
  3. #2

    Default Re: hidden columns that contain a "key" field

    You didnt include runtat attribute for boundcolumn, if didnt include that it
    wont get processed in server. Include that see, it should work.

    --
    Saravana
    Microsoft MVP - ASP.NET
    [url]www.extremeexperts.com[/url]



    "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    news:k%yhb.13452$xL7.7440@newssvr25.news.prodigy.c om...
    >
    > I've seen several examples where people include a "key" column in the
    > datagrid so that they know which row to update during the update phase.
    >
    > The examples I've seen look like this:
    >
    > <asp:BoundColumn Visible=True DataField="ID"
    > HeaderText="ID"></asp:BoundColumn>
    >
    > When I do this in my own form, the column is not only not visible, but it
    is
    > not sent to the browser.
    >
    > How can I get it to be sent, but remain hidden?
    >
    >

    Saravana [MVP] Guest

  4. #3

    Default Re: hidden columns that contain a "key" field

    Boban,

    Like Saravana states, you must have the runat attribute set on the datagrid.
    Then under the <Columns> tag, include a
    <asp:BoundColumn Visible=False DataField="ID"></asp:BoundColumn>
    You must have a field in whatever you used to bind to the grid called "ID".
    If that field does not exist, you will either get an error or the field will
    not be included.

    If you are wanting to include the "ID" value appended to an URL that the
    user clicks, use the following code:
    <asp:TemplateColumn HeaderText="SomeText">
    <ItemTemplate>
    <a href=http://www.yoursite.com/application/page.aspx?id= <%#
    DataBinder.Eval(Container.DataItem, "ID") %> >Some Text</a>
    </ItemTemplate>
    </asp:TemplateColumn>

    That should get you started. Please post any questions.

    Thanks,

    Brian

    "Saravana [MVP]" <saravank@sct.co.in.nospam> wrote in message
    news:%23do9XXHkDHA.1808@TK2MSFTNGP09.phx.gbl...
    > You didnt include runtat attribute for boundcolumn, if didnt include that
    it
    > wont get processed in server. Include that see, it should work.
    >
    > --
    > Saravana
    > Microsoft MVP - ASP.NET
    > [url]www.extremeexperts.com[/url]
    >
    >
    >
    > "Boban Dragojlovic" <news@_N_O_S_P_AM_dragojlovic.org> wrote in message
    > news:k%yhb.13452$xL7.7440@newssvr25.news.prodigy.c om...
    > >
    > > I've seen several examples where people include a "key" column in the
    > > datagrid so that they know which row to update during the update phase.
    > >
    > > The examples I've seen look like this:
    > >
    > > <asp:BoundColumn Visible=True DataField="ID"
    > > HeaderText="ID"></asp:BoundColumn>
    > >
    > > When I do this in my own form, the column is not only not visible, but
    it
    > is
    > > not sent to the browser.
    > >
    > > How can I get it to be sent, but remain hidden?
    > >
    > >
    >
    >

    bspann Guest

  5. #4

    Default hidden columns that contain a "key" field

    Very informative post. It's really helpful for me and helped me lot to complete my task. Thanks for sharing with us. I had found another nice post over the internet which was also explained very well about Populate Grid Control From XML Document Easily, for more details of this post check out this link.
    Thanks everyone for your precious post!!
    Pravesh Singh 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