KavyaV
asked on
Infragistics Ultrawingrid - Adding columns and columnheaders dynamically to wingrid
The number of rows in the dataset(it has single table) decides the no.of columns to be dynamically added to ultrawingrid.
I tried the code this way
int noofstudents = Convert.ToInt32(ds.Tables[ "student"] .Rows.Coun t);
for(int i=0;i<noofpersons;i++)
{
(don't know where to retrieve)? =(ds.Tables["student"].Row s[i].["stu dent_name" ].ToString ();
?? =(ds.Tables["person"].Rows [i].["id"] .ToString( );
ultraGrid1.DisplayLayOut.B ands[0].Co lumns.Add[ "Marks"];( don't know how to add colum name dynamically for each iteration)
ultraGrid1.DisplayLayout.B ands[0].Co lumns["Mar ks"].Heade r.Caption = ? ??;
}
retrieved student name and ID should be added as the columnheader for the dynamically generated column.I don't have idea where and how to retrieve the studentname and id while the loop is iterating.
After the dynamically generating the columns and column headers It will be bind to datasource(another dataset).
Pls let me know the possible ways of doing this.
Thank u
I tried the code this way
int noofstudents = Convert.ToInt32(ds.Tables[
for(int i=0;i<noofpersons;i++)
{
(don't know where to retrieve)? =(ds.Tables["student"].Row
?? =(ds.Tables["person"].Rows
ultraGrid1.DisplayLayOut.B
ultraGrid1.DisplayLayout.B
}
retrieved student name and ID should be added as the columnheader for the dynamically generated column.I don't have idea where and how to retrieve the studentname and id while the loop is iterating.
After the dynamically generating the columns and column headers It will be bind to datasource(another dataset).
Pls let me know the possible ways of doing this.
Thank u
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
int noofstudents = Convert.ToInt32(ds.Tables[
for(int i=0;i<noofstudents;i++)
{
string stname =(ds.Tables["student"].Row
string id =(ds.Tables["person"].Rows
ultraGrid1.DisplayLayOut.B
ultraGrid1.DisplayLayout.B
}
But it is not adding the columns dynamically to ultra grid. It is throwing the exception here:
ultraGrid1.DisplayLayOut.B
key already exists. parameter name:key
Argument exception was caught even for the 1st iteration.
Can tell me the possible other ways of adding columns dynamically to ultragrid. The no. of columns to be added are not known till the run time.
I gave the description of the problem in my first comment.
Thank You.