Access to Rows in a datagrid

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Access to Rows in a datagrid

    I am working on a page to allow editing of products in out database. I'd
    like to bind a datareader to the table. And on submit generate an update
    query for each row. My problem is that I can't find out how to iterate
    through all the rows in the dataGrid

    I don't want to use the built in edit mode available because there are going
    to be allot of small changes and would be time consuming to hit edit for
    each row.



    I'm hoping that I can do something like this



    For each row in datagrid

    value1 = row.textBox1.value

    value2 = row.textBox2.value

    ' sql work

    Next




    Robin Bonin Guest

  2. Similar Questions and Discussions

    1. Number of rows in a datagrid
      I discovered the hard way that the property "VisibleRowCount" of a datagrid is ONLY that, the number of visible rows, NOT the number of populated...
    2. DataGrid Reorder Rows
      here is a function I wrote to reorder rows in a datagrid. I call it with two buttons, up and down both with click events like so:...
    3. Select datagrid rows with key-up and key-down?
      I have an application that uses a windows forms datagrid. How do I select rows using the up-arrow and down-arrow keys? Mervin Williams
    4. Two rows for each record in DataGrid
      Hello all, I have posted similar question in another group a while ago (before this group came into existence) but would like to double-check on...
    5. Adding rows to a Datagrid
      Jason, Thanks for the reply. Yes... it would be possible... but I also don't want to commit deletes/changes to the child records until they are...
  3. #2

    Default Re: Access to Rows in a datagrid

    Sounds like you want the DataGridItem object.

    For Each item as DataGridItem in gridMain.Items
    ' do stuff
    Next

    HTH,

    --Jon

    "Robin Bonin" <robin@guavatools.com> wrote in message
    news:ZXednQ98YeZaGJCiXTWJiA@eatel.net...
    > I am working on a page to allow editing of products in out database. I'd
    > like to bind a datareader to the table. And on submit generate an update
    > query for each row. My problem is that I can't find out how to iterate
    > through all the rows in the dataGrid
    >
    > I don't want to use the built in edit mode available because there are
    going
    > to be allot of small changes and would be time consuming to hit edit for
    > each row.
    >
    >
    >
    > I'm hoping that I can do something like this
    >
    >
    >
    > For each row in datagrid
    >
    > value1 = row.textBox1.value
    >
    > value2 = row.textBox2.value
    >
    > ' sql work
    >
    > Next
    >
    >
    >
    >

    Jon Sequeira 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