detailview insert if there is no record

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
 
M

Masudur

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top