Hello,
i run into a problem about conditional binding properties. I want certain properties only writeable on creating an entity, but not on editing. Generally i can fix it on server side by just adding code to check it or just not bind some properties. But how i can solve this on client side? Let's take the following example:
Data model ->
public
classs MyDataModel
{
[ScaffoldColumn(
false
)]
public
long
Id {
get
;
set
; }
[Required(AllowEmptyStrings =
false
)]
[StringLength(255)]
[DisplayName(
"Title"
)]
public
string
Title {
get
;
set
; }
[Required(AllowEmptyStrings =
false
)]
[StringLength(255)]
[DisplayName(
"Description"
)]
public
string
Description {
get
;
set
; }
[Required(AllowEmptyStrings =
false
)]
[DisplayName(
"Type"
)]
[DefaultValue(1)]
public
int
TypeOfSomething {
get
;
set
; }
}
So "TypeOfSomething" should be only writeable on creating the entity. On later editing it should be read only. There is an interesting approach in this comment http://www.codethinked.com/aspnet-mvc-think-before-you-bind/comment-page-1#comment-3933, but i don't see any way to realize this with the Telerik Grid.
Maybe one of you guys have an idea or some hints for achieving this on client side with the Telerik Grid.
thanks & regards