private void populateListingGrid(){
try{
Dictionary<string, Object> responseMap = new Dictionary<string, object>();
PaginationList newContractDetailsListingMsDTO = getNewContractDetailsListingMsDTO();
ContractService createContractService = ContractServiceFactory.getInstance();
responseMap = createContractService.getContractListing();
contractList = responseMap["contractListingMsDTOs"] as List<NewContractListingMsDTO>;
this.newContractListingMsDTOBindingSource.Clear();
if (contractList != null && contractList.Count > 0)
{
newContractListingMsDTOBindingSource.DataSource = contractList;
newContractListDataGridView.Refresh();
}
}
catch (Exception e)
{
logger.Info("populateListingGrid");
}
}
I am using the newContractListingMsDTOBindingSource
as a bindingsource, which works perfectly fine when i open the datagrid for first time, when i try to reopen the datagridview in winforms, entire datagridview seems crashed nothing is visible not even the column header of the bindingsource.
Am i using all the binding source or binding data source code correctly?
After a lot of trial and error, i found the solution to the problem, it worked when i set the below property of the DataGridView
If i change this property to DisableResizing/EnableResizing the Datagridview gets hidden the 2nd time. The probelem is not with the BindingSource or Datasource directly.