GridView insert button

Discussion in 'ASP .Net' started by shapper, Nov 13, 2007.

  1. shapper

    shapper Guest

    Hello,

    Is it possible to, instead of having the GridView Insert in each
    GridView row, have it before the GridView or maybe in the GridView
    footer?

    Thanks,
    Miguel
    shapper, Nov 13, 2007
    #1
    1. Advertising

  2. If you want to insert a row in the Grid then you can add a button in the
    footer of the grid in the rowcreated event and then

    Dim btnAdd As New LinkButton()
    btnAdd.Text = "AddNew"
    ' add a handler for the click event AddHandler btnAdd.Click,
    AddressOf AddNew_Click
    e.Item.Cells(0).Controls.Add(btnAdd)

    and put the grid in the edit mode

    Me.OleDbDataAdapter1.Fill(Me.DataSet21)
    Dim table As DataTable = Me.DataSet21.Tables(0)
    Dim row As DataRow = table.NewRow()
    row.EndEdit()
    table.Rows.Add(row)
    Me.gridview1.EditItemIndex = table.Rows.Count - 1
    Me.gridview1.DataBind()

    then you can enter your data and then update the grid with the update button
    and set its updatequery in the sqldatasource.

    Regards,
    Manish

    "shapper" wrote:

    > Hello,
    >
    > Is it possible to, instead of having the GridView Insert in each
    > GridView row, have it before the GridView or maybe in the GridView
    > footer?
    >
    > Thanks,
    > Miguel
    >
    >
    =?Utf-8?B?TWFuaXNo?=, Nov 15, 2007
    #2
    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. =?Utf-8?B?bWdvbnphbGVzMw==?=

    GridView Hierarchical View - Gridview in Gridview

    =?Utf-8?B?bWdvbnphbGVzMw==?=, May 9, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    17,962
    =?Utf-8?B?UGhpbGxpcCBXaWxsaWFtcw==?=
    May 9, 2006
  2. jobs

    gridview add / insert button

    jobs, Jan 26, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    1,326
  3. shapper
    Replies:
    4
    Views:
    10,434
    David
    Nov 20, 2008
  4. Feege
    Replies:
    0
    Views:
    449
    Feege
    Dec 20, 2005
  5. Replies:
    0
    Views:
    222
Loading...

Share This Page