[DevExpress Support Team: CLONED FROM T317864: Get DisplayAttribute name in DXGrid cell]
Attached is a sample with an enum having the DisplayAttribute assigned, which the DXGrid fails to display without the SplitNames property.
EnumItemsSourceBehavior splits the Name value defined for the enum item by using DisplayAttribute when the SplitName property is True
Answers approved by DevExpress Support
We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.
Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.
- v15.2.4Download Official Update
- v15.1.9Download Official Update
Hi Yari,
Thank you for your sample project and video. By default, EnumItemsSource separates words with a space. In the video you attached, "ImmobilienScout24" turned into "Immobilien Scout24" which is expected, since Scout24 starts with a capital letter. When you set SplitNames to false, this feature is disabled and the space is removed. So, it seems that everything works as it should. Please let me know if I missed something important.
Thanks,
Alexander
I believe it should only separate words when using the actual enum string representation and not, when a DisplayAttribute name is used. The "ImmoScout24" enum is translated to "ImmobilienScout24" (via [Display(Name = "ImmobilienScout24")]), but it shows "Immobilien Scout24" in the cell.
Why does the SplitNames property split names defined via the DisplayAttribute?
Hello Yari,
We've considered that this behavior can be improved and forwarded this ticket to our R&D team for further research. We will update this thread to inform you as soon as we have any news.
Would you mind if we mark this ticket public?
Thanks,
Andrey
Hi Andrey,
No, sure. Go ahead :)
Thanks for your response!
Thanks, Yari. Now it's public.