Skip to main content

IResourceLinksSelector.SelectResourceLinks(Object) Method

Allows you to implement custom logic for choosing resource links.

Namespace: DevExpress.Xpf.Gantt

Assembly: DevExpress.Xpf.Gantt.v24.2.dll

NuGet Package: DevExpress.Wpf.Gantt

Declaration

IEnumerable SelectResourceLinks(
    object item
)

Parameters

Name Type
item Object

Returns

Type
IEnumerable

Remarks

public class ResourceLinksSelector : MarkupExtension, DevExpress.Xpf.Gantt.IResourceLinksSelector {
    public override object ProvideValue(IServiceProvider serviceProvider) {
        return this;
    }
    public IEnumerable SelectResourceLinks(object item) {
        var task = (GanttTask)item;
        if(task.Tag == null)
            return null;
        return ((string)task.Tag)
            .Split(';')
            .Select(x => new GanttResourceLink() { ResourceId = Convert.ToInt32(x) })
            .ToList();
    }
}  
See Also