469,290 Members | 1,882 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

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 8812
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 zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.