This is a migrated thread and some comments may be shown as answers.

e.Order in Dataform_AutoGeneratingField

1 Answer 40 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Maurizio
Top achievements
Rank 2
Maurizio asked on 29 Mar 2012, 11:42 AM
Hello,

My business object properties have a attribute DisplayIndex and I want to set the order of my datafields to this displayindex.

DisplayIndexAttribute displayIndexAtt;
 if (property.TryGetAttribute<DisplayIndexAttribute>(out displayIndexAtt))
            {
        
                e.Order = displayIndexAtt.index;
            }

This is working fine. But the problem is that not all properties have the displayindex attribute, so for some properties e.Order is null. I expected that these properties are displayed at the end of the dataform, but instead they are at the beginning.

Is there a way to change this behavior in the way that the properties without an explicit order will be at the end of the Dataform?

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 29 Mar 2012, 11:47 AM
Hi Thomas,

I believe the only way to do this is to iterate over the elements and assign a large number(exceeding the max possible count of fields )  to those whose initial value is null.

Regards,
Pavel Pavlov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
DataForm
Asked by
Maurizio
Top achievements
Rank 2
Answers by
Pavel Pavlov
Telerik team
Share this question
or