Depending on a variable, I would like to hide or show cetain field columns in the datagrid. How do would you programatically change the column visibility?
Hello
Here is a sample application that demonstrates how you can add an UnboundField in your XamDataGrid in the code behind in the XamDataGrid’s Loaded event.
Krasimir
Developer Support Engineer
Infragistics
www.infragistics.com/support
Thx It has been done like this Infragistics.Windows.DataPresenter.UnboundField f = new Infragistics.Windows.DataPresenter.UnboundField(); f.Name = "Linked"; f.DataType = typeof(string); f.BindingPath = new PropertyPath("Linked"); //Also attempted: "Items[0].Value" _objView.grdComp.FieldLayouts[0].Fields.Add(f); _bAdd = true;
Hi
Thx Petar this is xamDatagrid, and I want to add column on the basis of type var linkColumn = new DataGridTextColumn { Header = "Linked", Binding = new Binding("Linked"), Width = 200 }; xamDatagrid1.Columns.Add(linkColumn);
Hello,
I read through your description and wasn't able to understand which grid exactly are you using. This is the XamDataGrid and yet it does not have a Columns collection. Also I fail to see the correlation between your issue and this forum thread. Please double-check if you have posted this in the right place and also provide a more detailed description of your scenario.
Thanks in advance.
Sincerely,
Petar
Hi I want to add a new column in grid I am doing like this
var linkColumn = new DataGridTextColumn { Header = "Linked", Binding = new Binding("Linked"), Width = 200 }; _objView.grdComp.Columns.Add(linkColumn);
But it is generating an error, plz suggest how to achieve it?