Forum guidelines
AuthorQuestion
radio button
Posted By Amar Sharma on 14 Oct 2013
how to show the result in Radio Button from database.
I wants to show the gender in  radiobutton but that should be retrieved from database.

AuthorReply
Re: radio button
Posted By Sakthis on 14 Oct 2013  
May this task helpful for u:-

if (listView1.SelectedItems.Count > 0)
            {
                ListViewItem lvi = listView1.SelectedItems[0];
                txtEmpCode.Text = lvi.SubItems[0].Text;
                txtName.Text = lvi.SubItems[1].Text;
                if (lvi.SubItems[2].Text == "Male")
                {
                    Male.Visible = true;  //Male is Radio Button
                    Female.Visible = false;  //Female is Radio Button
                }
                else if (lvi.SubItems[2].Text == "Female")
                {
                    Male.Visible = false;  //Male is Radio Button
                    Female.Visible = true; //Female is Radio Button
                }
            }
            else
            {
                txtEmpCode.Text = string.Empty;
                txtName.Text = string.Empty;               
            }   



Download Free E-books

SPONSORED BY

JetBrains ReSharper Ultimate
.NET code analysis, refactorings, navigation, unit testing, code coverage and profiling in Visual Studio, a bonus for C++ devs, bundled at 50% off.