Hi,
if one fixes columns in the near end of the grid, the FieldLayout becomes "explicit". Then the code:
DataGrid.FieldLayouts[0].Fields.Insert(1, field); works in a different way, than before the fixing. The field is added always at the end of the Layout and the ActualPosition is not anymore the given index (1).
How can one check if the Layout is Explicit, so that one can take measures and manipulate the field.ActualPosition himself? Is there a Property which tells me, whether the Layout is "explicit" or not?
Regards,
George
Hello George,
Thank you for your post!
I have been looking into question. The layout of the field becomes explicit when the end user moves, fixes, hides a field, etc. When one of these operations is made you can use the following code snippet for inserting the Field.
DataGrid.FieldLayouts[0].Fields.Insert(1, field);
field.ActualPosition = new FieldPosition(1, 0, 1, 1);
foreach(var f in DataGrid.FieldLayouts[0].Fields)
{
if (f != field && f.ActualPosition.Column >= 1)
var pos = f.ActualPosition;
f.ActualPosition = new FieldPosition(pos.Column + 1,
pos.Row, pos.ColumnSpan, pos.RowSpan);
}
Please do not hesitate to let me know if you have any further questions on this matter.
Hi Gergana,
Ofcourse I don't want to follow and care for all the events you mentioned above. The scenario is as follows:
At some point in Runtime I need to add a Column at a specific Position in the Layout. I don't know the history of the XamDataGrid at this time. If some Fields were reordered, hidden, fixed or whatever I don't know. So I have to find out.
That's why - again the same question:
How to check if a FieldLayout is explicit or not at a specific moment.
if(FieldLayout is Explicit -> how to do this???)
I am just checking if you have any further questions on this matter. Please do not hesitate to let me know if you do.
I have been looking into you post. Currently there is no property that can show if the layout of the XamDataGrid is explicit. What I can suggest is creating a new product idea for this property. You can suggest new Product Ideas for future versions (or vote for existing ones) at http://ideas.infragistics.com.
Steps to create your idea:
1. Log into the Infragistics Product Ideas site at http://ideas.infragistics.com (creating a new login if needed).
2. Navigate to the product / platform channel of your choice (e.g. WPF, Windows Forms, ASP.NET, HTML5 / Ignite UI, iOS / NucliOS, etc.)
3. Add your product idea and be sure to be specific and provide as much detail as possible.
• Explain the context in which a feature would be used, why it is needed, why it can’t be accomplished today, and who would benefit from it. You can even add screenshots to build a stronger case. Remember that for your suggestion to be successful, you need other members of the community to vote for it. Be convincing!
• [CASE: “Reference case [case number], FORUMS: “Include a link to this thread”] in your idea so product management will be able to look back at this case.
The benefits of submitting the product idea yourself include:
- Direct communication with our product management team regarding your product idea.
- Notifications whenever new information regarding your idea becomes available.
Additional benefits of the Product Idea system include:
- Ability to vote on your favorite product ideas to let us know which ones are the most important to you. You will have ten votes for this and can change which ideas you are voting for at any time.
- Allow you to shape the future of our products by requesting new controls and products altogether.
- You and other developers can discuss existing product ideas with members of our Product Management team.
The product ideas site allows you to track the progress of your ideas at any time, see how many votes it got, read comments from other developers in the community, and see if someone from the product team has additional questions for you.
Thank you for contacting Infragistics.