![]() |
|
|
#1 |
|
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. |
|
|
|
#2 |
|
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. > > |
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|