TechTalkz.com Logo

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Programing Languages > C#(C Sharp)

Notices

Reply
 
Thread Tools Display Modes
Old 15-12-2007, 02:27 AM   #1
GS
Guest
 
Posts: n/a
form detailview question

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 for new record to let user to
fill it. On the other hand I don't want to allow change to the field for
existing record. so disable that on existing non new record. How do I do
that?


I notice the property of the fields are enabled in the form design, but
could not find any code for disable them.


  Reply With Quote
Old 15-12-2007, 03:27 AM   #2
Bob Powell [MVP]
Guest
 
Posts: n/a
Re: form detailview question

Are you sure that allowing the user to fill the primary key is a good idea?
These are often left to the database and the insert statement will often
accept all fields _except_ the primary key which is often, by convention,
autogenerated.

--
--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.


"GS" <gsmsnews.microsoft.comGS@msnews.Nomail.com> wrote in message
news:eRPPE2oPIHA.3556@TK2MSFTNGP03.phx.gbl...
> 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 for new record to let user to
> fill it. On the other hand I don't want to allow change to the field for
> existing record. so disable that on existing non new record. How do I do
> that?
>
>
> I notice the property of the fields are enabled in the form design, but
> could not find any code for disable them.
>
>


  Reply With Quote
Reply

Thread Tools
Display Modes


Google
 


All times are GMT +5.5. The time now is 06:18 AM.


vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2008, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional