Setting flield values with CRUD operations

3 posts, 0 answers
  1. zanekevin
    zanekevin avatar
    15 posts
    Member since:
    Oct 2012

    Posted 21 Jul 2011 Link to this post

    I am using the  <telerik:RadDataForm.EditTemplate> and <telerik:RadDataForm.NewItemTemplate>.
    I would like to set a couple of fields (MODIFIED_BY/TIMESTAMP) to the system date and modified_by user in the code behind before I do a DomainDataSource.SubmitChanges.
    I was thinking it would be in the event EditEnded to set the current record being edit to the updated time stamp.
    This is not that hard. Seems that I am just plexed in Silverlight/WCF RIA Services.
    Mayby I am still thinking asp.net
  2. Ivan Ivanov
    Admin
    Ivan Ivanov avatar
    1128 posts

    Posted 22 Jul 2011 Link to this post

    Hi Zanekevin,

    Please, refer to this demo. It illustrates utilization of RadDataForm with RIA and RadDomainDataSource. I think it might prove useful to you. Please, do not hesitate to contact us immediately if any further inquires occur.

    All the best,
    Ivan Ivanov
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  3. DevCraft banner
  4. zanekevin
    zanekevin avatar
    15 posts
    Member since:
    Oct 2012

    Posted 22 Jul 2011 Link to this post

    I did see this DEMO. I does not address the issue of setting a EDIT CurrentItem to a default value, so the User on the Client does not enter the data.

    But Still confused on how to set a couple of fields values on UPDATING OR INSERTING data using the RadDataForm in the CODE BEHIND Events of the ADD/EDIT of the RadDataForm.

    From my Entity (bottom) CurrentItem the two fields that the user will not Add or Edit would be the 'MODIFIED_BY' and 'TIME_STAMP', Iwould like to set field values before a DomainDataService.SubmitChanges()

    My thoughts on how this works in a sample below is:

    private RadDataForm_EndEditing(object sender, Telerik.Windows.Controls.Data.DataForm.EditEventsArgs e)
    {
        MyRadDataForm.[MODIFIED_BY] = 'John Doe';
        MyRadDataForm.[TIME_STAMP] = DateTime.now();
        DomainDataService.SubmitChanges();

        OR

        MyRadDataForm.CurrentItem.MODIFIED_BY = ' = 'John Doe';
        MyRadDataForm.CurrentItem.TIME_STAMP = DateTime.now();
        DomainDataService.SubmitChanges();
    }

    /* Entity */

    CREATE

     

     

    TABLE BENEFITS_MSTR (

     

    REC_ID

     

    NUMBER,

     

    ORG_ID

     

    VARCHAR2(15 BYTE),

     

    LBR_GRP

     

    VARCHAR2(3 BYTE),

     

    MODIFIED_BY

     

    VARCHAR2(30 BYTE),  -- User does not touch this field, information display only

     

    TIME_STAMP

     

    DATE          -- User does not touch this field, information display only

     

    )

Back to Top