473,404 Members | 2,213 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

detailview insert if there is no record

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
1 2451
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Kha Tran | last post by:
Please give me a sample of using xpo objectdatasource gridview detailview for select,insert,update and delete Thanks -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
0
by: Mike | last post by:
I have a detailview, with several template columns in it. It's setup so that a user views info from a datagrid, and if they want to add another row, they click a button. The button causes a...
0
by: Henry Lee | last post by:
HI, all I am new to ASP 2.0 and I am trying hard to learn all objects of ..net. I keep got a error when I try to update a record in dataDetailView Object which using objectdatasource and DataSet....
0
by: strJulioNegron | last post by:
I have page with a gridview bound to a table. when a row is selected it uses the detailview to display more info and to consequently edit or add data. the problem is that when I go to add new data...
2
by: momo | last post by:
Guys, I am trying to created a detailview that displays several records at a time. Let's say I have a GridView with checkboxes and when I check two checkboxes and click a button, I want it to...
0
by: webmaster | last post by:
I've been playing around with asp.net 2.0/vs.net 2005/C# 2005 - I had a few noob questions. 1. Is there a setting that sets all current and future controls on a page to position absolutely...
0
by: Deepak Palkar | last post by:
Hi I have Gridview and DetailView both on one page. I am showing the list in the Gridview and the particular record in DetailView. the problem is When i EDIT on the DetailView and try to UPDATE...
2
by: Luqman | last post by:
Hi, Any Idea how to Display Todays Date in DetailView Template Field while Inserting ? For example: When I click on New Button of DetailView Control, I need to display Today's Date in a...
4
by: GS | last post by:
in Windows form, I have Datagridview and detailview with the same binding data manager. upon clicking the + in the navigator, the primary key field is blank as expected, but I need to enable it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.