Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I have a gridview with radiobutton columns. on button click on want to check which row is selected and get it's cell values.
Posted

As i understand your question. On button click event
For getting the selected row in grid view you can use "SelectedRow" property of the gridview.
C#
if (GridView1.SelectedRow != null)
            {
                GridViewRow grdrow = GridView1.SelectedRow;
                string selectrowcellvalue = grdrow.Cells[0].Text;
            }

and you can also find the control of the selectedrow by using the "GridView1.SelectedRow.Findcontrol("ControlId")".
 
Share this answer
 
Create a property of Binding Members Validate it using " IDataErrorInfo"
here is sample code.. to do it..
(Dont Forget to inherit ": IDataErrorInfo")

public string Error
{
get
{
throw new NotImplementedException();
}
}
public string this[string propertyName]<br />
   {<br />
       get<br />
       {<br />
           string Result = null;<br />
           switch (propertyName)<br />
           {<br />
               case "PROPERTY NAME":<br />
                   // Query string to check<br />
                   // Set message to Result <br />
                   break;<br />
               case "PROPERTY NAME":<br />
                 // Query string to check<br />
                 // Set message to Result <br />
                   break;<br />
              default:<br />
                   // Query string to check (Return blank string)<br />
                   break;<br />
           }<br />
           return validationResult;<br />
       }<br />
   }<br />

}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900