Posted 24 December 2018, 8:07 am EST
When I set the datasource I’m missing the configuration of the c1list like width, align and etc. I want to know how to keep the configuration.
Forums Home / ComponentOne / WinForms Edition
Posted by: eliseu on 24 December 2018, 8:07 am EST
Posted 24 December 2018, 8:07 am EST
When I set the datasource I’m missing the configuration of the c1list like width, align and etc. I want to know how to keep the configuration.
Posted 26 December 2018, 5:14 am EST
Hello,
C1List related size, dimensions, etc are not respective to the DataMode. Though the list is bound or unbound, I observe that the related dimensions do not change.
On executing the attached application, please observe the results in the Output window. These are the same when the list is unbound.
Kindly modify the sample to replicate the issue and share it back. This will help me assist you further.
Regards,
Esha
prj_C1List.zip
Posted 26 December 2018, 11:09 am EST
It’s the configuration of the columns of the c1list as DisplayColumns width, style e etc
Posted 26 December 2018, 11:24 am EST
Everytime that we update the datasource we have to configure again
example:
list.Splits(0).DisplayColumns(1).Width = 80
list.Splits(0).DisplayColumns(0).Style.HorizontalAlignment = C1.Win.C1List.AlignHorzEnum.Center
Posted 27 December 2018, 3:05 am EST
Hi,
Thanks for the explanation.
This is a default behaviour wherein the layout is reset to default values when DataSource is set. To avoid setting the values again, you can save the layout of the list before updating the DataSource and then load the layout again when the updation is complete. For this, SaveLayout and LoadLayout methods of C1List can be used as follows:
list.DataSource=dt
list.Splits(0).DisplayColumns(1).Width = 80
list.Splits(0).DisplayColumns(0).Style.HorizontalAlignment = C1.Win.C1List.AlignHorzEnum.Center
'Save layout
list.SaveLayout("layout.xml",false)
'Set updated data source
list.DataSource=dtNew
'Load layout
list.LoadLayout("layout.xml")
Hope it helps.
Regards,
Esha