Tech
Forums
Jobs
Books
Events
Live
Interviews Prep
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
2
Reply
populate data from listview to radiobutton?
Sakthis
Oct 11 2013 3:53 PM
1.1k
Reply
Hi,
How to populate listview data to radio button like gender column?
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?
can u anyone help me?
here my code:
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;
}
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
2
)
Next Recommended Forum
Accessing Network Profile Information in Windows Store Apps
setup & deploy software