Click here to Skip to main content
15,914,419 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have been trying to use the GridView control of .Net.
I use the ObjectDataSource, and try to use the Update.

If I don't make any changes to the gridview the Update is working correctly. But when I set one of the fields to ReadOnly it gives error.

I have a TimeStamp field which holds the last update time of the record, so I have to make it ReadOnly to the user and also update it with System.DateTime.Now value.

Is there a way to set this value?

Thanks in advance,
codddy
Posted

1 solution

Hi
You can set readonly attribute from server side

C#
txtValidTill.Attributes.Add("readonly", "readonly");


Please do let me know, if you have any doubt.

Please provide "Vote":thumbsup: if this would be helpful, and make "Accept Answer" if this would be correct answer.:rose:

Thanks,
Imdadhusen
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900