Hi,
I'm wondering if it is possible to always show the add row at the top of the grid, even when rows are grouped. I have my add row set like this:
e.Layout.Override.AllowAddNew = AllowAddNew.FixedAddRowOnTop;
This is fixed at the top, but once I drag a column into the group header area, I no longer have an add row showing. I would like the add row to show right above all the grouped rows. Is this possible?
Thanks,
~Corey
Hi Corey,
The TemplateAddRow is not supported when the grid is grouped. You should Submit a feature request to Infragistics
Mike,
I have submitted a feature request for this. I have been trying to find a way to implement the functionality that we want by using a CreationFilter. My theory was that I can Offset some of the UIElements in the grid to create a space where I can create my own custom template add row that will always show in the grid even when grouping. I have successfully created this space by using the following code:
public void AfterCreateChildElements(UIElement parent)
{
if (parent is RowColRegionIntersectionUIElement)
foreach (UIElement element in parent.ChildElements)
if (!(element is BandHeadersUIElement))
element.Offset(0, 23, true);
}
This provides me with the space I need to attempt to add my own set of controls to mimic an add row. From the BandHeadersUIElement I can get each visible ColumnHeader and the Editor that is used for that column. My problem is that I can't seem to create those editor controls and add them as child elements of the RowColRegionIntersectionUIElement. Is it even possible to do this? I have tried many different things here. It seems like you can only add simple things like text, images, and buttons. What I really want to do is add my own row here, or add a series of controls that match the editor for the column and I can size and space them accordingly. (dates, combos, etc)
With all my efforts I am starting to think this isn't possible to do, but I wanted to post first to verify.
Thanks for your help,
It may be 'possible' to do this, but it's really not realistic. Simply creating the UIElement would not be enough, you'd have to somehow associated it with a row in the underlying data source and handle all sorts of issues. It would be a huge amount of code.
It would be probably be easier to use a second grid bound to the same data source with no group and just show a single TemplateAddRow then to try to get it into the same grid.