Completed
Last Updated: 05 Nov 2014 12:49 by ADMIN
ADMIN
Dess | Tech Support Engineer, Principal
Created on: 31 Oct 2014 10:57
Category: Editors
Type: Bug Report
0
FIX. RadAutoCompleteBox - RadTokenizedTextItem.Value property is null if we bind to DataTable
To reproduce: 

public Form1()
{
    InitializeComponent();

    this.radAutoCompleteBox1.AutoCompleteDataSource = ReturnDummyDataTable();
    this.radAutoCompleteBox1.AutoCompleteDisplayMember = "Sum";
    this.radAutoCompleteBox1.AutoCompleteValueMember = "Answer"; 
}

private DataTable ReturnDummyDataTable()
{
    DataTable dt = new DataTable();
    dt.Columns.Add("Sum");
    dt.Columns.Add("Answer");

    for (int i = 0; i <= 50; i++)
    {
        DataRow DR = default(DataRow);
        DR = dt.NewRow();
        DR[0] = i + " + 1";
        DR[1] = (i + 1);
        i += 1;
        dt.Rows.Add(DR);
    }

    return dt;
}

private void radButton1_Click(object sender, EventArgs e)
{
    string Buffer = "";
    if (this.radAutoCompleteBox1.Items.Count == 0)
    {
    }
    else
    {
        foreach (RadTokenizedTextItem item in this.radAutoCompleteBox1.Items)
        {
            if (Buffer.Length > 1)
            {
                Buffer = Buffer + Environment.NewLine + item.Text + " " + "= " + item.Value;
            }
            else
            {
                Buffer = item.Text + " " + "= " + item.Value;
            }
        }
        MessageBox.Show(Buffer, "Selected Items", MessageBoxButtons.OK, MessageBoxIcon.Information);
    }
}


Workaround: set the AutoCompleteDataSource property after setting the AutoCompleteDisplayMember and the AutoCompleteValueMember properties.
1 comment
ADMIN
Stefan
Posted on: 05 Nov 2014 12:49
We have just issued a new release - Q3 2014 2014.3.1104, which covers this issue and couple more issues important for our customers. For complete list of changes, please refer to our Release Notes (http://www.telerik.com/support/whats-new/winforms/release-history/ui-for-winforms-q3-2014-(version-2014.3.1104)).