我有一个具有某些控件的网格,在uigrid_databound中,我可以找到mastertableview项的第0列的控件“ uiID_0”。但是,当我尝试按保存按钮时,在保存功能中我找不到控件“ uiID_0”。这是代码
foreach (GridDataItem item in uiGrid.MasterTableView.Items)
{
if (item.ItemType == GridItemType.Item || item.ItemType == GridItemType.AlternatingItem)
{
HiddenField uiIndicatorID = item.FindControl("uiIndicatorID") as HiddenField;
for (int i = 0; i < uiGrid.MasterTableView.Columns.Count; i++)
{
HiddenField uiLocationID = item.FindControl("uiID_" + i.ToString()) as HiddenField;
RadNumericTextBox uiCurrencyBox = item.FindControl("uiCurrencyBox_" + i.ToString()) as RadNumericTextBox;
RadNumericTextBox uiInputBox = item.FindControl("uiInputBox_" + i.ToString()) as RadNumericTextBox;
RadNumericTextBox uiTravelDays = item.FindControl("uiTravelDays_" + i.ToString()) as RadNumericTextBox;
RadNumericTextBox uiTripsPerDay = item.FindControl("uiTripsPerDay_" + i.ToString()) as RadNumericTextBox;
RadNumericTextBox uiTripDistance = item.FindControl("uiTripDistance_" + i.ToString()) as RadNumericTextBox;
HiddenField uiRemarksBox = item.FindControl("uiRemarksBox_" + i.ToString()) as HiddenField;
我无法在保存功能中找到控件“ uiID_0”,但可以在数据绑定中找到它。我如何找出原因呢?两者是相同的代码 uigrid_databound和保存功能。是什么使该控件无法再找到?