gmorris59
2018-02-07T21:09:26Z
I am trying to set the grids LayoutObject.text and get the exception "One of the identified items was in an invalid format." when I assign to the

iGridOfData.LayoutObject.Text = robotGridLayout;

If I inspect the value of iGridOfData.LayoutObject.Text and robotGridLayout they both contain the same. They contain the following

Quote:


"<iGridLayout>
<Col Index=\"-1\">
<Order>-1</Order>
<Visible>True</Visible>
<Width>64</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"0\">
<Order>0</Order>
<Visible>True</Visible>
<Width>64</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"1\">
<Order>1</Order>
<Visible>True</Visible>
<Width>40</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"2\">
<Order>2</Order>
<Visible>True</Visible>
<Width>100</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"3\">
<Order>3</Order>
<Visible>True</Visible>
<Width>100</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"4\">
<Order>4</Order>
<Visible>True</Visible>
<Width>100</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"5\">
<Order>5</Order>
<Visible>True</Visible>
<Width>100</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"6\">
<Order>6</Order>
<Visible>True</Visible>
<Width>100</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"7\">
<Order>7</Order>
<Visible>True</Visible>
<Width>100</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
<Col Index=\"8\">
<Order>8</Order>
<Visible>True</Visible>
<Width>400</Width>
<SortIndex>-1</SortIndex>
<SortOrder>None</SortOrder>
<GroupIndex>-1</GroupIndex>
<GroupOrder>None</GroupOrder>
</Col>
</iGridLayout>"




I have also
Quote:


System.Xml.XmlDocument myDoc = new System.Xml.XmlDocument();
myDoc.LoadXml(z_JCD.robotGridLayout);


and no fault reported.

Any ideas?
Igor/10Tec
2018-02-08T07:15:55Z
Need a sample to reproduce the problem.
gmorris59
2018-02-08T10:13:48Z
The cause of the problem seems to be when I set the layout explicitly and then try and use the .Text property
Quote:


iGLayoutFlags layoutFlags = iGLayoutFlags.ColOrder | iGLayoutFlags.ColVisibility | iGLayoutFlags.ColWidth | iGLayoutFlags.Sorting | iGLayoutFlags.Grouping
iGridOfData.LayoutObject.Flags = layoutFlags;



with the iGLayoutFlags.Grouping and iGridOfData.LayoutObject.Text = <previous_values> there is the exception.

Solution was to remove the iGLayoutFlags.Grouping