Grid has the datasource property. But I need to assign the dataset column to the dynamically generated
ultragrid column.ultrawingrid column has no data source property.
Main Topics
Browse All TopicsIn the Initialize Layout event of the ultrawinGrid I have for loop. I dynamically added the columns to wingrid. In each iteration I make a call to the database and the dataset will returned. I need to assign the one column of the dataset the ultrawinGrid column.
The code is as follows:
for(int i=0;i<noofstudents;i++)
{
string columnIndex = "student" +i;
ultraGrid1.DisplayLayOut.B
serviceClass.returndataSet
ultraGrid1.DisplayLayout.B
}
It's is showing the error. 1.cannot implicitly convert type 'System.Data.DataColumn' to 'Infragistics.Win.UltraWin
2.Property or Indexer ' 'Infragistics.Win.UltraWin
Pls help me how to assign the dataset column to wingrid column.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi KavyaV,
The answer depends on how the dsStudent dataSet is modified:
- if a dataset is recreated (ie dsStudent = new DataSet()) on each returndataSet method call, you'll need to rebind the UltraGrid control to the datasource, as the dataSet object is not the same. To do this, simply reassign the UltraGrid's dataSource property with the new dataSet (dsStudent);
- if columns are added to the existing dataset table (ie dsStudent.Table(0).Columns
One last thing, I do not think it is a good practice to change the UltraGrid datasource during the InitializeLayout event, as, during this event, the control is creating its content based on its datasource, and if it change, the same event may be re-fired (infinite recursive call)... Try to update your datasource elsewhere...
Business Accounts
Answer for Membership
by: AgariciPosted on 2008-02-28 at 02:47:03ID: 21002552
you should probably have a datasource property on the grid. try to assign the dataset or datatable to it. then you should bind the grid columns to dataset table columns.
(this is only generic idea because i am not familiar with the infragistics control you are using. but the flow should be the same. only details like api names should differ)
hth,
A.