Hi,
I need to create a XamDataGrid with configurable columns. But the first column on the left should always be displayed on the left and never be moved from there.
- I need to disable the possibility to drag and drop this column.
- I need to prevent some other columns to be draged and droped on the left of this column.
does any body has suggestions?
Thanks
Hello croesusdev,
It sounds like this can be done with column fixing. If you set the first column to be fixed, then it cannot be dragged, and other columns cannot be dragged to the left of it. It will also always be displayed.
Here is some documentation on fixing columns:
About Fixed Fields
Enable Fixed Fields
Fix Fields
You'd want to fix it to the "Near" edge, meaning the left side.
Let me know if you have any other questions about this.
Elizabeth AlbertLocalization Engineer
The functionnality of "fixed columns" available is not what I need. Has it is describe in your documentation :
"The xamDataPresenter™ control and the xamDataGrid™ control allow your end users to fix fields so they are not scrolled out of view."
But, at all time, the user can remove the column from the fixed section. He can drag an drop the column to the dragable section. I dont want the column not to be "scrolled out" I want it to stay on the "near" edge. I want to prevent the user to replace it from its position.
Example, the ExpansionIndicator or RecordSelector are always on the left. The user cannot put them in the midle. That's what I need.
Thanks.
Yes, I need to enable the possibility to configure and move all other columns.
I created a sample with this code. I am unable to move the fixed column or to drag other columns to the left of it. Please let me know if this works for you.
<Window x:Class="WpfApplication1.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" xmlns:igDP="http://infragistics.com/DataPresenter"> <Grid> <StackPanel> <igDP:XamDataGrid Name="xamDataGrid1" BindToSampleData="True" > <igDP:XamDataGrid.FieldLayouts> <igDP:FieldLayout> <igDP:FieldLayout.Fields> <igDP:Field Name="name" FixedLocation="FixedToNearEdge" /> </igDP:FieldLayout.Fields> </igDP:FieldLayout> </igDP:XamDataGrid.FieldLayouts> </igDP:XamDataGrid> </StackPanel> </Grid></Window>
I tried it in the Feature Browser and it is possible to drag and drop a column on the left of the fixed to near edge column.
Yes, I see that now in the Feature Browser under xamDataGrid > Layout and Behavior > Fixed Fields. However, that is a more complex sample than the one I made. I have attached my sample. Could you please try to run that (I used 10.3 but you can change the assembly references to match the ones you have installed), and let me know if it fits your requirements?
Thanks, I tried your sample. Your right, it works in this particular case.
But if you have more than 1 column in the fixed section, you can switch them together.
And I also need to enable the column fixing fonctionnality has it is shown in the feature browser.
In fact, I need complexe behavior has it is shown in the feature browser.
Hello Vishal,
I can suggest you see this forum thread:
http://es.infragistics.com/community/forums/p/91461/453100.aspx#453100
where a similar question is already discussed.
Is same functionality is available with XamGrid also?
Any workaround to handle such situation.
Thanks,
Vishal
Hello sahiljani,
AllowFieldMoving on the XamDataGrid's FieldLayoutSettings must be set to "Yes" before you will see the "FieldPositionChanged" event in the list of events. Here is the XAML code, and I have attached a screenshot.
<igDP:XamDataGrid Name="xamDataGrid1" Width="500" Height="300" BindToSampleData="True" >
<igDP:XamDataGrid.FieldLayoutSettings>
<igDP:FieldLayoutSettings AllowFieldMoving="Yes" />
</igDP:XamDataGrid.FieldLayoutSettings>
</igDP:XamDataGrid>
If it still does not show up in the Properties > Events window, try clicking on the XAML line with "<igDP:XamDataGrid.FieldLayoutSettings>" and check again.
I have same problem but I am not able to find the "FieldPositionChanged Event" any where.
Will you please help me for that?
Thanks, it works perfectly.