Hi,
I have a DataGrid where the property AllowFieldMoving is set to Yes. But I have some icons that should always be displayed on the left. They should never be mouved. But the rest of the columns can. The Property AllowFieldMoving should be off on this field only.
Is there a way to do this in xaml or do I need to listen to an event and manage it in the code behind?
Thanks
Karine.
This sounds like you should use fixed fields to fix it to the left and you should cancel the the FieldPositionChanging event for that Field as Alex suggested.
I need to have a column on the left that shows icons that should always stay ont the left. It should never be hidden, never moved and never sorted. That column does'nt show any label. Its like the column that shows the black arrow for the active record. It also need to be fixed, but that works fine with the 9.1 version.
I'm curious to know what your use case is. I mean we intentionally chose to put the AllowFieldMoving on the FieldLayout to either enable or disable it for all fields in a field layout because even if you were to disable field moving on a particular field, its position can change implicitly because other fields can be moved around that field thereby moving/changing the position of the field for which you disabled moving.
Hello Karine,
To the best of my knowledge, you cannot set a particular field not to be moveable. You can, however, handle the FieldPositionChanging event and perform a check for which field is being moved and then cancel the action like this:
private void xamDataGrid1_FieldPositionChanging(object sender, Infragistics.Windows.DataPresenter.Events.FieldPositionChangingEventArgs e)
{
if (e.Field == xamDataGrid1.FieldLayouts[0].Fields[0])
e.Cancel = true;
}
Hope this helps you in your scenario.
Regards,
Alex.
Hi Aaron,
I tried the FixedField functionnality of the 9.1 version. It does'nt correspond to my needs. I dont want the column to stay on top of the others while the user scroll. I want to disable the possibility to MOVE the column. In other words, I want to set the "Column" property of the field in the xaml layout définition and to never change it.