By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,666 Members | 1,909 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,666 IT Pros & Developers. It's quick & easy.

detailview insert if there is no record

P: n/a
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
Jul 25 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Jul 26, 1:06 am, "Ganesh" <gsgan...@yahoo.comwrote:
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

Jul 26 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.