Hi,
I want multi levels of columns in Ultrawingrid like
Level1
level1.1 level1.2
Level 1.1.1 Level 1.1.2 Level 1.1.1 level1.2.1 level1.2 .2
I want three levels of column. How can we achive this using ultrawingrid
If you only want two levels, you can use Groups. Groups allow you to assign columns to a group, so you get two levels of headers.
For three levels, you would have to use RowLayouts and the Group headers would be unbound column where the column.RowLayoutInfo.LabelPosition is set to LabelOnly. So they are essentially dummy columns with no cells, just headers. The easiest way to do this is to set it up in the grid designer.
Thanks for your quick response.
With two level I am able to do, since I am very new to infragistics, I don't how to set all this for three levels. Can you please give me one example.
Thanks and Regards
Rosy
Hi
Sample for Three level using the rowlayout.......
to get the foll layout.. .
level 3 grouped under level2 and L2 under L1
LEVEL1 ''w/o any cells for this col - only header
LEVEL2A LEVEL2B
LEVEL3A LEVEL3B LEVEL3C LEVEL3D
assuming all the columns exist ion ur coll collection (datasource) ,if not you can add dummy ones..
here let us add LEVEL1 col to collection...
add these codes in initialize event .. .
Dim band As UltraGridBand = ultragrid1.DisplayLayout.Bands(0)
band.UseRowLayout = True ' 'very important
Dim info As RowLayoutColumnInfo
info = column.RowLayoutColumnInfo
info.LabelPosition=LabelPosition.LabelOnly '' can use this code for to display only col header w/o any cell space or below three line of code..
info.MinimumCellSize = New Size(1, 1)
info.PreferredCellSize = New Size(1, 1)
info.OriginY = 0 info.SpanY = 1
//2nd level
info.OriginX = 0 info.SpanX = 2
info.OriginY = 1 info.SpanY = 2
info.OriginX = 2 info.SpanX = 4
//3rd level
info.OriginX = 0 info.SpanX = 1
info.OriginY = 2 info.SpanY = 3
info.OriginX = 1 info.SpanX = 1
info.OriginX = 2 info.SpanX = 1
info.OriginX = 3 info.SpanX = 1
you are done,. jus make sure of the meaning of SPAN and ORIGIN properly ..then rest is child's play of building blocks..
Hope it helps out, .
Njoy. .
Hi Mr. Arun,
I have to do the same thing bt my columns comes at runtime ie. i have two dates like "start date" & "End Date" and the dates btween these two dates are my column headers. These dates i want to show as follows :
Kindly guide me for dis..
Thanks in advance.
Hello,
Could you please clarify what type of objects are these fields - March, April,1,2,3,Mon,Tue,Thu.
Please do not hesitate to contact us if you need any additional assistance.
Hi Boris,
thnx for ur rply.
In my case i get columns at runtime. so i cannot set the groups at design time.
please provide me some solution for grouping three levels column header similar as shown in above tabular snap. i dont have columns at design time.
the column headers of below snap are to be shown in 3 groups.
thnx in advance.
Could you please review the sample attached to this post and see if it meets your requirements.
Please feel free to let me know if I misunderstood you or if you have any other questions.
can u pls rply for it its very urgent for me. The code is somethinh like this.
public void FillGrid(DateTime dt1, DateTime dt2,DataSet dsMain){ DataRow drow; DataTable dtFill = new DataTable(); DataTable dtgrid = new DataTable();
try { dsTemp = dsMain;
TimeSpan ts = dt2 - dt1; int mday = ts.Days;
for (int icount = 0; icount <= mday; icount++) { dtFill.Columns.Add(Convert.ToString(objCommonFunction.ProcGetDateFormat(Convert.ToString(dt1.AddDays(icount)))).Substring(0,5) + Environment.NewLine + Convert.ToString(dt1.AddDays(icount).DayOfWeek).Substring(0, 3), System.Type.GetType("System.String")); }
grdFactorywiseDet.DataSource = dtFill; grdFactorywiseDet.DataBind();
catch (Exception ex) { MessageBox.Show(ex.Message); }}
basically the dates which i am binding are in normal format (dd mm yyyy) which takes more space. so i want to make groups as shown in above snap.
Kindly rply its very urgent..
dey are just strings which i assign to dataset by saying dataset.columns.add("date1") and so on and den bind the dataset to the grid
I want to show column Headings in 3 groups basically. I am getting column names ie (some particular date) at runtime and that date i want to show in 3 level groups similar to the snapshot.
Thnx in advance Boris.