我想知道当网格视图中有单选按钮并且此网格视图本身位于 1 个用户控件内且用户控件位于详细视图控件内时,我必须如何使用单选按钮 CheckedChanged 属性。
在我了解如何在另一个控件中找到单选按钮控件之前。但是在发现我不知道如何为此创建 CheckedChanged 属性之后?
protected void btnShowAddTransmittaltoCon_Click(object sender, EventArgs e)
{
Transmittallistfortest transmittalList = (Transmittallistfortest)DetailsView1.FindControl("Transmittallistfortest1");
GridView g3 = transmittalList.FindControl("GridViewTtransmittals") as GridView;
foreach (GridViewRow di in g3.Rows)
{
RadioButton rad = (RadioButton)di.FindControl("RadioButton1");
//Giving Error:Object reference not set to an instance of an object.
if (rad != null && rad.Checked)
{
var w = di.RowIndex;
Label1.Text = di.Cells[1].Text;
}