472,129 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,129 software developers and data experts.

Infragistics Ultra Grid DataRelation

Hi all,
I have two tables that I'm trying to display in a Master Detail fashion in an Infragistics UltraGrid. I added both tables to a dataset and added a datarelation between the two tables using the field that related both. When I run my application Ultra Grid just displays the master table, the child table is not displayed. Does anybody know what is wrong with my code? Grid expandable property is set to true, but is there any other property that I need to set to be able to see the chid table? Thanks for the help.


Expand|Select|Wrap|Line Numbers
  1.             string sqlCommand = "";
  2.             sqlCommand = "SELECT * FROM ENUM_VALUES";
  3.             DataTable dt2 =                     
  4.             DBBroker.getInstance().ExecuteSQL(sqlCommand);
  5.  
  6.             sqlCommand = "SELECT * FROM CONSTANTS";
  7.             DataTable dt1 = 
  8.             DBBroker.getInstance().ExecuteSQL(sqlCommand);
  9.  
  10.             DataSet ds = new DataSet();
  11.  
  12.             ds.Tables.Add(dt1); //Add master table
  13.             ds.Tables.Add(dt2);  // Add child table
  14.  
  15.             DataRelation relConstEnum = new DataRelation("ConstEnum",    
  16.                 ds.Tables[0].Columns["ID"],                     
  17.                 ds.Tables[1].Columns["CONST_ID"], false);
  18.             ds.Relations.Add(relConstEnum);
  19.  
  20.             mGrid.Rows.ExpandAll(true);
  21.             mGrid.DataSource = ds;
Feb 19 '07 #1
3 8989
kenobewan
4,871 Expert 4TB
I believe that the problem is the you need two separate sql strings and execute them separately. Otherwise the first string is written over by the second...
Feb 20 '07 #2
I found out what was the problem. UltraGrid ViewStyle property has to be set to MultiBand instead of SingleBand.
Feb 21 '07 #3
kenobewan
4,871 Expert 4TB
My bad, using the same sqlcommand name was very confusing for me :).
Feb 21 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

1 post views Thread by steve | last post: by
5 posts views Thread by Jéjé | last post: by
2 posts views Thread by NuB | last post: by
3 posts views Thread by Ronald S. Cook | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.