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. Advertising

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. Prasad Dannani

    Bulk Import - Thread was being Abort

    Prasad Dannani, Sep 1, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    511
    Prasad Dannani
    Sep 1, 2005
  2. Greg H

    bulk loading with DBI

    Greg H, Jul 17, 2003, in forum: Perl
    Replies:
    1
    Views:
    1,893
    AdrianK
    Jul 17, 2003
  3. Replies:
    0
    Views:
    561
  4. 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:
    241
    Walter Wang [MSFT]
    Aug 18, 2006
  5. VijayRama

    Bulk Editing in Gridview

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

Share This Page