Current filter:
                                You should refresh the page.
                                  • Hi,

                                    I am using the below code in my .Net Application

                                    DataControlDetailDescriptor dataControlDetail = new DataControlDetailDescriptor();
                                    dataControlDetail.Name = "Solvent System";

                                    while executing the code, I am getting an error as 'Solvent System' is not a valid value for property 'Name'

                                    The problem is that 'Solvent System' contains a space in between which throws the error. So please let me know how this can be resolved since we are using the string with spaces in different places in our application.

                                1 Solution

                                Creation Date Importance Sort by

                                Hi Litty,

                                The Name property, which you set in your code, is inherited from the standard FrameworkContentElement class. It does not support certain symbols and throws an exception when you use an invalid value. You can reproduce this common behavior with standard classes:

                                [C#]
                                new FrameworkContentElement().Name = "Solvent System"; new Button().Name = "Solvent System";

                                Frankly speaking, it's not clear why you need to use space symbols in control names. The Name property value does not appear in the UI, so you can change it without affecting the UI.

                                Thanks

                                • Litty Joseph 1 11.18.2019

                                  Hi,

                                  I am attaching a sample project in which the detail grid is not populating data, if the item source property name contains string with space such as 'Solvent System'.

                                • Dima (DevExpress Support) 11.18.2019

                                  Hello Litty,

                                  Thank you for the sample project. I see that you set the ItemsSourceBinding property as follows as a part of your master-detail setup:

                                  [C#]
                                  dataControlDetail.ItemsSourceBinding = new Binding(itemSource);

                                  DataContext for this binding is its master record. So, it creates a binding for the "Solvent System" property of your master record. In the following screenshot this property equals 10; being used as ItemsSource, it transforms into 1 and 0:

                                  You can change this binding as required in your case. Since your data is not actually hierarchical, you can use your second table directly as its source:

                                  [C#]
                                  dataControlDetail.ItemsSourceBinding = new Binding() { Source = dtSource };

                                  And here is the result:

                                  Please try this approach and let me know if you have any additional questions.