SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 7 of 7
  1. #1
    Junior Member
    Join Date
    Jan 2008
    Location
    Europe, Germany
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How to create table checkpoint 2. band UltraGrid

    Hello,

    I have UltraGrids with more than one band. (that means
    every row has a + sign to expand the row)
    When I create table checkpoints only the first band will be identified. Is it possible to check the values of the second band to?

    Daniel.

  2. #2
    Senior Member
    Join Date
    Jul 2008
    Posts
    1,049
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to create table checkpoint 2. band UltraGrid

    Hi,

    Currently, there is no way to do this. However, there is a corresponding suggestion in our DB and your request has increased its rating. In the meantime you can use the sample script provided below. Here is the description of some of the routines:

    LoadGridDataToXMLCheckpoint - reads data from the grid and places them in the XmlGridMasterDetails checkpoint;
    VerifyGridData - checks the data in the grid against the data saved in the XmlGridMasterDetails checkpoint;
    Test - demonstrates how to use the "LoadGridDataToXMLCheckpoint" and "VerifyGridData" functions.

    Before you can use the functions, you need to create a new empty XML checkpoint in your project and name it "XmlGridMasterDetails".

    Here is the script:

    <font class="small">Code:</font><hr /><pre>//JScript

    function Test()
    {
    var p, w, ultraGrid, xmlData;

    var xmlCheckpoint = XML.XmlGridMasterDetails;

    p = Sys.Process("SamplesExplorer");
    w = p.WinFormsObject("frmAddRow");
    ultraGrid = w.WinFormsObject("UltraGrid1");

    LoadGridDataToXMLCheckpoint(ultraGrid, xmlCheckpoint);

    // ... Change data in the grid...

    VerifyGridData(ultraGrid, xmlCheckpoint);
    }


    function VerifyGridData(ultraGrid, xmlCheckpoint)
    {
    var xmlData = GetUltraGridViewAsXmlObject(ultraGrid);
    if(!xmlCheckpoint.Compare(xmlData))
    Log.Error("The grid data differs from the stored data.");
    else
    Log.Message("The grid data and the stored data are equivalent.");
    }


    function LoadGridDataToXMLCheckpoint(ultraGrid, xmlCheckpoint)
    {
    var xmlData = GetUltraGridViewAsXmlObject(ultraGrid);
    xmlCheckpoint.Document.loadXML(xmlData.xml);
    }

    function GetUltraGridViewAsXmlObject(ultraGridView)
    {
    var xmlData, currentNode;

    xmlData = Sys.OleObject("Msxml2.DOMDocument.4.0");
    xmlData.async = false;

    xmlData.loadXML("&lt;?xml version='1.0'?&gt;&lt;Body/&gt;");
    currentNode = xmlData.selectSingleNode("//Body");
    UltraGridViewToXml(currentNode, ultraGridView);
    return xmlData;
    }

    function UltraGridViewToXml(xmlData, gridView)
    {
    var currentNode, currentViewNode;

    for(var i = 0; i &lt; gridView.wRowCount; i++) {
    currentNode = xmlData.ownerDocument.createNode(1, "Row" + i, "");
    xmlData.appendChild(currentNode);
    AddRowCellsAsAttributes(currentNode, gridView, i);
    for(var viewIndex = 0; viewIndex &lt; gridView.wChildViewCount(i); viewIndex++) {
    currentViewNode = currentNode.ownerDocument.createNode(1, "View" + viewIndex, "");
    currentNode.appendChild(currentViewNode);
    UltraGridViewToXml(currentViewNode, gridView.wChildView(i, viewIndex));
    }
    }
    }

    function AddRowCellsAsAttributes(xmlData, gridView, rowIndex)
    {
    for(var i = 0; i &lt; gridView.wColumnCount; i++)
    AddXMLAttribute(xmlData, gridView.wColumn(i), gridView.wValue(rowIndex, i));
    }

    function AddXMLAttribute(xmlData, name, value)
    {
    var attribute = xmlData.ownerDocument.createAttribute(name);
    try {
    attribute.Value = value;
    }
    catch(exception) {
    if (BuiltIn.IsSupported(value, "ClrFullClassName"))
    attribute.Value = ".NET_OBJECT_" + value.ClrFullClassName;
    else
    attribute.Value = "UNKNOWN_VALUE TYPE";
    }
    xmlData.Attributes.setNamedItem(attribute);
    }
    </pre><hr />

    Let me know if you have anymore questions.
    Regards,
    Allen - SmartBear Support

  3. #3
    Junior Member
    Join Date
    Jan 2008
    Location
    Europe, Germany
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to create table checkpoint 2. band UltraGrid

    Hi Allen,
    the script works fine, thank you for quick response!

    Daniel.

  4. #4
    Member
    Join Date
    Jul 2008
    Posts
    146
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to create table checkpoint 2. band UltraGrid

    Where can I download Samples Explorer from?

  5. #5
    Senior Member
    Join Date
    Jul 2008
    Posts
    1,049
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to create table checkpoint 2. band UltraGrid

    Hi NiniRiya,

    It is shipped along with the controls.
    Regards,
    Allen - SmartBear Support

  6. #6
    Member
    Join Date
    Jul 2008
    Posts
    146
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to create table checkpoint 2. band UltraGrid

    Hmmm.. I couldn't find it.... I checked all the folders.

  7. #7
    Senior Member
    Join Date
    Oct 2003
    Posts
    928
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How to create table checkpoint 2. band UltraGrid

    Hi NiniRiya,

    Make sure you installed the samples. Also, try asking the controls' vendor about this - they will help you.
    Regards,
    Alex - SmartBear Support

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.00%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 11:18 AM.

Copyright BetaSoft Inc.