Not All Children Are Displayed

Posted by: aristophil on 8 September 2017, 12:37 pm EST

  • Posted 8 September 2017, 12:37 pm EST

    I noticed that not all child rows in a hierarchy are displayed.  I created a small test project, and got the same problem there.  I can't see what I may be doing wrong.  Below is my code.  I can email you this project as well as the test Access database it uses.


     

    public partial class Form1 : Form
    {
    private OleDbConnection cn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\test.mdb;User Id=admin;Password=;");
    private DataSet ds;

    public Form1()
    {
    InitializeComponent();
    }

    private void Form1_Load(object sender, EventArgs e)
    {
    cn.Open();
    ds = new DataSet();
    OleDbCommand cmd = new OleDbCommand("SELECT Account FROM Account ORDER BY Account", cn);
    cmd.CommandType = CommandType.Text;
    OleDbDataAdapter da = new OleDbDataAdapter(cmd);
    da.Fill(ds, "Accounts");
    cmd.CommandText = "SELECT Account, Category FROM Category ORDER BY Account, Category";
    da.Fill(ds, "Categories");
    ds.Relations.Add("AcctCat", ds.Tables["Accounts"].Columns["Account"],
    ds.Tables["Categories"].Columns["Account"]);
    fpSpread1.DataSource = ds;
    }
    }
     
  • Replied 8 September 2017, 12:37 pm EST

    Aristophil -

    I am not able to reproduce this.  Could you zip up your .mdb file and attach it (make sure it is less than 256K).  We will test it using the code you provided.  If it is larger than 256K then you can send it to fpsupport@fpoint.com.
  • Replied 8 September 2017, 12:37 pm EST

    Bob,


    How do I attach a file?

  • Replied 8 September 2017, 12:37 pm EST

    When you reply to a post there are four tabs at the top.  Choose the Options one and then click the Add/Update button and then browse for the file and then save it and post your reply.
  • Replied 8 September 2017, 12:37 pm EST


    I am attaching my example.  The form has 2 spread controls, one with hierarchy and one without. It seems that a couple of child records are missing from the hierarchical grid, e.g., account 02303439, category XCFD (only category XOP is shown for this account).


    2007/06/HierTest.zip
  • Replied 8 September 2017, 12:37 pm EST

    This account number has spaces after it and the other one does not.  That is why you are seeing these issues. The one missing spaces is the one that does not show up.
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels