Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
395
How can I customize AddNewBox?
posted

Hello guys,

I am gonna insert some controls into AddNewBox, like some buttons or images. I tried to use CreationFilter to achieve this.However, I can never see controls I added.

In my CreationFilter:

 ...

public void AfterCreateChildElements(Infragistics.Win.UIElement parent)

{

if (parent is AddNewBoxUIElement)

{

parent.ChildElements.Clear();

ButtonUIElement btn1 = (ButtonUIElement)parent.GetDescendant(typeof(ButtonUIElement));

if (btn1 == null)

{

btn1 = new ButtonUIElement(parent);

}

btn1.Text =
"all";

parent.ChildElements.Add(btn1);

}

}

...

in my form:

...

grid.DisplayLayout.Override.AllowAddNew = AllowAddNew.Yes;

grid.DisplayLayout.AddNewBox.Hidden = false;

grid.DataSource = lsResult;

AddNewCreationFilter addNew = new AddNewCreationFilter();

grid.CreationFilter = addNew;

...

When I debug I can see the buttonUIElement control is added, but it never appears on the UI.

Any idea on this?

Cheers,

Elton