detailview insert if there is no record

Discussion in 'ASP .Net' started by Ganesh, Jul 25, 2007.

  1. Ganesh

    Ganesh Guest

    Hi There,

    I use detailView to edit, insert and delete data. It gets value from
    datagrid.selectedvalue. How can i insert a record initially. If there is not
    any record in the grid, still i would like to have Insert from details view.

    can i do this, please advise me

    Thanks
    Ganesh
    Ganesh, Jul 25, 2007
    #1
    1. Advertising

  2. Ganesh

    Masudur Guest

    On Jul 26, 1:06 am, "Ganesh" <> wrote:
    > Hi There,
    >
    > I use detailView to edit, insert and delete data. It gets value from
    > datagrid.selectedvalue. How can i insert a record initially. If there is not
    > any record in the grid, still i would like to have Insert from details view.
    >
    > can i do this, please advise me
    >
    > Thanks
    > Ganesh


    hi...

    check wheither your datagrid's row count is zero or not... and then
    switch your detailview controls defaultmode to insert...

    if (GridView1.Rows.Count==0)
    {
    DetailsView1.DefaultMode = DetailsViewMode.Insert;
    }

    Thanks
    Md. Masudur Rahman (Munna)
    Kaz Software Ltd.
    www.kaz.com.bd
    http://munnacs.110mb.com
    Masudur, Jul 26, 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. Kha Tran
    Replies:
    0
    Views:
    550
    Kha Tran
    Jun 3, 2005
  2. =?Utf-8?B?SGF3aw==?=
    Replies:
    0
    Views:
    628
    =?Utf-8?B?SGF3aw==?=
    May 3, 2006
  3. Frits van Soldt

    How to insert a new record in detailsview when there are no record

    Frits van Soldt, Nov 16, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    734
    Frits van Soldt
    Nov 17, 2005
  4. Navin Mishra

    How to disable adding a new record in DetailView

    Navin Mishra, Aug 17, 2009, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    674
    Navin Mishra
    Aug 17, 2009
  5. Guest
    Replies:
    1
    Views:
    255
    Alex G
    Jan 9, 2004
Loading...

Share This Page