![](/img/trans.png)
[英]How can i replace the value of checked radio button from a LIST whenever i change my option from yes to no vice versa in UWP
[英]How can I switch radio button to yes or no without selection
我正在写一个像这样的条件:
if (dt > 0)
{
objinvoice.editInvoice(strInvoice, strRenew, strExpiry);
GridView1.EditIndex = -1;
bindGrid();
}
如果该单选按钮最初设置为false并且条件为true,则我将在gridview中有一个单选按钮,我想将其设置为true...。
您可以在gridview itemdatabound事件中执行此操作。 您可以检查条件并更改单选按钮的状态。
Gridview ItemDataBound示例:
private void DataGrid1_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
if(e.Item.ItemType==System.Web.UI.WebControls.ListItemType.EditItem)
RadioButton rBtnTest = e.Item.FindControl("radiobutton id") as RadioButton;
// Check condition and if it's true
if(your_condition == true)
rBtnTest.Checked = true;
else
rBtnTest.Checked = false;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.