TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vikas Ahlawat
NA
564
818k
RadioButton control in every row of the GridView control to select one row at a time?
Feb 17 2011 11:54 PM
I have taken RadioButton control in every row of the GridView control to select one row at a time. (asp.net C#)
for this i write the following code, But it is slow process, I want to best way to do this
protected void RadioButton1_CheckedChanged1(object sender, EventArgs e)
{
RadioButton SelectedRadioButton = (RadioButton)sender;
for (int i = 0; i < GridView1.Rows.Count; i++)
{
RadioButton rb = (RadioButton)GridView1.Rows[i].FindControl("RadioButton1");
rb.Checked = false;
}
GridViewRow SelectedGridRow = (GridViewRow)SelectedRadioButton.NamingContainer; //for get the index of selected row
int RowIndex = SelectedGridRow.RowIndex;
RadioButton rb1 = (RadioButton)GridView1.Rows[RowIndex].FindControl("RadioButton1");
rb1.Checked = true;
}
is there any suggestion?
Reply
Answers (
5
)
CellEndEdit and move to another cell at same row
DO Not prompt to save exe in Browser in C#