I have listview like id, name, gender, i easily populate id, name respectivly to textbox but i am not sucess when i populate gender(male, female) field to radio button?
private void listView1_SelectedIndexChanged(object sender, EventArgs e)
{
if (listView1.SelectedItems.Count > 0)
{
ListViewItem lvi = listView1.SelectedItems[0];
txtEmpCode.Text = lvi.SubItems[0].Text;
txtName.Text = lvi.SubItems[1].Text;
if (Male.Text == "Male") // Male is radio button name
{
Male.Visible = true;
Female.Visible = false;
}
else if (Female.Text == "Female") // Female is radio button name
{
Male.Visible = false;
Female.Visible = true;
}
}
else
{
txtEmpCode.Text = string.Empty;
txtName.Text = string.Empty;
}
}