Completed
Last Updated: 16 Nov 2015 16:06 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 08 Oct 2015 12:35
Category:
Type: Feature Request
1
ADD. RadCheckedDropDownList - implement functionality for adding DescriptionTextListDataItems
Note: in data bound scenario, when setting the DescriptionTextMember property, DescriptionTextListDataItems should be created.

Workaround: use custom items:

private void radCheckedDropDownList1_CreatingVisualListItem(object sender, CreatingVisualListItemEventArgs args)
{
    args.VisualItem = new CustomRadListVisualItem();
}

public class CustomRadListVisualItem : RadCheckedListVisualItem
{
    protected override Type ThemeEffectiveType     
    { 
        get    
        { 
            return typeof(RadListVisualItem);     
        }
    }

    LightVisualElement description = new LightVisualElement();

    protected override void CreateChildElements()
    {
        base.CreateChildElements();
        StackLayoutPanel stack = this.Children.First() as StackLayoutPanel;
        description.ForeColor = Color.Gray;
        stack.Children.Add(description);
    }

    public override void Synchronize()
    {
        base.Synchronize();
        RadCheckedListDataItem dataItem = (RadCheckedListDataItem)this.Data;
        if (dataItem != null)
        {
            DataRowView drv = dataItem.DataBoundItem as DataRowView;
            if (drv != null)
            {
                description.Text = drv.Row[dataItem.Owner.DescriptionTextMember] + "";
            }
        }
    }
}
0 comments