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
125
localization of ultraGanttView and context menu on dependency line
posted

Hello,

question to localization:
in GridView:  i succeeded in changing captions for example from duration to Dauer. But how to change the units in this column from hours to Stunden, day(s) to Tag(e) and so on?

I succeded to change the field names in diaolog "Field chooser" but how to change the title of this dialog?

I found http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.1/CLR2.0/html/WinSchedule_Resource_Strings.html
but I don´t know how to apply them.

question context menu in GanttView:
Is it possible to install a context menu on dependeny lines? How?

Thanks for help,

joerg

  • 69832
    Verified Answer
    Offline posted

    iXsystems said:
    But how to change the units in this column from hours to Stunden, day(s) to Tag(e) and so on?

    You can localize the unit of time tokens in the duration field's editor like so:

    Infragistics.Win.UltraWinGanttView.Resources.Customizer.SetCustomizedString(
        "TimeSpanEditor_DayDisplayString_Singular",
        "tag");

    Infragistics.Win.UltraWinGanttView.Resources.Customizer.SetCustomizedString(
        "TimeSpanEditor_DayDisplayString_Plural",
        "tage");

    Each unit of time has a corresponding string resource, following the same convention as above, i.e., WeekDisplayString, HoutrDisplayString, MinuteDisplayString, and each has a Singular/Plural variant

    iXsystems said:
    Is it possible to install a context menu on dependeny lines?

    You could handle the control's ContextMenuInitializing event and add a menu item for the dependency, like so:

    using nsGVElements = Infragistics.Win.UltraWinGanttView.UIElements;

    this.ganttView.AutoDisplayDefaultContextMenu = AutoDisplayDefaultContextMenu.GridAreaOrChartArea;
    this.ganttView.ContextMenuInitializing += new ContextMenuInitializingHandler(ganttView_ContextMenuInitializing);

    void ganttView_ContextMenuInitializing(object sender, ContextMenuInitializingEventArgs e)
    {
        UltraGanttView control = sender as UltraGanttView;
        UIElement controlElement = control.UIElement;
        Point clientPos = control.PointToClient(Control.MousePosition);
        UIElement elementAtPoint = controlElement != null ? controlElement.ElementFromPoint( clientPos ) : null;

        nsGVElements.TaskDependencyLineUIElement lineElement =
            elementAtPoint as nsGVElements.TaskDependencyLineUIElement;

        if ( lineElement != null )
        {
            TaskDependency dependency = lineElement.GetContext( typeof(TaskDependency) ) as TaskDependency;
            IGMenuItem menuItem = new IGMenuItem("Dependency");
            e.ContextMenu.MenuItems.Add( menuItem );
        }
    }