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

'RadSorOrder','Browsable' Attirbutes are not seralized

1 Answer 44 Views
DataEntry
This is a migrated thread and some comments may be shown as answers.
avishay
Top achievements
Rank 1
avishay asked on 02 May 2019, 09:08 AM

My model of  'Car' class , and all its datamembers and attributes is defined in the server of WCF project.

In my client I use the RadDataEntry to view List of 'Car's.

But even that I've  defined in the model on some datamebers as [Browsable=('False')] or [RadSorOrder(1)] ,in the client it does not has any impact on the RadDataEntry Ui element.

But if I save the model (or just give refernce in the client), it works correctly.

What do I need to do in order to keep the model only in the sever and also gets all the attributes work correctly in the client/Ui?

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 May 2019, 06:22 AM
Hello, Avishay,     

Following the provided information, I have prepared a sample project containing a Car class. The Browsable attribute is respected on my end and if it is set to false, it will make the property on which it is used not bindable. This will prevent other controls which use the CurrencyManager for extracting properties to bind to such a class. 

public RadForm1()
{
    InitializeComponent();
    List<Car> cars = new List<Car>();
    cars.Add(new Car(1,"MINI One D", 2006, 240));
    cars.Add(new Car(2,"Audi A1", 2010, 230));
    cars.Add(new Car(3,"BMW X6", 2013, 240));
    BindingSource bs = new BindingSource();
    bs.DataSource = cars;
    this.radBindingNavigator1.BindingSource = bs;
    this.radDataEntry1.DataSource = bs;
}
 
public class Car
{
    [Browsable(false)]
    public int Id { get; set; }
 
    public uint Year { get; set; }
 
    public string Model { get; set; }
    
    public uint Speed { get; set; }
 
    public Car(int id, string model, uint year, uint speed)
    {
        this.Id = id;
        this.Model = model;
        this.Year = year;
        this.Speed = speed;
    }
}

The Id field is not displayed;



An alternative solution for this scenario is to leave the property Browsable set to true and handle the RadDataEntry.ItemInitializing setting the e.Cancel property to true for items which need to hidden in RadDataEntry. Thus, you won't generate the desired property of the Car class.

As to the RadSortOrder, RadDataEntry allows changing the location of the automatically generated editor. A sample approach is demonstrated in the following help article: https://docs.telerik.com/devtools/winforms/dataentry/programmatically-arrange-items- 

I hope this information helps. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
DataEntry
Asked by
avishay
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or