hello,how to hide a field of a xamDataGrid at runtime?Thanks
Hi,
Each Field instance has a Visibility property and you can access it like so:
xamDataGrid1.FieldLayouts[0].Fields[0].Visibility = System.Windows.Visibility.Collapsed;
Please let me know if you require any further assistance on this matter.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Thanks for your reply.I want to achieve is hide all the fields and after to see what they want. To view the field I want to use this code:
private void xdgBase_Initialized(object sender, EventArgs e) { XamDataGrid xdg = sender as XamDataGrid; try {
Field fprova = new Field(); fprova.Name = "IdLogBook"; fprova.FixedLocation = FixedFieldLocation.FixedToNearEdge; FieldLayout flMy = xdg.DefaultFieldLayout; flMy.Fields.Add(fprova); FieldLayoutCollection fcoll = xdg.FieldLayouts;
how do I hide them all?Sorry for not correct English.
I run to hide in this way: private void xdgBase_Loaded(object sender, RoutedEventArgs e) { foreach (Field colB in xdgBase.FieldLayouts[0].Fields) { colB.Visibility = System.Windows.Visibility.Collapsed; } }
and if you want to do? In WinForm there was an option on the grid.
Thanks
If you want ot hide all Fields, what you have dones is your best option, since the XamDataGrid does not expose a proeprty/setting that will hide all its FIelds.
Let me know if you requir any furhter assistance on the matter.
Regads Petar.
ok. Thanks for your reply.WinForm system as an example of attaching a photo showing what I mean.In WinForm is called the Field Chooser.
Perfect. Resolved:xdg.ShowFieldChooser ();
Thank you very much.