Link to home
Start Free TrialLog in
Avatar of rishaan
rishaan

asked on

Windows forms databound datagridview: editable as well as noneditable

My datagridview has to have noneditable rows except for the ones that are new.
I have set AllowUsersToAddRows true for the grid. This adds a row at the bottom and user can enter the data. I want the new rows to be editable. Also the copy and pasted rows should be editable. So I added a flag to the database . If this flag is 'Y' I want to make those rows noneditable but for the new rows I want to initially set the flag to 'N'.
In which datagridview event  should I set if flg="N" the datagridview.currentrow.Readonly=false ;
I am a newbie...please help..
Avatar of surajguptha
surajguptha
Flag of United States of America image

Hey Rishaan,
 I read your question "Windows form databound datagridview:Add row functionality" too. Try not to add it in the database. Just add a column called "Flag" or "IsEditable" to the datatable that is fetched. Just wanted to quicly let you know this. Changing the data base schema everytime to achieve something like this could become messy .....

And to answer your question abt the datagrid event, gimme a min :)
ASKER CERTIFIED SOLUTION
Avatar of surajguptha
surajguptha
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hope this helps solve both ur questions :)