views:

83

answers:

0

How can we apply editor templates to selective rows in a grid? I want to show text box while editing for particular rows.

I am using telerik grid.

I have used [ReadOnly(true)] attribute for my class member and hence it's not showing me it as editable, which is obviously intended. But for selective rows, I want to show text box in my grid for this value editing.

My class which is bound to grid is as follows-

public class Info
  {
    [ReadOnly(true)]
    [Required]
    [DisplayName("Name")]
    public string Name { get; set; }


    [Required]
    [DisplayName("Description")]
    public string Description { get; set; }


    [Required]
    [UIHint("Status")]
    [DisplayName("Status")]
    public bool IsStatusEnabled { get; set; }
}

I want to show text box for editing Name if the IsStatusEnabled is true, otherwise I want to keep it read only.

Is there any way?

Thanks, kapil