The CheckEdit is always unchecked in the edit form when Visible = false
Steps to Reproduce:
Place a CheckEdit on an ASPxTreeList
Set Visible = false
Set EditFormSettings.Visible = true
Actual Results:
checkbox always unchecked
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Hi Andreas,
I'm afraid I can't reproduce this issue. I have prepared a sample project (it uses the standard Northwing DB), which works fine for me. It is attached. Please modify it to reproduce the issue, and attach it to your next post.
Note, the current DXperience version is 8.3.4. We recommend that you update your installation.
Thanks,
Michael.
Hello Michael,
I think it has something with the DataProvider todo I am using.
My project uses the DevArt Mysql provider.
My code in the treeview is:
<dxwtl:TreeListCheckColumn Caption="Featuren" FieldName="dc_feature"
Visible="False" VisibleIndex="2">
<PropertiesCheckEdit ConvertEmptyStringToNull="False" ValueChecked="1"
ValueType="System.Int32" ValueUnchecked="0">
</PropertiesCheckEdit>
<EditFormSettings Visible="True" />
</dxwtl:TreeListCheckColumn>
Then I checked some code in a GridView where I did never have this problem:
<dxwgv:GridViewDataCheckColumn Caption="Aktiv" FieldName="se_active"
VisibleIndex="3" Visible="False">
<PropertiesCheckEdit ConvertEmptyStringToNull="False" ValueChecked="1"
ValueType="System.Int32" ValueUnchecked="0">
</PropertiesCheckEdit>
<EditFormSettings Visible="True" />
</dxwgv:GridViewDataCheckColumn>
It seemts that TreeListCheckColumn does not behave like GridViewDataCheckColumn at least with the mysql provider
Hi Andreas,
The ASPxTreeList doesn't know about the providers you are using. So, I believe it doesn't matter.
If you observe this incorrect behavior in some specific scenario, please provide us with a small sample project reproducing it, and all the necessary database back-ups and third-party libraries. We'll test it and do our best to find out why this happens.
Thanks,
Michael.
I can reproduce it in your example when I set ValueType="System.Int32" instead of System.Byte but I can't solve it in my project with System.Byte.
Note that I have changed the datatype of the Discontinued field from bit to tinyint in my example Northwind database before.
Hi Andreas,
You should set the ValueType property to exactly the same type that your datasource returns (not a database field type). You should also set the ValueChecked and ValueUnchecked properties to values of the same type. This is by design. For example:
TreeListCheckColumn column = ASPxTreeList1.Columns["Discontinued"] as TreeListCheckColumn;
column.PropertiesCheckEdit.ValueType = typeof(byte);
column.PropertiesCheckEdit.ValueChecked = (byte)1;
column.PropertiesCheckEdit.ValueUnchecked = (byte)0;
If this doesn't help, please provide us with a small sample project reproducing this issue, and a database backup.
Thanks,
Michael.
I can't understand why this should be by design when the ASPXGridView does not show this behavior and also ASPxTreeList works correct when the CheckBoxColumn is set to Visible=true ??
To reproduce it simply exchange following lines in your test project:
<dxwtl:TreeListCheckColumn FieldName="Discontinued" VisibleIndex="2"
Visible="False">
<EditFormSettings Visible="True" />
<PropertiesCheckEdit ValueChecked="1" ValueType="System.Int32" ValueUnchecked="0">
</PropertiesCheckEdit>
</dxwtl:TreeListCheckColumn>
and change the Data Type of "Discontinued" in Products of Northwind db to tinyint.
Then you will find the same problem as I have with mysql and the mysql database provider.
You are right the datatype is not exactly the same but can be converted from the .NET framework which works fine in ASPxGridView (I have thousends auf ASPxGridView tables where the same situation works fine!!) and also in ASPxTreeView when the column is visible.
Sorry, we have not been able to find an immediate answer or resolution. Please bear with us. We will inform you as soon as an answer has been found.
Hi Andreas,
Thank you for the additional information. Due to some reason it works in the ASPxGridView. However, we strongly recommend that you set the proper ValueType for the column. We'll research this issue further, and possibly improve the ASPxTreeList.
Thanks,
Michael.