Hello,
We used Entity Framework Data Model as datasourse for grid . For example : we have
public int ID { get; set; }
public string Name { get; set; }
public string ColumnName { get; set; }
and navigation property
public virtual ICollection<EF> FieldCommons { get; set; }
Columns FieldCommons and ID are selected from other table and we don't need to show and to bind this columns in grid.
How can we bind model to grit without binding this columns?
Thanks .
Hello ,
If you want to hide column for a particular property in this case you have two options:
Use decoration attribute [Browsable(false)] to the property which should be hidden
Define your data schema of the UltraGrid at design time of your application and then set NewCollumnLoadStyle to hide.
Please let me know if you have any further questions.
I used first option:
1. Use decoration attribute [Browsable(false)] to the property which should be hidden.
But it do not work.
Please, answer for my next post the same type http://www.infragistics.com/community/forums/p/91843/453917.aspx#453917
Thanks
You could apply decoration attribute directly to the property, I’ve tested this and everything works properly as for UltraWinGrid and for standard MS DataGridView with EntityFrameWork, please see attached video.
Please let me know if you have any further questions regarding this matter.
P.S. I will answer to your questions of your other post in its thread.
Example what you sent works only for Entity Framework Code First. You applied decoration attribute in auto generated class. If you change you model this class regenerated and you lose your changes.
I use Entity Framework Database First and your decision works till first auto generate class, it's incorrect.
Do you have other idea?
Thanks for you help!
I am just checking about the progress of this issue. Let me know If you need my further assistance on this issue?
Thank you for using Infragistics Components.
Thank you for your answers, it work, but take some times for rebind data in grid. Grid works slowly.
I am glad to hear that suggested code works for you.
About the performance you may try to optimize the code, the number of calls that are made to the HideBrowsabeFalseCollumns() method. The best pace to call this method is in InitializeLayoutEvent, since this event occurs once the layout was changed.
I hope that this will helps you.