我想在特定條件(標誌)上使某些單元格只讀。但我有問題來設置確切的條件。我有一個非空位列,並試圖設置其值的條件。 這裏是我的代碼:在ultragrid中獲取特定單元格值的條件
private void grdOtherItemsInfo_InitializeLayout(object sender, InitializeLayoutEventArgs e)
{
UltraGridBand band;
try
{
band = e.Layout.Bands[0];
band.ColHeaderLines = 2;
foreach (UltraGridRow row in **can't find right option**)
{
if (row.Cells[OtherItemStoreRequisitionForBatchChild.IsAutoDispense].Value.ToString() == "1")
{
band.Columns[OtherItemStoreRequisitionForBatchChild.IsAutoDispense].CellActivation = Activation.ActivateOnly;
band.Columns[OtherItemStoreRequisitionForBatchChild.IndentedUOM].CellActivation = Activation.ActivateOnly;
band.Columns[OtherItemStoreRequisitionForBatchChild.IndentedQty].CellActivation = Activation.ActivateOnly;
}
}
}
grdOtherItemsInfo.Rows? – Steve
@Steve grdOtherItemsInfo.Rows沒有工作,因爲有超過1個e.layout.bands索引,我沒有在這裏提到。無論如何非常感謝。我得到了一個解決方案,我添加了一個答案。 – Mimi