I have a collection in my C# code
private ObservableCollection<UserForms> _userForms =
new ObservableCollection<UserForms>();
public ObservableCollection<UserForms> UserForms { get { return _userForms; } }
I am filling collection with 4 values
foreach (DataRow dr in DataTable.Rows)
{
UserForms.Add(new UserForms()
{
FormID = Convert.ToInt32(dr["FormID"]),
FormName = dr["FormName"].ToString(),
FromSyName = dr["FormSyName"].ToString(),
Visibility = false,
RoleAdd=false,
RoleEdit=false,
RoleDelete=false
});
}
I am filling this in Form_Load() event
Now I want to update
Visibility = true,
RoleAdd=true,
RoleEdit=true,
RoleDelete=true
in specified row in the collection.
You simply need to do the following:
where “[0]” is the index.