gridview bulk editing

Discussion in 'ASP .Net' started by Frenchie, Sep 23, 2006.

  1. Frenchie

    Frenchie Guest

    I have a Gridview with a checkbox on each row.

    I would like to be able to select 1 or more rows and edit one of the
    fields in each of these rows. Basically, I dont want my users to have
    to edit each row, one at a time. If I can make it so that they can edit
    on column for each row that they select I will be really happy.

    Right now I am using a session to pass some values to the other page,
    where I will be doing the editing, but I cannot pass the string that is
    stored in each one of the row...

    Once I have that figured out, I should be able to create a datasource
    that will query my database and return only the rows that are in my
    array that i am passing through the session value.

    Here is the code in my code behind page

    Protected Sub edit_jobs_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles edit_jobs.Click
    Dim selectedValues As ArrayList
    selectedValues = New ArrayList()

    'This will select multiple items

    For Each gvr As GridViewRow In GridView1.Rows

    Dim result As Boolean =
    (CType(gvr.FindControl("RowLevelCheckBox"), CheckBox)).Checked
    If (result) Then
    'below is the C# version of the code I would like in VB
    'int categoryID =
    Convert.ToInt32(((Label)row.FindControl("lblCategoryID")).Text);
    Dim line_numb As String
    'The next line is the one that I cannot get to work.
    line_numb = ("job_numb" + (selectedValues.Count +
    1).ToString).ToString.Trim

    selectedValues.Add(line_numb)
    End If
    Next

    ' Put the selected values in the Session to be used in a
    different page

    Session("SELECTEDVALUES") = selectedValues

    'transfer to a new page

    Response.Redirect("choose_press.aspx")
    End Sub


    can anyone help...
    Thanks
     
    Frenchie, Sep 23, 2006
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fred K. Augustine, Jr

    Editing with GridView control

    Fred K. Augustine, Jr, Nov 21, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,004
    Fred K. Augustine, Jr
    Nov 21, 2005
  2. misiek
    Replies:
    7
    Views:
    51,507
    Sri123
    Apr 8, 2011
  3. =?Utf-8?B?TWljaGFlbA==?=

    Gridview Newvalues are empy after editing

    =?Utf-8?B?TWljaGFlbA==?=, Apr 13, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    1,921
    =?Utf-8?B?TWljaGFlbA==?=
    Apr 13, 2006
  4. K B
    Replies:
    1
    Views:
    3,777
    Craig Deelsnyder
    Apr 19, 2006
  5. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    18,284
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  6. Replies:
    0
    Views:
    835
  7. BenG

    Bulk Updates to Rows on gridview won't work as specified?

    BenG, Aug 17, 2006, in forum: ASP .Net Datagrid Control
    Replies:
    2
    Views:
    386
    Walter Wang [MSFT]
    Aug 18, 2006
  8. VijayRama

    Bulk Editing in Gridview

    VijayRama, Jul 19, 2009, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    841
    Gregory A. Beamer
    Jul 19, 2009
Loading...