Jump to content
Xtreme .Net Talk

Change Readonly columns on Datagridview to Updateable when Adding New Row


Recommended Posts

Posted

I have a datagridview on a Windows form. The first 2 columns are the key fields for the table in the database, so I have have them formatted on the grid as ReadOnly. However, I need to make them editable when adding a new row. Can someone advise me as to how this can be done.

Thanks

Guha

Posted

I don't think you really want to do that, do you? You shouldn't allow the user to edit the "key" fields. The "key" fields should only be changed through communication with the database, or in the DataTable through code that you write.

 

Todd

Posted

Well, It is not a key field like an ID. However it does need to be populated. For example if we have table like Customer and a table Order. The Order while populating the Order table we will need to populate the Customer# as the foreign key. The would have to be a user selected/entered field.

Thanks

Guha

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...