/// <summary> /// binds datasource /// </summary> /// <param name="outVo"></param> private void BindDataSource(List <CustomerVo> outVo) { Customerdetails_dgv.AutoGenerateColumns = false; BindingSource targetWIPBindingSource = new BindingSource(outVo, null); if (targetWIPBindingSource == null || targetWIPBindingSource.Count == 0) { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); logger.Info(messageData); popUpMessage.Information(messageData, Text); return; } Customerdetails_dgv.DataSource = targetWIPBindingSource; Customerdetails_dgv.ClearSelection(); }
/// <summary> /// Fills all Customer records to gridview control /// </summary> private void GridBind(CustomerVo conditionInVo) { Customerdetails_dgv.DataSource = null; try { CustomerVo outVo = (CustomerVo)InvokeCbm(new GetCustomerMasterMntCbm(), conditionInVo, false); Customerdetails_dgv.AutoGenerateColumns = false; BindingSource bindingSource1 = new BindingSource(outVo.CustomerListVo, null); if (bindingSource1.Count > 0) { Customerdetails_dgv.DataSource = bindingSource1; colCustomerCode.SortMode = DataGridViewColumnSortMode.Automatic; } else { messageData = new MessageData("mmci00006", Properties.Resources.mmci00006, null); //Customer logger.Info(messageData); popUpMessage.Information(messageData, Text); } Customerdetails_dgv.ClearSelection(); Update_btn.Enabled = false; Delete_btn.Enabled = false; } catch (Framework.ApplicationException exception) { popUpMessage.ApplicationError(exception.GetMessageData(), Text); logger.Error(exception.GetMessageData()); } }