Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
25
Add new record template
posted

Is there a way to template add new record row?

I have an entity with a primary key column and a type column which are set to read only and a few other columns which are editable.

class Mammal

{

    string ID{get;set;}

    Type{get;set;}  // only Two options : Animal, Human

    double Weight{get;set;}

    int age{get;set;}

    string Description{get;set;}

}

 I need the ID and Type as read only even in the add new row. For some screens, I need enter only humans. For those screens, I'm trying to prefill the add new row with ID as "NEW" and Type as "Human", both read only and not allowing the user to type in those columns. The only way so far I found was to initialize the fields in the default constructor, but even then, the fields are editable.

1. How can I make a column readonly in add new row?

2. How can I prefill values in add new row for the above read only columns?

 

Parents Reply Children