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
715
PrgoressBar in TreeNode
posted

Hi,

 

how can i create custom UIElement.

i tried  it by inherting from UIElement and overriding Draw method..but it does't work. break point in DrawMethod never hits.

 

Thanks,

Kumar

  • 69832
    Verified Answer
    Offline posted

    The general answer to your question is (as you stated) to derive from UIElement. Yes, you can also override the Draw method. The likeliest explanation for your breakpoint not getting hit is that the element was never added to the ChildElements collection of some other UIElement that the control is using to handle its drawing.

    The Infragistics.Win.IUIElementCreationFilter interface is specifically designed to solve problems like this; there are 2 simple methods to implement, and they allow you to add these custom elements to the control's element tree (as well as remove the default ones). Our knowledge base and product samples contain examples of how to do this.

    Regarding how to get a progress bar in a tree node: If you are using the 'Grid' ViewStyle, you would want to have a column of type int, and assign an Infragistics.Win.UltraWinProgressBar.ProgressBarEditor to that column's Editor property. If you are not using columns, you cannot realistically use that editor because the values UltraTree provides to an embeddable editor are of type string, and a ProgressBarEditor will not do anything useful with string data.