private void ObjectListView_DeviceList_ItemCheck(object sender, ItemCheckEventArgs e) { // first of all, if user tries to check mark item which files were NOT loaded yet, // show warning and don't allow user to check mark ObjectListView olv = sender as ObjectListView; DeviceListViewItemModel item = olv.GetModelObject(e.Index) as DeviceListViewItemModel; if (item != null) { if (string.IsNullOrEmpty(item.DeviceName)) { if (!_suppressErrorMessage) { MessageBoxUtil.ShowError(this, ErrorMessages.MISSING_FILES); } e.NewValue = CheckState.Unchecked; } } }
public void RenderDeviceSearchResult() { this.objectListView_DeviceList.SetObjects( DeviceList ); // disable row if device name doesn't exist foreach (Object item in this.objectListView_DeviceList.Objects) { DeviceListViewItemModel model = item as DeviceListViewItemModel; if (model != null) { if (string.IsNullOrEmpty(model.DeviceName)) { // force disable row. this.objectListView_DeviceList.DisableObject(item); } } } if (this.objectListView_DeviceList.GetItemCount() == this.objectListView_DeviceList.CheckedObjects.Count) { this.objectListView_DeviceList.CheckHeaderCheckBox(olvColumnContent_TeamId); } }