Hi,
is it possible to put button in a grouped row? I would like to put a button on the right side something like that:
Hi,
is it possible to put button in a grouped row? I would like to put a button on the right side something like that:
Yes, that's possible with the following code:
TMSFNCDataGrid1.LoadSampleData;
TMSFNCDataGrid1.Group(3);
TMSFNCDataGrid1.Controls[0, 1] := Button1;
Thank you for explanation. I have a new question though - what is the correct way to find out which cells are grouped so I could put button on all grouped rows?
You can find out if a row is merged with
TMSFNCDataGrid1.IsRowMerged(ARow)
You need to add the button to the base cell with
cl := TMSFNCDataGrid1.BaseCell(0, ARow);
TMSFNCDataGrid1.Controls[cl.Column, cl.Row] := Button1;
You can also find out the type of row with
TMSFNCDataGrid1.RowTypes[ARow] := grtNode;
Thank you, it works. I have new question. When I changed data in rows, I need to refresh information in group header also. How do I refresh that information? I've tried ungroup and group again and looks like it's working, but is there any better way? Also, when I ungroup, all hidden columns are then visible. Is that correct?
Right now, when data changes, it could have effect on multiple groups, in terms of rows per group, the group header summary, etc... Right now, updating data requires ungrouping, and regrouping, to make sure all groups are properly updated. We already added on our list, a way to update groups without the need for regrouping, but it needs to be investigated. When ungrouping, columns are shown again. This is because there is an option to hide columns which are used for grouping. If you ungroup, all hidden columns are shown again. So additionally, you might need to hide the columns that were initially hidden before the grouping.
Thanks for clarification. I will then use ungroup/group and hide columns for now.