How to get various controls in DataGrid and values

xiaoxiao2021-03-06  88

Foreach (DataGridItem I in MyDataGrid.Items) {Checkbox = (Checkbox) I.FindControl ("SelectCheckBox"); // selectcheckbox is the ID of the control

If (checkbox.checked) {type = mydatagrid.items [index] .Cells [1] .Text; // DataGrid's value Items- row cells-column DropdownList = (DropDownList) I.FindControl ("Subtype "); Subtype = DropdownList.SelectedItem.Value.toString (); // Extract the index of the drop-down box to select the value of the value to get the value}

INDEX = 1;}

转载请注明原文地址:https://www.9cbs.com/read-122297.html

New Post(0)