Fixed a problem when Table ROs where updated (from Get Latest RO Values)

Fixed a table conversion problem. Needed to remove extra ‘\r’ characters
This commit is contained in:
John Jenko 2011-10-10 13:07:32 +00:00
parent d18d0d97c8
commit 0158228eeb
2 changed files with 15 additions and 3 deletions

View File

@ -1310,15 +1310,16 @@ namespace Volian.Controls.Library
{ {
string xml = null; string xml = null;
string srchtxt = null; string srchtxt = null;
using (VlnFlexGrid myGrid = new VlnFlexGrid()) Content content = (Content)sender;
using (VlnFlexGrid myGrid = new VlnFlexGrid(content.ContentItems[0]))
{ {
using (StringReader sr = new StringReader(args.OldGridXml)) using (StringReader sr = new StringReader(args.OldGridXml))
{ {
myGrid.ReadXml(sr); myGrid.ReadXml(sr);
sr.Close(); sr.Close();
} }
string roid = myGrid.ROID; string roid = content.ContentRoUsages[0].ROID; //myGrid.ROID;
int rodbid = myGrid.RODbId; int rodbid = content.ContentRoUsages[0].RODbID; //myGrid.RODbId;
////Font GridFont = myGrid.Font; ////Font GridFont = myGrid.Font;
//myGrid.MergedRanges.Clear(); //myGrid.MergedRanges.Clear();
//myGrid.Clear(); //myGrid.Clear();
@ -1329,7 +1330,11 @@ namespace Volian.Controls.Library
//myGrid.RODbId = rodbid; //myGrid.RODbId = rodbid;
//myGrid.ROID = roid; //myGrid.ROID = roid;
//myGrid.IsRoTable = true; //myGrid.IsRoTable = true;
myGrid.Visible = false;
myGrid.ConvertTableROToGrid(args.ROText, rodbid, roid); myGrid.ConvertTableROToGrid(args.ROText, rodbid, roid);
myGrid.FixTableCellsHeightWidth();
myGrid.AdjustGridControlSize();
myGrid.Visible = true;
using (StringWriter sw = new StringWriter()) using (StringWriter sw = new StringWriter())
{ {
myGrid.WriteXml(sw); myGrid.WriteXml(sw);

View File

@ -282,6 +282,12 @@ namespace Volian.Controls.Library
InitializeComponent(); InitializeComponent();
SetupGrid(1, 1); SetupGrid(1, 1);
} }
public VlnFlexGrid(ContentItem ci)
{
InitializeComponent();
SetupGrid(4, 3); // use a default row and column count
_MyItemInfo = ci.MyItem.MyItemInfo;
}
//public VlnFlexGrid(IContainer container) //public VlnFlexGrid(IContainer container)
//{ //{
// container.Add(this); // container.Add(this);
@ -3217,6 +3223,7 @@ namespace Volian.Controls.Library
{ {
// we need to convert some RTF command to DOS so that we can // we need to convert some RTF command to DOS so that we can
// figure out the table size // figure out the table size
stepText = stepText.Replace("\r", "");
stepText = stepText.Replace("\xF8", @"\'f8"); stepText = stepText.Replace("\xF8", @"\'f8");
stepText = stepText.Replace(@"\par ", "\r\n"); stepText = stepText.Replace(@"\par ", "\r\n");
stepText = _ReplaceTokenSpaceToken.Replace(stepText, ""); stepText = _ReplaceTokenSpaceToken.Replace(stepText, "");