It depends on what kind of software methodology you want to use (I like MVVM with WPF) what kind of ORM(Linq, EF, Castle, etc.).
your could create a ViewModel like so:
public class UserViewModel
{
int UserId {get;set;}
Collection<Member> MemberList {get;set;}
}
public class Member
{
bool _IsMember;
bool IsMember
{get return _IsMember;set _IsMember = value; EditMemberStatus();}
int MemberId {get;set;}
string Member {get;set;}
void EditMemberStatus()
{
if (IsMember)
//Code to add row into db using your ORM choice
else
//Code to remove row from db
}
}
in your xaml you could do this:
<ListView ItemsSource={Binding MemberList}>
<ListView.View>
<GridView>
<GridViewColumn Header="IsMember"}>
<CheckBox IsChecked="{Binding IsMember}"/>
</GridViewColumn
<GridViewColumn Header=Member DisplayMemberBinding={Binding Member}/>
</GridView>
</ListView.View>
</ListView>
And finally in the code behind of your xaml you have this
public class UserView
{
UserView()
{
InitializeComponent();
DataContext= new UserViewModel();
}
}
This is just a skeleton, hope this helps. It's also only one way of a myriad of ways to do it.