Results 1 to 2 of 2

Thread: datagrid editing

  1. #1

    Thread Starter
    Frenzied Member EyeTalion's Avatar
    Join Date
    Jul 2000
    Location
    New York
    Posts
    1,075

    datagrid editing

    I have a data grid that gets filled with 3 fields. ID_NUM, DESCRIPTION, BUYER....and I also have an UPDATE button in my grid. I know you can edit right in the datagrid, but I have more fields for each record so I want to redirect the user to another page.

    How do I redirect the user to a new page using the UPDATE button in my grid and How do I carry a variable over to the new page?

    thanks,
    eye

  2. #2
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    use the hyperlink column, not the edit one

    <asp:HyperLinkColumn
    DataNavigateUrlField="Name"
    DataNavigateUrlFormatString="test_details.aspx?id={0}"
    Text="View"
    />


    DataNavigateUrlField is goiung to be the database field data that you want to pass to the page.


    DataNavigateUrlFormatString is the url to goto. See the id={0}? id is the querystring variable and {0} will be replaced with data from the column you specifiy in DataNaviagteUrlField

    then on the page it goes to, you can use Request.Querystring("id") to get the pass value. Preferably a unique identifier of the record you want to edit, so you can open a connection directly to that record on the new page.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

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