Hey, I have a quick question concerning UltraGrid. Is there a way to bind a column of data pulled in from a sql select to a ultragrid as its column headers without putting the information into a seperate datatable?
For example I'm pulling in a bunch of months in the month column from sql. From there I want to make that the headers for each column in my grid and use the data from another column as the row below them.
SQL:MONTH Info12 3001 2452 338
UltraGrid:12 1 2300 245 338
Thanks for the help
hi,
yes you can add a column as an unbound one ..
sample is like .
UltraGrid1.DisplayLayout.Bands(0).Columns.Add("Newcol2")
UltraGrid1.Rows(0).Cells("Newcol2").Value = 320
hppy Koding,
Arun
Sorry first off for the delayed response I had to switch to another project for a bit.
Anyways, I tried your code and the parenteses did not compile in c#. So I changed it to:
UltraGrid1.DisplayLayout.Bands[0].Columns.Add("Newcol2");
UltraGrid1.Rows[0].Cells["Newcol"].Value = 120;
UltraGrid1.Rows[0].Cells["Newcol2"].Value = 320;
I put these changes in and it compiled but it keeps saying that the 3rd line throws an error "Index was outside the bounds of the array".
Any help would be much appreciated on this, and Arun thanks for the reply.
Hi,
i did post the VB.net code. so obviously convert it to c# ....
You need to bind to a datasource .. either a datatable or custom bind an ilist or arraylist,,
then in the inititlaize layout event add these codes .. it will effect..
hope i ve more clarity this time,
If you didn't bind the grid to anything there will be no rows in the grid. Create a DataTable that looks like how you'd like the grid to look like and then bind to that table.