<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by DlhSoft on Medium]]></title>
        <description><![CDATA[Stories by DlhSoft on Medium]]></description>
        <link>https://medium.com/@dlhsoft?source=rss-7e0895b66fd3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Ha9MPT0sjCGHVNxjd_afPg.png</url>
            <title>Stories by DlhSoft on Medium</title>
            <link>https://medium.com/@dlhsoft?source=rss-7e0895b66fd3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 04 Dec 2026 05:09:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dlhsoft/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Building a Camper Reservation Planner in WPF with ScheduleChartDataGrid]]></title>
            <link>https://medium.com/gantt-chart-libraries/building-a-camper-reservation-planner-in-wpf-with-schedulechartdatagrid-a4fb98be74bb?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4fb98be74bb</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[charts]]></category>
            <category><![CDATA[wpf]]></category>
            <category><![CDATA[schedule]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Thu, 02 Jul 2026 15:20:28 GMT</pubDate>
            <atom:updated>2026-07-02T15:20:28.013Z</atom:updated>
            <content:encoded><![CDATA[<h4>A practical example of using DlhSoft Gantt Chart Library to manage vehicles, reservations, half-day scheduling, visual status, and print-ready planning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WJzRtQ0cf7lMZuZ51EVXfw.png" /></figure><blockquote><em>Download full sample app source code:<br></em><a href="https://dlhsoft.sharepoint.com/:u:/s/Support/IQA00P4kKQs7TKRKoaOlEU82ARQm1qgvknk3JPZOLLIagfY?e=7FlrRa"><em>CamperReservationsWpf.zip</em></a></blockquote><p>Reservation systems are a natural fit for timeline-based user interfaces.</p><p>Whether you are managing hotel rooms, shared equipment, vehicles, boats, classrooms, medical devices, or rental campers, the core problem is often the same:</p><blockquote>You have a list of resources, and each resource can be booked for specific time intervals.</blockquote><p>A traditional table can show the data, but it does not immediately answer the most important operational questions:</p><ul><li>Which campers are available?</li><li>Which ones are already reserved?</li><li>Do two reservations overlap?</li><li>How long does each booking last?</li><li>What does the schedule look like for the next few days or weeks?</li><li>Can the current plan be printed and shared?</li></ul><p>This sample application shows how to build a compact camper reservation planner in WPF using ScheduleChartDataGridfrom <strong>DlhSoft Gantt Chart Library for WPF</strong>.</p><p>The application displays campers as rows and reservations as timeline bars. Users can add or remove campers, create and edit appointments, prevent overlapping reservations, color-code different types of bookings, select chart bars directly, and print the schedule.</p><h3>The scenario</h3><p>The sample models a small camper rental business.</p><p>Each row represents a camper:</p><pre>ScheduleChartItem vehicle = new ScheduleChartItem<br>{<br>    Content = vehicleName<br>};</pre><p>Each reservation, maintenance period, transfer, tour, or rental is represented by a GanttChartItem inside that camper row:</p><pre>GanttChartItem reservation = new GanttChartItem<br>{<br>    Content = label,<br>    Start = start,<br>    Finish = finish<br>};<br><br>vehicle.GanttChartItems.Add(reservation);</pre><p>This maps very naturally to ScheduleChartDataGrid:</p><ul><li>ScheduleChartItem = one schedulable resource</li><li>GanttChartItem = one appointment on that resource</li><li>Start / Finish = the reservation interval</li><li>Content = what the user sees in the grid or on the bar</li></ul><p>The result is a resource schedule: campers on the left, time on the right.</p><h3>Adding ScheduleChartDataGrid to the WPF view</h3><p>The XAML declares the control using the DlhSoft namespace:</p><pre>xmlns:pdgcc=&quot;clr-namespace:DlhSoft.Windows.Controls;<br>             assembly=DlhSoft.ProjectData.GanttChart.LightWPF.Controls&quot;</pre><p>The main control is then placed in the window layout:</p><pre>&lt;pdgcc:ScheduleChartDataGrid x:Name=&quot;ScheduleChartDataGrid&quot;<br>                             DataGridWidth=&quot;0.18*&quot;<br>                             ChartWidth=&quot;0.82*&quot;<br>                             HourWidth=&quot;4&quot;<br>                             ItemHeight=&quot;38&quot;<br>                             BarHeight=&quot;24&quot;<br>                             StandardBarCornerRadius=&quot;7&quot;<br>                             HeaderHeight=&quot;84&quot;<br>                             ScaleHeaderHeight=&quot;28&quot;<br>                             WorkingWeekStart=&quot;Sunday&quot;<br>                             WorkingWeekFinish=&quot;Saturday&quot;<br>                             VisibleWeekStart=&quot;Sunday&quot;<br>                             VisibleWeekFinish=&quot;Saturday&quot;<br>                             IsChartClickSelectionEnabled=&quot;True&quot;<br>                             IsChartSelectionHighlightingEnabled=&quot;False&quot; /&gt;</pre><p>A few settings are especially important for this type of application.</p><p>DataGridWidth and ChartWidth split the interface between the camper list and the timeline area. In this sample, the chart receives most of the horizontal space because the visual timeline is the main working area.</p><p>ItemHeight and BarHeight define a compact row layout. For reservation systems, this matters because users often need to scan many resources quickly.</p><p>IsChartClickSelectionEnabled allows users to click directly on chart bars, making the timeline interactive rather than merely decorative.</p><h3>Creating a half-day timeline</h3><p>Many reservation workflows do not need hourly precision. For camper rental, a half-day resolution can be much more practical: morning pickup, afternoon return, transfer at midday, and so on.</p><p>The sample configures the visible range and disables nonworking-time highlighting because camper reservations can span any day of the week:</p><pre>ScheduleChartDataGrid.WorkingDayStart =<br>    ScheduleChartDataGrid.VisibleDayStart =<br>        TimeOfDay.MinValue;<br>ScheduleChartDataGrid.WorkingDayFinish =<br>    ScheduleChartDataGrid.VisibleDayFinish =<br>        TimeOfDay.MaxValue;<br>ScheduleChartDataGrid.IsNonworkingTimeHighlighted = false;</pre><p>The initial timeline covers three months:</p><pre>timelineStart = InitialTimelineStart;<br>timelineFinish = timelineStart.AddMonths(InitialTimelineMonths);<br><br>ScheduleChartDataGrid.SetTimelinePage(timelineStart, timelineFinish);<br>ScheduleChartDataGrid.DisplayedTime = timelineStart;</pre><p>The chart uses three scales:</p><pre>&lt;pdgcc:ScheduleChartDataGrid.Scales&gt;<br>    &lt;pdgcc:ScaleCollection&gt;<br>        &lt;pdgcc:Scale ScaleType=&quot;Months&quot; HeaderContentFormat=&quot;Custom&quot; /&gt;<br>        &lt;pdgcc:Scale ScaleType=&quot;Days&quot; HeaderContentFormat=&quot;Custom&quot; /&gt;<br>        &lt;pdgcc:Scale ScaleType=&quot;Custom&quot; HeaderContentFormat=&quot;Custom&quot; /&gt;<br>    &lt;/pdgcc:ScaleCollection&gt;<br>&lt;/pdgcc:ScheduleChartDataGrid.Scales&gt;</pre><p>The third scale is custom and creates 12-hour intervals:</p><pre>ScheduleChartDataGrid.GetScale(2).IntervalProvider = (start, finish) =&gt;<br>{<br>    List&lt;ScaleInterval&gt; intervals = new List&lt;ScaleInterval&gt;();<br><br>    for (DateTime date = start.Date; date &lt; finish; date = date.AddHours(12))<br>        intervals.Add(new ScaleInterval(date, date.AddHours(12)));<br>    return intervals;<br>};<br><br>ScheduleChartDataGrid.GetScale(2).HeaderContentProvider =<br>    (start, finish) =&gt; start.Hour &lt; 12 ? &quot;0/12&quot; : &quot;13/24&quot;;</pre><p>This gives users a clear operational view:</p><ul><li>month</li><li>day</li><li>first half / second half of day</li></ul><p>That small customization makes the control feel purpose-built for the reservation domain.</p><h3>Loading sample camper data</h3><p>The sample initializes several campers and reservations:</p><pre>AddVehicle(<br>    &quot;CAMPER 2P AB123CD&quot;,<br>    CreateReservation(<br>        &quot;Smith family&quot;,<br>        new DateTime(2026, 6, 1, 0, 0, 0),<br>        new DateTime(2026, 6, 4, 12, 0, 0),<br>        &quot;ReservationGreenFill&quot;,<br>        &quot;ReservationGreenStroke&quot;));</pre><p>The helper method keeps the data model simple:</p><pre>private ScheduleChartItem AddVehicle(<br>    string vehicleName,<br>    params GanttChartItem[] reservations)<br>{<br>    ScheduleChartItem vehicle = new ScheduleChartItem<br>    {<br>        Content = vehicleName<br>    };<br><br>    foreach (GanttChartItem reservation in reservations)<br>        vehicle.GanttChartItems.Add(reservation);<br><br>    ScheduleChartDataGrid.Items.Add(vehicle);<br><br>    return vehicle;<br>}</pre><p>Reservations are created separately:</p><pre>private GanttChartItem CreateReservation(<br>    string label,<br>    DateTime start,<br>    DateTime finish,<br>    string fillResourceKey,<br>    string strokeResourceKey)<br>{<br>    GanttChartItem reservation = new GanttChartItem<br>    {<br>        Content = label,<br>        Start = start,<br>        Finish = finish<br>    };<br><br>    ApplyAppointmentColor(<br>        reservation,<br>        FindColorOption(fillResourceKey, strokeResourceKey));<br><br>    return reservation;<br>}</pre><p>This separation is useful because in a real application these items would usually come from a database or API. The same pattern still applies: create one schedule item per resource, then add its appointments.</p><h3>Color-coding reservations</h3><p>The sample uses different colors for different appointment types:</p><ul><li>reservation</li><li>service</li><li>tour</li><li>rental</li><li>unavailable</li><li>alert</li><li>transfer or fresh status</li></ul><p>Color options are initialized once:</p><pre>appointmentColorOptions.Add(<br>    CreateColorOption(<br>        &quot;Reservation Green&quot;,<br>        &quot;ReservationGreenFill&quot;,<br>        &quot;ReservationGreenStroke&quot;));\<br><br>appointmentColorOptions.Add(<br>    CreateColorOption(<br>        &quot;Service Blue&quot;,<br>        &quot;ReservationBlueFill&quot;,<br>        &quot;ReservationBlueStroke&quot;));<br><br>appointmentColorOptions.Add(<br>    CreateColorOption(<br>        &quot;Unavailable Gray&quot;,<br>        &quot;UnavailableGrayFill&quot;,<br>        &quot;UnavailableGrayStroke&quot;));</pre><p>Each color option stores the display name and the actual WPF brushes:</p><pre>private AppointmentColorOption CreateColorOption(<br>    string displayName,<br>    string fillResourceKey,<br>    string strokeResourceKey)<br>{<br>    return new AppointmentColorOption(<br>        displayName,<br>        fillResourceKey,<br>        strokeResourceKey,<br>        Resources[fillResourceKey] as Brush,<br>        Resources[strokeResourceKey] as Brush);<br>}</pre><p>The color is attached to the appointment using helper properties:</p><pre>private void ApplyAppointmentColor(<br>    GanttChartItem appointment,<br>    AppointmentColorOption colorOption)<br>{<br>    if (appointment == null || colorOption == null)<br>        return;<br><br>    AppointmentVisual.SetColorOption(appointment, colorOption);<br>    AppointmentVisual.SetFillBrush(appointment, colorOption.FillBrush);<br>    AppointmentVisual.SetStrokeBrush(appointment, colorOption.StrokeBrush);<br>}</pre><p>The chart bar template then binds to those visual properties:</p><pre>&lt;Border Background=&quot;{Binding Path=(local:AppointmentVisual.FillBrush),<br>                             Converter={StaticResource BarFillFallbackConverter}}&quot;<br>        BorderBrush=&quot;{Binding Path=(local:AppointmentVisual.StrokeBrush),<br>                              Converter={StaticResource BarStrokeFallbackConverter}}&quot;<br>        CornerRadius=&quot;7&quot; /&gt;</pre><p>This approach keeps the scheduling model clean while still allowing rich visual customization.</p><h3>Adding and editing appointments</h3><p>The application includes a custom appointment dialog where users can edit:</p><ul><li>appointment label</li><li>start date</li><li>start half-day</li><li>finish date</li><li>finish half-day</li><li>color</li></ul><p>The dialog converts UI choices into real DateTime values:</p><pre>start = startDatePicker.SelectedDate.Value.Date;<br><br>if (startHalf.Value)<br>    start = start.AddHours(12);<br><br>finish = finishDatePicker.SelectedDate.Value.Date.AddHours(12);<br><br>if (finishHalf.Value)<br>    finish = finishDatePicker.SelectedDate.Value.Date.AddDays(1);</pre><p>This is a good pattern for business applications: the user works with domain-friendly options, while the chart receives precise date-time values.</p><p>When the user creates a new appointment, the application validates the selected camper first:</p><pre>if (selectedCamper == null)<br>{<br>    MessageBox.Show(<br>        this,<br>        &quot;Select the car that will receive the new appointment first.&quot;,<br>        &quot;Add Appointment&quot;,<br>        MessageBoxButton.OK,<br>        MessageBoxImage.Information);<br><br>    return;<br>}</pre><p>Then the dialog is shown:</p><pre>AppointmentEditorResult values;<br><br>if (!AppointmentDialog.TryEdit(<br>        this,<br>        &quot;Add Appointment&quot;,<br>        GetDefaultAppointmentValues(),<br>        appointmentColorOptions,<br>        out values))<br>    return;</pre><p>If the interval is valid, the new appointment is added to the selected camper:</p><pre>GanttChartItem appointment = new GanttChartItem<br>{<br>    Content = values.Label,<br>    Start = values.Start,<br>    Finish = values.Finish<br>};<br><br>ApplyAppointmentColor(appointment, values.ColorOption);<br><br>selectedCamper.GanttChartItems.Add(appointment);</pre><p>The chart updates because the appointment is part of the camper’s GanttChartItems collection.</p><h3>Preventing overlapping reservations</h3><p>A reservation planner must prevent accidental double-booking.</p><p>The sample checks for overlap before adding or editing an appointment:</p><pre>private bool HasOverlappingAppointment(<br>    ScheduleChartItem camper,<br>    DateTime start,<br>    DateTime finish,<br>    GanttChartItem ignoredAppointment)<br>{<br>    if (camper == null)<br>        return false;<br><br>    foreach (GanttChartItem appointment in camper.GanttChartItems)<br>    {<br>        if (ReferenceEquals(appointment, ignoredAppointment))<br>            continue;<br><br>        if (start &lt; appointment.Finish &amp;&amp; finish &gt; appointment.Start)<br>            return true;<br>    }<br><br>    return false;<br>}</pre><p>The overlap rule is intentionally simple and reliable:</p><pre>start &lt; appointment.Finish &amp;&amp; finish &gt; appointment.Start</pre><p>This allows adjacent bookings while blocking intersecting ones.</p><p>For example, one reservation can finish at noon and another can start at noon on the same camper. That is valid. But two reservations that both occupy the same half-day will be rejected.</p><h3>Synchronizing chart selection and side-panel details</h3><p>The main view includes a side panel showing the selected camper and selected appointment. It also displays a list of appointments for the selected camper.</p><p>When a camper is selected, the list is refreshed:</p><pre>AppointmentsListBox.ItemsSource =<br>    selectedCamper != null<br>        ? selectedCamper.GanttChartItems<br>        : null;</pre><p>Users can select an appointment either from the side list or directly from the chart bar. The chart bar template handles mouse selection:</p><pre>private void TaskBarHost_MouseLeftButtonDown(<br>    object sender,<br>    MouseButtonEventArgs e)<br>{<br>    FrameworkElement taskBarHost = sender as FrameworkElement;<br><br>    GanttChartItem appointment =<br>        taskBarHost != null<br>            ? taskBarHost.DataContext as GanttChartItem<br>            : null;<br><br>    if (appointment != null)<br>        SetSelectedAppointment(appointment);<br>}</pre><p>This gives the application a smooth workflow:</p><ol><li>Select a camper row.</li><li>See its appointments.</li><li>Click a chart bar.</li><li>Edit or delete the appointment.</li><li>Immediately see the updated schedule.</li></ol><h3>Keeping the timeline large enough</h3><p>When a new appointment is added outside the current timeline range, the sample expands the timeline so the item remains visible.</p><p>Conceptually, the logic is:</p><pre>EnsureTimelineIncludes(appointment.Start, appointment.Finish);</pre><p>This is a small usability detail, but it matters. Users should not add a valid booking and then wonder where it went because it falls outside the visible range.</p><h3>Printing the reservation schedule</h3><p>The sample also includes print support.</p><p>Before printing, it determines the default range based on the existing appointments:</p><pre>foreach (ScheduleChartItem camper in ScheduleChartDataGrid.Items)<br>{<br>    foreach (GanttChartItem appointment in camper.GanttChartItems)<br>    {<br>        if (appointment.Start &lt; firstStart)<br>            firstStart = appointment.Start;<br><br>        if (appointment.Finish &gt; lastFinish)<br>            lastFinish = appointment.Finish;<br>    }<br>}</pre><p>The user can then choose the print interval and orientation. The application temporarily adjusts the chart timeline for printing:</p><pre>DateTime oldTimelineStart = ScheduleChartDataGrid.TimelinePageStart;<br>DateTime oldTimelineFinish = ScheduleChartDataGrid.TimelinePageFinish;<br>DateTime oldDisplayedTime = ScheduleChartDataGrid.DisplayedTime;<br><br>try<br>{<br>    ScheduleChartDataGrid.SetTimelinePage(printStart, printFinish);<br>    ScheduleChartDataGrid.DisplayedTime = printStart;<br>    ScheduleChartDataGrid.UpdateLayout();<br><br>    PrintScheduleChartPages(printDialog, pageSize, title);<br>}<br>finally<br>{<br>    ScheduleChartDataGrid.SetTimelinePage(oldTimelineStart, oldTimelineFinish);<br>    ScheduleChartDataGrid.DisplayedTime = oldDisplayedTime;<br>    ScheduleChartDataGrid.UpdateLayout();<br>}</pre><p>The important part is that the user’s working view is restored after printing.</p><p>For a real reservation office, this makes the application practical beyond the screen: schedules can be printed, archived, handed to staff, or shared with operations teams.</p><h3>Why ScheduleChartDataGrid works well for reservations</h3><p>Although ScheduleChartDataGrid is often associated with project planning and Gantt-style interfaces, this sample highlights a broader use case: resource booking.</p><p>The model is generic enough to support many domains as the same pattern applies everywhere:</p><pre>Resource -&gt; Collection of time intervals</pre><p>That is exactly what ScheduleChartDataGrid is designed to display.</p><h3>Possible next steps</h3><p>This sample is intentionally compact, but it can be extended in several directions.</p><p>For a production application, you might add:</p><ul><li>database persistence</li><li>customer details</li><li>payment or booking status</li><li>drag-and-drop editing</li><li>tooltips with reservation metadata</li><li>filtering by camper type</li><li>conflict reports</li><li>export to PDF</li><li>availability search</li><li>integration with online booking forms</li><li>custom business rules for pickup and return times</li></ul><p>The core scheduling experience would remain the same: a grid of resources combined with a visual timeline of reservations.</p><h3>Conclusion</h3><p>This camper reservation sample shows how quickly a WPF application can become operationally useful when the scheduling model is visual.</p><p>With ScheduleChartDataGrid, the application does not need to invent a custom timeline control from scratch. It can focus on business behavior:</p><ul><li>managing campers</li><li>creating reservations</li><li>preventing overlaps</li><li>showing availability</li><li>color-coding appointment types</li><li>selecting and editing bookings</li><li>printing the schedule</li></ul><p>For developers building desktop applications that need resource planning, booking, allocation, or dispatching features, this pattern provides a clean and reusable foundation.</p><p>The important idea is simple:</p><blockquote><em>Treat each resource as a schedule row, treat each booking as a timeline item, and let the chart make availability visible.</em></blockquote><p>That visibility is what turns reservation data into a usable planning tool.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4fb98be74bb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/building-a-camper-reservation-planner-in-wpf-with-schedulechartdatagrid-a4fb98be74bb">Building a Camper Reservation Planner in WPF with ScheduleChartDataGrid</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using an Access Database with GanttChartDataGrid in a WinForms Application]]></title>
            <link>https://medium.com/gantt-chart-libraries/using-an-access-database-with-ganttchartdatagrid-in-a-winforms-application-d7030d4e6656?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7030d4e6656</guid>
            <category><![CDATA[wpf]]></category>
            <category><![CDATA[access-database]]></category>
            <category><![CDATA[winforms-integration]]></category>
            <category><![CDATA[gantt-chart-library]]></category>
            <category><![CDATA[gantt-chart]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Sun, 31 Aug 2025 06:31:35 GMT</pubDate>
            <atom:updated>2025-08-31T06:31:35.389Z</atom:updated>
            <content:encoded><![CDATA[<p>When building project management applications with <strong>DlhSoft Gantt Chart Library for WPF</strong>, you sometimes need to integrate existing data sources such as Microsoft Access databases. In this article, we’ll show how you can load and edit tasks stored in an Access .accdb file, while hosting a <strong>GanttChartDataGrid</strong> control inside a WinForms application.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/0*mq69EJoGnMV2PIk_.png" /></figure><h4>1. Project Setup</h4><p>We’ll create a <strong>WinForms application</strong> that hosts a <strong>WPF UserControl</strong> (with GanttChartDataGrid).</p><p>The structure is simple:</p><ul><li><strong>Form1.cs</strong> → WinForms main form, using ElementHost to display WPF content.</li><li><strong>UserControl1.xaml</strong> → WPF UI, containing a GanttChartDataGrid.</li><li><strong>UserControl1.xaml.cs</strong> → logic to load/save tasks from the Access database.</li><li><strong>Database1.accdb</strong> (in <strong>AppData</strong>) → Access database with a Tasks table (data shown in the Gantt chart).</li></ul><h4>2. Hosting WPF in WinForms</h4><p>In the main form, we just place an ElementHost control, and set its child to our WPF user control:</p><pre>public Form1()<br>{<br>    InitializeComponent();<br>    elementHost1.Child = new UserControl1();<br>}</pre><p>This way, the Gantt chart will render seamlessly inside a WinForms window.</p><h4>3. Loading Tasks from Access</h4><p>Our Access database (Database1.accdb) contains a table Tasks with fields:</p><ul><li><strong>Id</strong> (primary key);</li><li><strong>Task</strong> (string);</li><li><strong>StartDate</strong> (DateTime);</li><li><strong>EndDate</strong> (DateTime).</li></ul><p>Inside UserControl1.xaml.cs, we connect using <strong>OleDb</strong>:</p><pre>string connectionString = <br>    @&quot;Provider=Microsoft.ACE.OLEDB.12.0;Data Source=.\AppData\Database1.accdb;Persist Security Info=True;&quot;;<br>string query = &quot;SELECT * FROM Tasks&quot;;<br><br>using (OleDbConnection conn = new OleDbConnection(connectionString))<br>{<br>    OleDbDataAdapter adapter = new OleDbDataAdapter(query, conn);<br>    DataTable dataTable = new DataTable();<br>    adapter.Fill(dataTable);<br><br>    var items = new ObservableCollection&lt;GanttChartItem&gt;();<br>    foreach (DataRowView row in dataTable.DefaultView)<br>    {<br>        var item = new GanttChartItem<br>        {<br>            Content = row[&quot;Task&quot;],<br>            Start = (DateTime)row[&quot;StartDate&quot;],<br>            Finish = (DateTime)row[&quot;EndDate&quot;],<br>            Tag = (int)row[&quot;Id&quot;]<br>        };<br>        items.Add(item);<br>    }<br>    GanttChartDataGrid.Items = items;<br>}</pre><p>Each record becomes a GanttChartItem, with the task name, start, and finish dates.</p><h4>4. Updating the Database</h4><p>We also want changes made by the user in the GanttChartDataGrid to update the Access database.</p><p>This is handled in the ItemPropertyChanged event:</p><pre>private void GanttChartDataGrid_ItemPropertyChanged(<br>    object sender, PropertyChangedEventArgs e)<br>{<br>    var item = sender as GanttChartItem;<br>    var id = (int)item.Tag;<br><br>    if (e.PropertyName == &quot;Content&quot; || <br>        e.PropertyName == &quot;Start&quot; || <br>        e.PropertyName == &quot;Finish&quot;)<br>    {<br>        using (OleDbConnection conn = new OleDbConnection(connectionString))<br>        {<br>            OleDbDataAdapter adapter = new OleDbDataAdapter(&quot;SELECT * FROM Tasks&quot;, conn);<br>            OleDbCommandBuilder builder = new OleDbCommandBuilder(adapter);<br><br>            DataTable dataTable = new DataTable();<br>            adapter.Fill(dataTable);<br><br>            var row = dataTable.Select(&quot;Id=&quot; + id).Single();<br>            row.BeginEdit();<br>            switch (e.PropertyName)<br>            {<br>                case &quot;Content&quot;: row[&quot;Task&quot;] = item.Content; break;<br>                case &quot;Start&quot;:   row[&quot;StartDate&quot;] = item.Start; break;<br>                case &quot;Finish&quot;:  row[&quot;EndDate&quot;] = item.Finish; break;<br>            }<br>            row.EndEdit();<br>            adapter.Update(dataTable);<br>        }<br>    }<br>}</pre><p>This ensures that any change to the task name or dates in the UI is persisted back to Access.</p><h4>5. Running the Application</h4><p>When you run the app:</p><ul><li>The <strong>GanttChartDataGrid</strong> will load tasks directly from your Access database.</li><li>Editing a task’s content or dates will automatically update the database.</li></ul><p>This gives you a smooth integration between <strong>DlhSoft Gantt Chart Library for WPF</strong> and legacy Access-based data sources, even inside a WinForms environment.</p><h4>Sample app</h4><p>The full sample source code — either C# or Visual Basic — is available <a href="https://dlhsoft.sharepoint.com/:u:/s/Support/ETrS77AgwGNKleu_c1SthwgBVIOayVAav02kuQzOZkfryw">here</a>. Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7030d4e6656" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/using-an-access-database-with-ganttchartdatagrid-in-a-winforms-application-d7030d4e6656">Using an Access Database with GanttChartDataGrid in a WinForms Application</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Drag and Drop Between Two Boards in WPF]]></title>
            <link>https://medium.com/gantt-chart-libraries/drag-and-drop-between-two-boards-in-wpf-71e84d32ca9d?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/71e84d32ca9d</guid>
            <category><![CDATA[kanban-library]]></category>
            <category><![CDATA[wpf]]></category>
            <category><![CDATA[kanban-board]]></category>
            <category><![CDATA[extending-behavior]]></category>
            <category><![CDATA[drag-and-drop]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Wed, 27 Aug 2025 06:33:32 GMT</pubDate>
            <atom:updated>2025-08-27T06:33:32.487Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the most requested features when working with Kanban boards is the ability to <strong>move cards between boards</strong>.</p><p>With <a href="https://dlhsoft.com/KanbanLibrary.wpf"><strong>DlhSoft Kanban Library for WPF</strong></a>, this can be done using a simple <strong>Thumb</strong> based drag-and-drop implementation on top of the built-in KanbanBoard control.</p><p>In this article, we’ll walk through a sample WPF project that enables drag and drop between two KanbanBoard instances: a <strong>source board</strong> and a <strong>target board</strong>.</p><h4>Project Setup</h4><p>We start from a standard WPF project with two KanbanBoard controls defined in MainWindow.xaml:</p><pre>&lt;Window x:Class=&quot;DraggingBetweenKanbanBoards.MainWindow&quot;<br>        xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;<br>        xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;<br>        xmlns:kanban=&quot;clr-namespace:KanbanLibrary;assembly=KanbanLibrary&quot;<br>        Title=&quot;Drag Between KanbanBoards&quot; Width=&quot;800&quot; Height=&quot;600&quot;&gt;<br>    &lt;Grid x:Name=&quot;Root&quot;&gt;<br>        &lt;Grid.ColumnDefinitions&gt;<br>            &lt;ColumnDefinition Width=&quot;*&quot; /&gt;<br>            &lt;ColumnDefinition Width=&quot;*&quot; /&gt;<br>        &lt;/Grid.ColumnDefinitions&gt;<br><br>        &lt;!-- Source Kanban board --&gt;<br>        &lt;kanban:KanbanBoard x:Name=&quot;SourceKanbanBoard&quot;<br>                            Grid.Column=&quot;0&quot;<br>                            Margin=&quot;10&quot; /&gt;<br><br>        &lt;!-- Target Kanban board --&gt;<br>        &lt;kanban:KanbanBoard x:Name=&quot;TargetKanbanBoard&quot;<br>                            Grid.Column=&quot;1&quot;<br>                            Margin=&quot;10&quot; /&gt;<br><br>        &lt;!-- Dragging item visualization --&gt;<br>        &lt;ContentControl x:Name=&quot;DraggingItemControl&quot;<br>                        Visibility=&quot;Collapsed&quot;<br>                        IsHitTestVisible=&quot;False&quot;<br>                        RenderTransformOrigin=&quot;0.5,0.5&quot;&gt;<br>            &lt;Border Background=&quot;White&quot; BorderBrush=&quot;Gray&quot; BorderThickness=&quot;1&quot; Padding=&quot;4&quot; /&gt;<br>        &lt;/ContentControl&gt;<br>    &lt;/Grid&gt;<br>&lt;/Window&gt;</pre><h4>Initializing Boards</h4><p>In MainWindow.xaml.cs, we populate the boards with sample states, groups, and items:</p><pre>SourceKanbanBoard.States = new ObservableCollection&lt;KanbanState&gt;<br>{<br>    new KanbanState { Content = &quot;Orders&quot; },<br>    new KanbanState { Content = &quot;Pickorders&quot; },<br>};<br>SourceKanbanBoard.Items = new ObservableCollection&lt;KanbanItem&gt;<br>{<br>    new KanbanItem { Content = &quot;Order 2&quot;, State = SourceKanbanBoard.States.Last() },<br>    new KanbanItem { Content = &quot;Order 3&quot;, State = SourceKanbanBoard.States.Last() },<br>    new KanbanItem { Content = &quot;Order 4&quot; },<br>};<br>SourceKanbanBoard.AreNewItemButtonsHidden = true;<br><br>TargetKanbanBoard.Groups = new ObservableCollection&lt;KanbanGroup&gt;<br>{<br>    new KanbanGroup { Content = &quot;July&quot; },<br>    new KanbanGroup { Content = &quot;August&quot; },<br>    new KanbanGroup { Content = &quot;September&quot; },<br>};<br>TargetKanbanBoard.Items = new ObservableCollection&lt;KanbanItem&gt;<br>{<br>    new KanbanItem { Content = &quot;Order 1&quot; },<br>};<br>TargetKanbanBoard.AreNewItemButtonsHidden = true;</pre><p>At this point, both boards display items, but without any drag-and-drop behavior.</p><h4>Implementing Drag and Drop</h4><p>We attach handlers for Thumb drag events:</p><ul><li><strong>DragStarted</strong>: capture the dragged item and show a floating visual (DraggingItemControl).</li><li><strong>DragDelta</strong>: move the visual along with the mouse, and detect the potential target state/group using hit testing.</li><li><strong>DragCompleted</strong>: finalize the drop, remove the item from the source, and insert it into the target.</li></ul><pre>private void Thumb_DragStarted(object sender, DragStartedEventArgs e)<br>{<br>    var element = sender as Thumb;<br>    DraggingItem = element!.DataContext as KanbanItem;<br>    // Show item in overlay visual for smooth dragging<br>    ...<br>}</pre><pre>private void Thumb_DragDelta(object sender, DragDeltaEventArgs e)<br>{<br>    // Update dragged item position<br>    // Highlight target group if hovered<br>    ...<br>}</pre><pre>private void Thumb_DragCompleted(object sender, DragCompletedEventArgs e)<br>{<br>    ...<br><br>    // Move the item between boards<br>    SourceKanbanBoard.Items.Remove(DraggingItem);<br>    DraggingItem!.Group = DraggingTargetGroup ?? TargetKanbanBoard.Groups.First();<br>    DraggingItem!.State = DraggingTargetState ?? TargetKanbanBoard.States.First();<br>    TargetKanbanBoard.Items.Add(DraggingItem);<br>}</pre><p>This way, when a user drags a card from the source board and drops it over the target, it is removed from the first collection and added to the second.</p><h4>Sample app</h4><p>Of course, there’s more under the hood. We’ve prepared a sample app with complete source code to help you get into this easily — <a href="https://dlhsoft.sharepoint.com/:u:/s/Support/EUWgwL38G6dOoT7olY2ss24BZhPttTIHVjTGmiMsYMal2w">here</a> it is. Enjoy!</p><h4>Result</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*Ha7qxqE1cLPdwIuv1DKh1A.gif" /></figure><p>When you run the application:</p><ul><li>Dragging a card from the left board displays a floating preview.</li><li>Hovering over a group on the right board highlights it.</li><li>Dropping the card transfers it to the selected group/state in the target board.</li></ul><p>This simple approach demonstrates how flexible <strong>DlhSoft Kanban Library for WPF</strong> is when it comes to extending behavior. You can easily adapt this to support drag-and-drop across more boards, external sources, or even across processes.</p><h4>Reference</h4><p><a href="https://dlhsoft.com/KanbanLibrary.wpf/Documentation/index.html">DlhSoft Kanban Library documentation</a></p><p>Main classes:</p><ul><li>KanbanBoard</li><li>KanbanItem</li><li>KanbanGroup</li><li>KanbanState</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71e84d32ca9d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/drag-and-drop-between-two-boards-in-wpf-71e84d32ca9d">Drag and Drop Between Two Boards in WPF</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customizing DatePicker Styling in DlhSoft Gantt Chart Hyper Library]]></title>
            <link>https://medium.com/gantt-chart-libraries/customizing-datepicker-styling-in-dlhsoft-gantt-chart-hyper-library-6e7eb65f9c0b?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e7eb65f9c0b</guid>
            <category><![CDATA[datepicker]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[styling]]></category>
            <category><![CDATA[gantt-chart-hyper-library]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Mon, 25 Aug 2025 06:31:39 GMT</pubDate>
            <atom:updated>2025-08-25T06:31:39.099Z</atom:updated>
            <content:encoded><![CDATA[<p>When building project management applications, user experience matters just as much as functionality. While <a href="https://dlhsoft.com/GCHL"><strong>DlhSoft Gantt Chart Hyper Library</strong></a> provides a powerful scheduling component out of the box, you can easily take its UI further by customizing built-in controls — such as the DatePickers used for <strong>Start</strong> and <strong>Finish</strong> columns.</p><p>In this article, we’ll show how to style these DatePickers to better match your application’s design.</p><h4>The Default Setup</h4><p>By default, the GanttChartView control displays Start and Finish columns as editable fields with integrated DatePickers. Here’s a minimal HTML setup:</p><pre>&lt;script src=&quot;Scripts/DlhSoft.ProjectData.GanttChart.HTML.Controls.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;app.js&quot; defer&gt;&lt;/script&gt;</pre><pre>&lt;div id=&quot;ganttChartView&quot; style=&quot;height: 388px&quot;&gt;&lt;/div&gt;</pre><p>And in app.js, you configure the component with tasks:</p><pre>const items = [<br>  { content: &quot;Task A&quot;, start: new Date(), finish: new Date(2025, 0, 15) },<br>  { content: &quot;Task B&quot;, start: new Date(2025, 0, 5), finish: new Date(2025, 0, 20) }<br>];<br><br>DlhSoft.Controls.GanttChartView.initialize(<br>  document.getElementById(&quot;ganttChartView&quot;),<br>  items<br>);</pre><p>This gives you a functional Gantt chart with editable date fields.</p><h4>Customizing the DatePicker</h4><p>The integrated DatePickers expose a set of CSS classes (.dlh-calendar-*) that you can override in your stylesheet.</p><p>For example, in our app.css, we defined:</p><pre>/* DatePicker container */<br>.dlh-calendar-container {<br>    background-color: #fff;<br>}<br><br>/* Month and year header */<br>tr.dlh-calendar-monthyearheader,<br>tr.dlh-calendarselector-header {<br>    background-color: azure !important;<br>}<br><br>/* Day of week */<br>.dlh-calendar-dayofweekheader {<br>    font-size: 14px !important;<br>    color: #97c11d !important;<br>    padding: 8px !important;<br>}<br><br>/* Days */<br>.dlh-calendar-day {<br>    color: darkblue !important;<br>    font-size: 14px !important;<br>    padding: 4px !important;<br>}<br>.dlh-calendar-day:hover {<br>    background-color: #2ddfd644;<br>}<br><br>/* Selected day */<br>.dlh-calendar-selectedday {<br>    background-color: #2ddfd6 !important;<br>    color: white;<br>}</pre><p>With these simple rules, you can:</p><ul><li>Change background and hover colors;</li><li>Increase font sizes;</li><li>Adjust padding for better readability;</li><li>Highlight selected and disabled days more clearly.</li></ul><h4>Result</h4><p>After applying the custom styles, your DatePickers will integrate seamlessly with your app’s design system:</p><p>✅ Clearer day headers<br>✅ Branded colors for selection<br>✅ Improved usability</p><p>Here’s a quick preview:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*T0A1hMmMAH6a3US9-cls0Q.gif" /></figure><h4>Conclusion</h4><p>Styling matters — especially for controls like DatePickers that users interact with frequently. With just a few CSS overrides, you can significantly improve the usability and look of the GanttChartView’s built-in editors.</p><p>👉 Try this in your own project and give your users a more polished scheduling experience!</p><h4>Reference</h4><p>Below is a quick reference of the CSS classes you can override to fully customize the DatePicker integrated into the <strong>Start</strong>and <strong>Finish</strong> columns of GanttChartView:</p><ul><li>.dlh-calendar-container – root container</li><li>.dlh-calendar-dayofweekheader – day-of-week header cells</li><li>.dlh-calendar-monthyearheader – month/year header cells</li><li>.dlh-calendar-day – regular day cells</li><li>.dlh-calendar-disabledday – disabled day cells</li><li>.dlh-calendar-othermonthday – days belonging to another month</li><li>.dlh-calendar-selectedday – selected day cells</li><li>.dlh-calendar-todaylink – &quot;today&quot; link text</li><li>.dlh-calendarselector-header – selector header (when switching views)</li><li>.dlh-calendarselector-time – time selector cells</li><li>.dlh-calendarselector-selectedtime – selected time cell</li></ul><p>With these selectors, you can customize <strong>colors, fonts, padding, hover states, and more</strong> to match your application’s design system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e7eb65f9c0b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/customizing-datepicker-styling-in-dlhsoft-gantt-chart-hyper-library-6e7eb65f9c0b">Customizing DatePicker Styling in DlhSoft Gantt Chart Hyper Library</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Localize DlhSoft GanttChartView in Your Web Apps]]></title>
            <link>https://medium.com/gantt-chart-libraries/how-to-localize-dlhsoft-ganttchartview-in-your-web-apps-c2b4a669d73e?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c2b4a669d73e</guid>
            <category><![CDATA[gantt-chart-hyper-library]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[localization]]></category>
            <category><![CDATA[gantt-chart]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Sat, 23 Aug 2025 12:29:45 GMT</pubDate>
            <atom:updated>2025-08-23T12:29:45.257Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Localization</strong> is essential for modern applications, especially in project management tools where international teams collaborate daily. With the <a href="https://dlhsoft.com/GCHL"><strong>DlhSoft Gantt Chart Hyper Library</strong></a>, you can easily provide localized UI text for both the <strong>GanttChartView control</strong> and any surrounding elements you build.</p><p>In this article, we’ll show how to add <strong>multi-language support</strong> (English and French) to a Gantt chart sample using simple HTML, CSS, and JavaScript.</p><h4>1. The Setup</h4><p>We start with a basic HTML page referencing the DlhSoft Gantt Chart Hyper Library:</p><pre>&lt;script src=&quot;Scripts/DlhSoft.ProjectData.GanttChart.HTML.Controls.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;Scripts/DlhSoft.Data.HTML.Controls.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;app.js&quot; defer&gt;&lt;/script&gt;</pre><p>And a container for the chart:</p><pre>&lt;div id=&quot;ganttChartView&quot; style=&quot;height: 388px&quot;&gt;&lt;/div&gt;</pre><h4>2. Adding the Language Switcher</h4><p>Above the chart, we include a simple ribbon with two toggle buttons for English and French:</p><pre>&lt;div class=&quot;ribbonContainer&quot;&gt;<br>  &lt;div class=&quot;ribbonPanel&quot;&gt;<br>    &lt;div class=&quot;ribbonHeader&quot; data-lang=&quot;Language&quot;&gt;Language&lt;/div&gt;<br>    &lt;div class=&quot;ribbonCommandsArea&quot;&gt;<br>      &lt;div class=&quot;ribbonCommand toggle pressed&quot; id=&quot;toggleENCommand&quot;&gt;<br>        &lt;a onclick=&quot;changeLanguage(&#39;en&#39;)&quot; title=&quot;English&quot;&gt;EN&lt;/a&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;ribbonCommand toggle&quot; id=&quot;toggleFRCommand&quot;&gt;<br>        &lt;a onclick=&quot;changeLanguage(&#39;fr&#39;)&quot; title=&quot;French&quot;&gt;FR&lt;/a&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/div&gt;</pre><p>The styling (app.css) ensures a clean, familiar ribbon look with pressed states for selected languages.</p><h4>3. Defining Localized Strings</h4><p>Inside app.js, we define translations for both the chart control and ribbon headers:</p><pre>const resources = {<br>  en: {<br>    Language: &quot;Language&quot;,<br>    Start: &quot;Start&quot;,<br>    Finish: &quot;Finish&quot;,<br>    Task: &quot;Task&quot;,<br>    // …other chart column headers or tooltips<br>  },<br>  fr: {<br>    Language: &quot;Langue&quot;,<br>    Start: &quot;Début&quot;,<br>    Finish: &quot;Fin&quot;,<br>    Task: &quot;Tâche&quot;,<br>    // …other translations<br>  }<br>};</pre><h4>4. Applying Localization</h4><p>We provide a changeLanguage function to apply the chosen translations:</p><pre>function changeLanguage(lang) {<br>  const localizedStrings = resources[lang];<br><br>  // Update ribbon headers<br>  document.querySelectorAll(&quot;[data-lang]&quot;).forEach(el =&gt; {<br>    const key = el.getAttribute(&quot;data-lang&quot;);<br>    el.innerText = localizedStrings[key] || key;<br>  });<br><br>  // Update GanttChartView column headers<br>  ganttChartView.settings = {<br>    ...ganttChartView.settings,<br>    columns: [<br>      { header: localizedStrings.Task, width: 100, property: &quot;content&quot; },<br>      { header: localizedStrings.Start, width: 80, property: &quot;start&quot; },<br>      { header: localizedStrings.Finish, width: 80, property: &quot;finish&quot; }<br>    ]<br>  };<br>  ganttChartView.refresh();<br>}</pre><p>When the user clicks <strong>EN</strong> or <strong>FR</strong>, both the ribbon and the Gantt chart update instantly.</p><h4>5. The Result</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sp0J-elOFi84A04NTilWVA.png" /></figure><ul><li>The ribbon header changes between <em>Language</em> and <em>Langue</em>.</li><li>Gantt chart column headers switch between <em>Task / Start / Finish</em> and <em>Tâche / Début / Fin</em>.</li><li>The toggle buttons reflect the active language.</li></ul><p>With a few lines of code, we now have a fully localized project management interface!</p><h4>Sample app</h4><p>A sample app with more features and complete source code, including CSS, is available <a href="https://dlhsoft.sharepoint.com/:u:/s/Support/ER5-wnSdT5BMpf9W3QSjZyMBAVFBVo8drIfVkd3YxVWWBw">here</a>!</p><h4>6. Extending Further</h4><p>To extend this feature further, you can:</p><ul><li>Add more languages by extending the resources object.</li><li>Localize tooltips, context menus, or dialog windows in the same way.</li><li>Combine with CSS themes (light/dark) for a polished international UI.</li></ul><h4><strong>Conclusion</strong></h4><p>Localization with the <strong>DlhSoft Gantt Chart Hyper Library</strong> is straightforward and flexible. By separating your strings into a dictionary and wiring a simple language switcher, you can make your Gantt chart apps ready for global teams.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c2b4a669d73e" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/how-to-localize-dlhsoft-ganttchartview-in-your-web-apps-c2b4a669d73e">How to Localize DlhSoft GanttChartView in Your Web Apps</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Milestones always on top]]></title>
            <link>https://medium.com/gantt-chart-libraries/milestones-always-on-top-f3212ef78daf?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f3212ef78daf</guid>
            <category><![CDATA[multiple]]></category>
            <category><![CDATA[bars]]></category>
            <category><![CDATA[gantt-chart-library]]></category>
            <category><![CDATA[milestones]]></category>
            <category><![CDATA[z-index]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Fri, 16 May 2025 17:34:50 GMT</pubDate>
            <atom:updated>2025-05-16T17:34:50.299Z</atom:updated>
            <content:encoded><![CDATA[<h4>(when displayed in Multiple bars per row sample app)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQXq2zyVeN9zu8XQiV7Z0A.png" /></figure><p>If you have checked our <em>Demos</em> app you may have seen our <em>Multiple bars per row</em> sample already (screenshot above).</p><p>This is enabled by setting both <em>GanttChartDataGrid.Items</em> (to a collection of items to be shown in grid) and — after <em>ApplyTemplate</em> call — <em>GanttChartDataGrid.GanttChartView.Items</em> (to the collection of bar items, with <em>DisplayRowIndex</em> property set appropriately; <em>GanttChartDataGrid.GanttChartView.DisplayRowCount</em> is preset as well.)</p><p>If you have run this app, however, you have probably seen that the <em>last</em> clicked (and dragged) bar will always become on top (see bar <em>1.2</em> below):</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9HpnctKOYyL9fu-JylRDSw.png" /></figure><p>But when you add milestone items to the Gantt chart area as well, a problem arises: bars come on top of milestones and they are not visible anymore.</p><pre>for (int j = 1; j &lt;= 3; j++)<br>{<br>  GanttChartItem chartItem = new GanttChartItem<br>  {<br>    Content = String.Format(&quot;{0}.{1}&quot;, i, j),<br>    Start = j == 1 ? DateTime.Today.AddDays((j + 1) * (i + 4)) : DateTime.Today.AddDays(j * (i + 4)),<br>    Finish = DateTime.Today.AddDays(4 + j * (i + 4)),<br>    DisplayRowIndex = i - 1,<br>    IsMilestone = j == 1, // some items are milestones<br>  };<br>  chartItems.Add(chartItem);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uDr6wV3o2yWKRIGiAKFhpA.png" /></figure><p>Now if you click on bar <em>1.2</em>, it would partially cover the (<em>1.1</em>) milestone! If the milestone is first moved a bit to the right, it could get fully covered by the white bar, and it would be difficult to know that it’s there.</p><p>To solve this issue, one can simply detect clicks and make sure milestones are on top — for example by setting <em>ZIndex</em> property to <em>zero</em> on the elements that are not bound to milestones (this needs to be postponed a bit, however, using <em>BeginInvoke</em> and a lower dispatcher priority):</p><pre>GanttChartDataGrid.PreviewMouseLeftButtonUp += (sender, e) =&gt;<br>{<br>  Dispatcher.BeginInvoke((Action)delegate<br>  {<br>    var element = e.OriginalSource as FrameworkElement;<br>    while (element != null)<br>    {<br>      var item = element.DataContext as GanttChartItem;<br>      if (item != null &amp;&amp; !item.IsMilestone &amp;&amp; Canvas.GetZIndex(element) &gt; 0)<br>      {<br>        Canvas.SetZIndex(element, 0);<br>        break;<br>      }<br>      element = VisualTreeHelper.GetParent(element) as FrameworkElement;<br>    }<br>  }, DispatcherPriority.ContextIdle);<br>};</pre><p>Enjoy!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f3212ef78daf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/milestones-always-on-top-f3212ef78daf">Milestones always on top</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating DlhSoft GanttChartView into a React app (next.js framework)]]></title>
            <link>https://medium.com/gantt-chart-libraries/integrating-dlhsoft-ganttchartview-into-a-react-app-next-js-framework-163510ed0d3f?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/163510ed0d3f</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[gantt]]></category>
            <category><![CDATA[nextjs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[jsx]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Fri, 04 Oct 2024 14:12:13 GMT</pubDate>
            <atom:updated>2024-10-04T14:12:13.081Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*L7fPu4hgPPDsV3FR" /><figcaption>Photo by <a href="https://unsplash.com/@lautaroandreani?utm_source=medium&amp;utm_medium=referral">Lautaro Andreani</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Even that React development has not changed much in the past years, React development… has! 🙃</p><p>What we mean is that while JSX files and class based components are, of course, still supported, we’d seen a trend towards using plain JavaScript based libraries (using hooks) and inline JSX (which requires a framework like <a href="https://nextjs.org/">next.js</a> rather than simply using babel) for developing production ready Web applications nowadays.</p><p>That means we’d needed to adapt our React extensions (originally JSX and class based) — and we have recently did exactly that! If you get the updated <em>@dlhsoft/ganttcharthyperlibrary</em> package using <em>npm</em> (or simply download it as a <a href="https://dlhsoft.com/packages/DlhSoft.GanttChartHyperLibrary.zip">.zip</a> directly from our Web site), you’ll see two new files which you can use:</p><pre>npm install @dlhsoft/ganttcharthyperlibrary</pre><pre>ls node_modules/@dlhsoft/ganttcharthyperlybrary<br><br>…<br>DlhSoft.ProjectData.GanttChart.React.Components.js<br>DlhSoft.ProjectData.PertChart.React.Components.js<br>…</pre><p>Unlike the <em>.jsx</em> counterparts, these files use plain JavaScript to define React wrapper components (we call them extensions) on top of <a href="https://dlhsoft.com/GCHL">DlhSoft Gantt Chart Hyper Library</a> for (pure) JavaScript.</p><p>So, how can one use the new extensions in a React app? Such as developed under a <em>next.js</em> environment, you may ask. Well, we’ve written a new, detailed, React tutorial describing how you can do that:</p><p><a href="https://dlhsoft.com/GanttChartHyperLibrary/Documentation/react/">Gantt Chart Hyper Library - React extensions - Tutorial</a></p><p>And here is the full associated source code, by the way:</p><p><a href="http://github.com/DlhSoftTeam/gchl-react-app">GitHub - DlhSoftTeam/gchl-react-app: Gantt Chart Hyper Library demo - using React and next.js</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e4l-KmTjY4hTJvLGa5FKZw.png" /><figcaption>Sample source code from the tutorial, shown in Visual Studio Code</figcaption></figure><p>Here, we just want to explain a few things further — from component usage perspective.</p><p>First, note that you can still create <em>GanttChartView</em> (and all the other React extensions we’ve provided) using JSX syntax, directly inside JavaScript:</p><pre>function Home() {<br>  …<br>  return (<br>    …<br>    &lt;GanttChartView items={items} settings={settings} license={license}<br>                    change={onItemChanged} style={{width: &#39;960px&#39;, height: &#39;350px&#39;}}<br>                    path={&#39;./&#39;}&gt;<br>      …<br>    &lt;/GanttChartView&gt;<br>    …<br>  );<br>}</pre><p>A mention to be made here, however, regards the introduction of the <em>path</em> prop: it allows you to configure the path where the underlying JavaScript files (<em>DlhSoft.ProjectData.GanttChart.HTML.Components.js</em> and alike) are actually available (inside the <em>public</em> folder of your app’s codebase). We no longer require you to include these files in the outer HTML template or layout! (Note that by default the value is ‘./’, so you won’t even need to pass it if you placed the scripts directly inside <em>public</em>.)</p><p>Then, loading data into <em>items</em> collection, and configuring <em>settings</em> object is going to be exactly like before. These are detailed in our <a href="https://dlhsoft.com/GanttChartHyperLibrary/Documentation/index.html?Gantt-chart">main documentation page</a> if you need more information.</p><p>Finally, note that if you plan to change <em>items</em> collection altogether, you’re going to be better if you define it using <em>useState</em> hook, establishing a <em>setItems</em> function too, like this:</p><pre>import { useState } from &#39;react&#39;;<br><br>…<br><br>const [items, setItems] = useState(tasks);</pre><p>Of course, <em>tasks</em> variable above needs to be an array of <em>GanttChartItem</em> objects — again, refer to the main documentation that we have provided for the product (link in one of the previous paragraphs) to know all the fields you can use. Enjoy!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LJxO946hpP-D51-zvXdGOA.png" /><figcaption>The sample app at runtime, in the local browser</figcaption></figure><p>And… (We almost forgot!) One more thing: while you develop your app and test our components and their React extensions (i.e. before purchasing a DlhSoft product license), your render method may be called two times by the <em>next.js</em> framework itself (by design), and you may therefore see DlhSoft licenses nag screens two times each run. To workaround this, simply go to <em>next.config.mjs</em> and insert this line, to disable strict mode, and you’re done:</p><pre>const nextConfig = {<br>    reactStrictMode: false,<br>};</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=163510ed0d3f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/integrating-dlhsoft-ganttchartview-into-a-react-app-next-js-framework-163510ed0d3f">Integrating DlhSoft GanttChartView into a React app (next.js framework)</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript GanttChartView in a Blazor server app]]></title>
            <link>https://medium.com/gantt-chart-libraries/javascript-ganttchartview-in-a-blazor-server-app-e343aee8acfd?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e343aee8acfd</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[blazor]]></category>
            <category><![CDATA[gantt-chart]]></category>
            <category><![CDATA[interop]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Wed, 05 Jun 2024 16:47:49 GMT</pubDate>
            <atom:updated>2024-07-02T14:07:35.941Z</atom:updated>
            <content:encoded><![CDATA[<p>If you’ve been asking around whether or not you can use <em>GanttChartView</em> (or another JavaScript component from <a href="https://dlhsoft.com/GCHL">DlhSoft Gantt Chart Hyper Library</a>) in a Blazor server app, there’s no need to search any further.</p><p>It is totally possible to do so!</p><p>If you want to just jump ahead, and view or download some code showing how you can do so, here you go: <a href="https://github.com/DlhSoftTeam/GanttChartHyperLibrary-BlazorServerApp">a sample app on GitHub</a> (or downloadable as a <a href="https://dlhsoft.sharepoint.com/:u:/s/Support/Edfe69spRWVLvAx9AiW1TqkB6JpNTaWMB37sAk4d9oR0Gg">zip file</a>, from our Web site directly).</p><p>If you want the details, read further, however:</p><p>A Blazor server app is written mostly using C# and HTML and it runs on server side, routing client side output and then input UI events back from the client browser through Signal R, under the hood.</p><p>However, you can interoperate C# and JavaScript too! Follow or adapt these steps to setup a <em>GanttChartView</em> component with a few items in your Blazor server app:</p><p>First, get <em>DlhSoft/GanttChartHyperLibrary</em> package, e.g. using <em>npm</em>:</p><pre>npm install @dlhsoft/ganttcharthyperlibrary</pre><p>Copy the files that you need from the package (<em>node_modules/@dlhsoft/GanttChartHyperLibrary</em> source directory) to <em>wwwroot/js</em> folder of the Visual Studio project of your Blazor app:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/722/1*I5vazq2f-V2wkUNinsCg-A.png" /></figure><p>In a Razor page of your project (e.g. <em>Pages/Counter.razor</em> file in our sample app), add a <em>div</em> to host the component:</p><pre>&lt;div id=&quot;ganttChartView&quot; style=&quot;width: 800px; height: 350px;&quot;/&gt;</pre><p>To initialize the component, you need to run some JavaScript code. Feel free to put your JavaScript functions in a separate <em>app.js</em> file under <em>wwwroot/js</em> folder. At first it may look like this:</p><pre>var ganttChartView;<br>window.interop = {<br>    initialize: () =&gt; {<br>        ganttChartView = document.getElementById(&quot;ganttChartView&quot;);<br>        DlhSoft.Controls.GanttChartView.initialize(ganttChartView,<br>            [{ content: &#39;Requirements&#39; }, { content: &#39;Analysis&#39; }],<br>            {});<br>    }<br>};</pre><p><em>interop.initialize</em> function defined above will just initialize the element in your DOM (discovered using its ID) as a <em>GanttChartView</em> component.</p><p>For this to work, though, you’ll need to link the script files into the <em>head</em> section of the main HTML listing — <em>Pages/_Layout.cshtml</em> file:</p><pre>&lt;script src=&quot;~/js/app.js&quot;&gt;&lt;/script&gt;<br>&lt;script src=&quot;~/js/DlhSoft.ProjectData.GanttChart.HTML.Controls.js&quot;&gt;&lt;/script&gt;</pre><p>To call the actual initialization function from C# using interoperation, add this code into the @code section of your razor page file (<em>Pages/Counter.razor</em>):</p><pre>@inject IJSRuntime JSRuntime<br><br>...<br><br>@code {<br>    protected async override void OnAfterRender(bool firstRender)<br>    {<br>        if (firstRender)<br>            await JSRuntime.InvokeVoidAsync(&quot;interop.initialize&quot;);   <br>    }<br>    ...<br>}</pre><p>At runtime the app should now look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SZBoZRFZe2Mdv4Jl.png" /></figure><p>Next, let’s add some code to add some more items to the <em>GanttChartView</em> component. Start with C# this time — the line under “<em>currentCount++</em>”:</p><pre>    private async void IncrementCount()<br>    {<br>        currentCount++;<br>        await JSRuntime.InvokeVoidAsync(&quot;interop.addItem&quot;, new { content = &quot;New item &quot; + currentCount });  <br>    }</pre><p>And then add the <em>interop.addItem</em> JavaScript function, of course:</p><pre>window.interop = {<br>    ...<br>    addItem: (item) =&gt; {<br>        ganttChartView.addItem(item);<br>    }<br>};</pre><p>You can see the items that are added upon clicking the <em>Increment count</em> button (renamed from “Click me” to “New task” in UI) are created in C# and marshaled down to JavaScript!</p><p>At runtime, after clicking the button twice, the UI would look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_9URiHV-EBBuK2dh.png" /></figure><p>Of course, the end user can drag and drop the item bars, or edit item information in the left grid:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6H_PnrM9mKI9itQU.png" /></figure><p>But for you to be able to handle these changes in C#, such as to save updates into a database, you’ll need to interoperate the other way. First, in JavaScript code, handle item property changes like this — using a <em>DotNet.invokeMethodAsync</em> call to reach a C# method (<em>ItemPropertyChanged</em>):</p><pre>window.interop = {<br>    initialize: () =&gt; {<br>        ...<br>        DlhSoft.Controls.GanttChartView.initialize(ganttChartView,<br>            [...],<br>            { itemPropertyChangeHandler: itemPropertyChanged });<br>    },<br>    ...<br>};<br>function itemPropertyChanged(item, propertyName, isDirect, isFinal) {<br>    if (!isDirect || !isFinal || propertyName == &#39;isSelected&#39;)<br>        return;<br>    DotNet.invokeMethodAsync(&#39;BlazorServerApp&#39;, &#39;ItemPropertyChanged&#39;, item.content + &#39;.&#39; + propertyName + &#39;=&#39; + item[propertyName]);<br>}</pre><p>The C# part involves creating a new class (e.g. under <em>ChangeHandler.cs</em> file) with an <em>ItemPropertyChanged</em> method there:</p><pre>using Microsoft.JSInterop;<br><br>namespace BlazorServerApp<br>{<br>    public static class ChangeHandler<br>    {<br>        [JSInvokable(&quot;ItemPropertyChanged&quot;)]<br>        public static void ItemPropertyChanged(string itemPropertyName)<br>        {<br>            Console.WriteLine($&quot;Change: { itemPropertyName }&quot;);<br>        }<br>    }<br>}</pre><p>And now you can see the updates in your server window, at the bottom of the window:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*qPlCEJpFcNQ9J0aX.png" /></figure><p>And that’s all — we hope it helps!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e343aee8acfd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/javascript-ganttchartview-in-a-blazor-server-app-e343aee8acfd">JavaScript GanttChartView in a Blazor server app</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Highlighting nonworking time for specific resources in Schedule chart — JavaScript (or…]]></title>
            <link>https://medium.com/gantt-chart-libraries/highlighting-nonworking-time-for-specific-resources-in-schedule-chart-javascript-or-9af43296ffcd?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/9af43296ffcd</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[individual]]></category>
            <category><![CDATA[resources]]></category>
            <category><![CDATA[schedule]]></category>
            <category><![CDATA[highlights]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Mon, 22 Apr 2024 18:14:24 GMT</pubDate>
            <atom:updated>2024-04-22T18:14:24.961Z</atom:updated>
            <content:encoded><![CDATA[<h3>Highlighting nonworking time for specific resources in Schedule chart — JavaScript (or Angular/React/Vue)</h3><p>\You might be aware that <em>GanttChartView</em> component can easily highlight nonworking time for individual items, i.e. those having custom Schedule objects attached, using <em>settings.isIndividualItemNonworkingTimeHighlighted</em> field.</p><p>It is also possible, however, to do the same thing in <em>ScheduleChartView</em>, where each row might be associated with a resource, though! To get the expected behavior, you’ll need to ensure you add a special entry to the resource item’s <em>ganttChartItems</em> collection — inserting it on first position of the array — setting up the <em>schedule</em> field to provide the working and nonworking time definitions to highlight. It is also highly recommended to remove alternative item background for resource rows in case you want to highlight individual schedules, or otherwise highlight grays might inadvertently mix:</p><pre>scheduleChartItems[1].ganttChartItems.splice(0, 0, {<br>  schedule: {<br>    workingWeekStart: 2, workingWeekFinish: 4,<br>    workingDayStart: 10 * 60 * 60 * 1000, workingDayFinish: 14 * 60 * 60 * 1000,<br>    specialNonworkingDays: [new Date(year, month, 24), new Date(year, month, 25)]<br>  }<br>});<br><br>settings = { <br>  ...<br>  alternativeChartItemStyle: &#39;fill: transparent;&#39;,<br>  isIndividualItemNonworkingTimeHighlighted: true<br>}</pre><p>In this example, the second item (row) in Schedule chart will have specially highlighted background for nonworking time. (The working time defined is between Tuesday and Thursday, and only between 10 AM and 2 PM; moreover, there are a couple of special nonworking days added as well.)</p><p>This is the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ifX-NzwujZam188r2RdpcA.png" /></figure><p>Note: the task items (bars assigned to each resource row) might still have individual schedules (working time definitions) themselves, unaffected — as in the screenshot above. The special <em>schedule</em> provider entry in <em>ganttChartItems</em> is only used for highlighting.</p><p>Of course, you can combine the techniques and have the same Schedule object for all items in the resource’s <em>ganttChartItems</em> collection if you want individual task bars to be draggable through the same schedule as the resource row highlight indicates.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9af43296ffcd" width="1" height="1" alt=""><hr><p><a href="https://medium.com/gantt-chart-libraries/highlighting-nonworking-time-for-specific-resources-in-schedule-chart-javascript-or-9af43296ffcd">Highlighting nonworking time for specific resources in Schedule chart — JavaScript (or…</a> was originally published in <a href="https://medium.com/gantt-chart-libraries">Gantt chart libraries</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Customizing Predecessors column and adding Successors column to GanttChartView for JavaScript +…]]></title>
            <link>https://dlhsoft.medium.com/customizing-predecessors-column-and-adding-successors-column-to-ganttchartview-for-javascript-d0d129270d60?source=rss-7e0895b66fd3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0d129270d60</guid>
            <category><![CDATA[predecessors]]></category>
            <category><![CDATA[gantt-chart]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[angular]]></category>
            <category><![CDATA[successor]]></category>
            <dc:creator><![CDATA[DlhSoft]]></dc:creator>
            <pubDate>Sat, 13 Apr 2024 10:31:01 GMT</pubDate>
            <atom:updated>2024-04-13T10:31:01.732Z</atom:updated>
            <content:encoded><![CDATA[<h3>Customizing Predecessors column and adding Successors column to GanttChartView for JavaScript + Angular, React, Vue</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6qMl12CCz2cH0r3wYew2Ow.png" /></figure><p>We’re back with some customization advice. This one will show how you can add custom <em>Predecessors</em> and <em>Successors</em> grid columns for your tasks using a <em>MultiSelectorComboBox</em>-based template (built-in), displaying task names in the list.</p><p>First, we need to note that <em>MultiSelectorComboBox</em> will actually use commas to separate selected items in the multi-value output, so we need to ensure we remove any commas (or replace them with other characters) from the task names when used as selectable items.</p><p>Then, we can jump right into updating <em>settings.columns</em> like below. To explain a bit here is how it goes:</p><p><em>GanttChartView.getDefaultColumns</em> can be used to generate some initial array to start with, including some of the common built-in columns.</p><p>Then, for <em>Predecessors</em> column that we then insert at an appropriate position we define three functions:</p><ul><li>the first one selects the items to be displayed in the combo box (filtering items that cannot be made dependent of this item because this item already depends of the other);</li><li>the second one determines the currently selected predecessors of the item, to be checked in <em>MultiSelectorComboBox</em> (separated by commas);</li><li>finally, the third one executes checkbox changes when the occur in <em>MultiSelectorComboBox</em>: resets item’s predecessors to the newly selected values (using <em>setItemPredecessorsString</em> function, passing a computed predecessors string out of indexes of selected values — third parameter is true to indicate we use zero-based indexes here) and refreshes the item and related <em>neighbourhood</em> to adapt to the new dependencies.</li></ul><p>For <em>Successors</em> column we need to define similar functions, but because the component is based on predecessor item definitions (and successors are just computed out of predecessor relations), the algorithms we use are a bit more complex, especially upon setting selected values:</p><pre>// Prepare the columns collection.<br>var columns = DlhSoft.Controls.GanttChartView.getDefaultColumns(items, settings);<br>var indexOffset = columns[0].isSelection ? 1 : 0;<br><br>columns.splice(3 + indexOffset, 0, { header: &#39;Predecessors&#39;, width: 200, cellTemplate: (item) =&gt; { return DlhSoft.Controls.GanttChartView.multiSelectorComboBoxInputColumnTemplateBase(<br>        document, 196,<br>        () =&gt; { return items.filter((i) =&gt; !ganttChartView.itemDependsOf(i, item)).map((i) =&gt; i.content.replaceAll(&#39;,&#39;, &#39;&#39;)); },<br>        () =&gt; { return item.predecessors ? item.predecessors.map((p) =&gt; p.item.content.replaceAll(&#39;,&#39;, &#39;&#39;)).join(&#39;, &#39;) : &#39;&#39; },<br>        (value) =&gt; {<br>            let allValues = items.map((i) =&gt; i.content.replaceAll(&#39;,&#39;, &#39;&#39;));<br>            let values = value.split(&#39;,&#39;).map((v) =&gt; v.trim());<br>            let predecessorsString = values.filter((v) =&gt; allValues.indexOf(v) &gt;= 0).map((v) =&gt; allValues.indexOf(v)).join(&#39;, &#39;);<br>            ganttChartView.setItemPredecessorsString(item, predecessorsString, true);<br>            if (item.predecessors) {<br>                for (predecessorItem of item.predecessors) {<br>                    ganttChartView.refreshItem(predecessorItem.item);<br>                }<br>            }<br>            ganttChartView.refreshItemNeighbourhood(item);<br>        }<br>    )}});<br><br>columns.splice(4 + indexOffset, 0, { header: &#39;Successors&#39;, width: 200, cellTemplate: (item) =&gt; { return DlhSoft.Controls.GanttChartView.multiSelectorComboBoxInputColumnTemplateBase(<br>        document, 196,<br>        () =&gt; { return items.filter((i) =&gt; !ganttChartView.itemDependsOf(item, i)).map((i) =&gt; i.content.replaceAll(&#39;,&#39;, &#39;&#39;)); },<br>        () =&gt; { return ganttChartView.getItemSuccessors(item).map((s) =&gt; s.content.replaceAll(&#39;,&#39;, &#39;&#39;)).join(&#39;, &#39;) },<br>        (value) =&gt; {<br>            let allValues = items.map((i) =&gt; i.content.replaceAll(&#39;,&#39;, &#39;&#39;));<br>            let values = value.split(&#39;,&#39;).map((v) =&gt; v.trim()).filter((v) =&gt; allValues.indexOf(v) &gt;= 0);<br>            let successors = ganttChartView.getItemSuccessors(item);<br>            let index = items.indexOf(item);<br>            for (successor of successors) {<br>                if (values.indexOf(successor.content) &lt; 0) {<br>                    let predecessorsString = &#39;, &#39; + ganttChartView.getItemPredecessorsString(successor) + &#39;,&#39;;<br>                    predecessorsString = predecessorsString.replace(&#39;, &#39; + (index + 1) + &#39;,&#39;, &#39;,&#39;);<br>                    ganttChartView.setItemPredecessorsString(successor, predecessorsString);<br>                    ganttChartView.refreshItemNeighbourhood(successor);<br>                }<br>            }<br>            for (value of values) {<br>                let successor = items[allValues.indexOf(value)];<br>                let predecessorsString = &#39;, &#39; + ganttChartView.getItemPredecessorsString(successor) + &#39;,&#39;;<br>                if (predecessorsString.indexOf(&#39;, &#39; + (index + 1) +  &#39;,&#39;) &lt; 0) {<br>                    predecessorsString = predecessorsString + (index + 1);<br>                    ganttChartView.setItemPredecessorsString(successor, predecessorsString);<br>                    ganttChartView.refreshItemNeighbourhood(successor);<br>                }<br>            }<br>            ganttChartView.refreshItemNeighbourhood(item);<br>        }<br>    )}});<br><br>settings.columns = columns;</pre><p>Finally, we need to also refresh the predecessor and successor items when task names change, to reflect changes in <em>MultiSelectorComboBox</em> instances that they use in the cells of the newly added columns:</p><pre>settings.itemPropertyChangeHandler = function (item, propertyName, isDirect, isFinal) {<br>   if (isDirect &amp;&amp; isFinal &amp;&amp; propertyName == &#39;content&#39;) {<br>        ganttChartView.refreshItemNeighbourhood(item);<br>        for (var successor of ganttChartView.getItemSuccessors(item))<br>            ganttChartView.refreshItem(successor);<br>    }<br>}</pre><p>And that’s all!</p><p><a href="https://dlhsoft.sharepoint.com/:u:/s/Support/EQwm6TL2A85KkcK7ExS-g8wBgL4kX8SX3plZCFLI_CkjTg?e=Ltlzpf">Here</a> is a sample app with full source code if you want to get more into it and test it on your side (see <em>index.html</em> there, and the script inside it).</p><p>Of course, for Angular, React, and Vue, you just need to inject the settings and item property change handler as expected in the target framework, but essentially the column definitions described above should apply in a similar way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0d129270d60" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>