Not All Children Are Displayed

Posted by: aristophil on 8 September 2017, 3:37 am EST

  • Posted 8 September 2017, 3:37 am 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.


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

    <SPAN class=kwd>public</SPAN> Form1()

    <SPAN class=kwd>private void</SPAN> Form1_Load(<SPAN class=kwd>object</SPAN> sender, EventArgs e)
    ds = <SPAN class=kwd>new</SPAN> DataSet();
    OleDbCommand cmd = <SPAN class=kwd>new</SPAN> OleDbCommand(<SPAN class=st>"SELECT Account FROM Account ORDER BY Account"</SPAN>, cn);
    cmd.CommandType = CommandType.Text;
    OleDbDataAdapter da = <SPAN class=kwd>new</SPAN> OleDbDataAdapter(cmd);
    da.Fill(ds, <SPAN class=st>"Accounts"</SPAN>);
    cmd.CommandText = <SPAN class=st>"SELECT Account, Category FROM Category ORDER BY Account, Category"</SPAN>;
    da.Fill(ds, <SPAN class=st>"Categories"</SPAN>);
    ds.Relations.Add(<SPAN class=st>"AcctCat"</SPAN>, ds.Tables[<SPAN class=st>"Accounts"</SPAN>].Columns[<SPAN class=st>"Account"</SPAN>],
    ds.Tables[<SPAN class=st>"Categories"</SPAN>].Columns[<SPAN class=st>"Account"</SPAN>]);
    fpSpread1.DataSource = ds;
  • Replied 8 September 2017, 3:37 am 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
  • Replied 8 September 2017, 3:37 am EST


    How do I attach a file?

  • Replied 8 September 2017, 3:37 am 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, 3:37 am EST

    <FONT face=Helv size=2>

    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).

  • Replied 8 September 2017, 3:37 am 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