detailview insert if there is no record

  • Thread starter Thread starter Ganesh
  • Start date Start date
G

Ganesh

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 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
 
Back
Top