How do I know the target FieldPosition?
The info doesn't seem to exist in the args class.
OK, didn't realize I had to call that code in FieldPositionChanged handler (tried calling it upon grid construction).
It works.
Thanks,
Yaakov
Please test this with this sample. If you are able to move the first column anywhere else or move another column to the left of the name field, please download the latest service release and give us more details on your environment.. I test this with 9.2.20092.2001 and is working as expected.
It doesn't work.
User can still move fields to the left of the first field.
If you want to keep the first column always first, you can use the following code :
void xamDataGrid1_FieldPositionChanged(object sender, Infragistics.Windows.DataPresenter.Events.FieldPositionChangedEventArgs e)
{
xamDataGrid1.FieldLayouts[0].Fields["CustomerID"].ActualPosition = new FieldPosition(0, 0, 1, 1);
xamDataGrid1.FieldLayouts[0].EnsureUniqueFieldPositions();
}
This way, on every position changed, the CustomerID will be the first one. EnsureUniqueFieldPositions is called to prevernt stacking.
I need to prevent some repositionings. In particular, I want to ensure that the 1st column always stays the first. i.e. no field is positioned to its left.
To do so, I'd need to Cancel the positioning before the field is dropped, and I'd of course need the new target position to decide whether to cancel.
Please report any FR that addresses the scenario.
Sincerely,