Hi,Recently I'm using winGrid and got two questions.1)I got a mutil-line header grid, with the first header line "Date" and the second header line "morning", "noon" and "night".And I want to implement this effect: when I click the header "Date", all the columns will be selected.e.g ①"morning" is checked, When I click the header "Date", and the column "morning" should be selected.
②"morning" and "noon" are checked, When I click the header "Date", and all the column "morning", "noon" should be selected.
③"morning", "noon" and "night" are checked, When I click the header "Date", and all the column "morning", "noon" and "night" should be selected.
Is it possible to implement this effect?
2)"morning", "noon" and "night" are checked,And when I drag the "Date" column, only the last column "night" 's width is changed. That's same with the Title column.
Is there something that I'm missing?
I've attach my code. Could you please help me with these two questions?Thanks for your concern.
Hi Richard,
Thank you for posting in our forums.
You can use groups instead of RowLayouts and both of these issues will be resolved. When you click the group header all the columns in the group will be selected and when you resize the group its columns will be also resized. Using groups you can also remove the “Date” and“Title” columns from your data source. For more information on groups please visit this link:
http://help.infragistics.com/Help/Doc/WinForms/2012.1/CLR2.0/HTML/Infragistics2.Win.UltraWinGrid.v12.1~Infragistics.Win.UltraWinGrid.UltraGridGroup.html
I have modified the sample in order to demonstrate this approach.
Please let me know if you have any additional questions.
Hi, Dimitar
Thanks for you help. And the sample is solved one of my request.
Here is another one, I was using the ultraWinGrid to implement the tree effect. And with two DataTable, one has relation with the other.
DataSet ds1 = new DataSet();
ds1.Tables.Add(dt);
ds1.Tables.Add(dt2);
ds1.Relations.Add("dt2", dt.Column["No"], dt2.Column["No"]);
Also I want to implement the drag effect. That is when I drag the "Date" title, the tree line will be also resized.
If I have to use the relations setting to implement the tree effect, is it possible to implement the drag action?
Could you please help me with that? Thanks for your concern.
I'll attach the code that mentioned above.
Thank you for the reply.
I am not exactly what you mean by DragEffect, but I assume you want after you move a group in the parent band the columns to be moved in the child band too. I have achieved that by using the same groups in the child band as the ones in the parent band. After that I handled the AfterGroupPosChanged event and set the visible position of the group in the child band to the visible position of the group in the parent band. This way when you move a group in the parent band it is moved in the child band. A similar approach can be used for the columns, but the event you need is AfterColPosChanged.
I have modified your sample in order to demonstrate this suggestion.
Please let me know if this is what you are looking for.
Thanks for your help, though it looks complicated to use in my code, I think that's what I need.
Synchronizing the size between the bands will also require a similar approach like the one from my previous reply. The event you need is also the AfterGroupPosChanged, but this time you need to check if the PosChanged parameter is equal to Sized. If it is set the group width from the child band to be the same as the one from the parent band.
I have attached modified the sample to demonstrate this suggestion.
Hi,DimitarThanks for your help. But I think the sample code is not what I want.What the drag effect is when I resize the "Title" or "Date", the data below in the tree will also resize.
I'll attach some screenshot. Could you please help with that?Thanks for your concern.