This question is locked. New answers and comments are not allowed.
I have a RadGrid on a page...reading classes generated by Telerik via reverse-mapping. The database table for this specific object has Created and Updated columns, which are Non-Null DateTime. When the grid displays the items, it shows the Created and Updated properties...
I have set the Created and Updated columns in RadGrid to ReadOnly=True, so that a user cannot edit them nor see them when inserting or editing. Hence, they will not display on the Add New Record form. The problem is that I need the properties of the object that Telerik ORM is inserting to default to the current date/time. I've tried the following:
1. Setting the _Created and _Updated aliases in the object.vb file if there is a Null or Nothing, didn't work.
2. Set the values on the Public Sub New() of the object, didn't work.
3. Set the textbox values during the RadGrid_ItemCreated event...didn't work, in fact it didn't even show up on the Insert Form (Add New Record) when I didn't have the two columns ReadOnly=True. The textboxes were blank, which I thought was odd.
4. Tried getting the object during the OpenAccessDataSource_Inserting event; seems to be impossible. I've used that technique many times when using an ObjectDataSource, but the OpenAccessDataSource doesn't seem to support this.
All of the above would be OK at best, if they did work. What I would like is for the object itself to know that it needs to set these properties to Now() when they don't have any values. I usually handled this in the Facade (middle-tier) on other applications, so that the date/time values were always consistent and not reliant upon the client machine or the web server. I do not wish to create a Facade for this lightweight application, so...
Thanks,
Mitch
I have set the Created and Updated columns in RadGrid to ReadOnly=True, so that a user cannot edit them nor see them when inserting or editing. Hence, they will not display on the Add New Record form. The problem is that I need the properties of the object that Telerik ORM is inserting to default to the current date/time. I've tried the following:
1. Setting the _Created and _Updated aliases in the object.vb file if there is a Null or Nothing, didn't work.
2. Set the values on the Public Sub New() of the object, didn't work.
3. Set the textbox values during the RadGrid_ItemCreated event...didn't work, in fact it didn't even show up on the Insert Form (Add New Record) when I didn't have the two columns ReadOnly=True. The textboxes were blank, which I thought was odd.
4. Tried getting the object during the OpenAccessDataSource_Inserting event; seems to be impossible. I've used that technique many times when using an ObjectDataSource, but the OpenAccessDataSource doesn't seem to support this.
All of the above would be OK at best, if they did work. What I would like is for the object itself to know that it needs to set these properties to Now() when they don't have any values. I usually handled this in the Facade (middle-tier) on other applications, so that the date/time values were always consistent and not reliant upon the client machine or the web server. I do not wish to create a Facade for this lightweight application, so...
Thanks,
Mitch