This is a migrated thread and some comments may be shown as answers.

[Solved] Conditional Editing for Grid

0 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kapil Koli
Top achievements
Rank 1
Kapil Koli asked on 10 Mar 2010, 01:48 PM

Hi,
    I want to show textbox for selective rows in my grid for editing.
    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 solution for this?

Thanks,
Kapil

Tags
Grid
Asked by
Kapil Koli
Top achievements
Rank 1
Share this question
or