To reproduce:
Populate the AutoCompleteBox and start a search returning enough results to need the scrollbar. When clicking and dragging the scroll bar to scroll - if the cursor is not positioned directly over the scrollbar at the time you release the mouseclick, the dropdown list is closed an item is added to the selection.
Workaround:
public partial class Form1 : Form
{
bool isMouseDown = false;
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
AddAutoCompleteItems();
radAutoCompleteBox1.ListElement.VScrollBar.MouseDown += ListElement_MouseDown;
radAutoCompleteBox1.ListElement.VScrollBar.MouseUp += ListElement_MouseUp;
radAutoCompleteBox1.TokenValidating += radAutoCompleteBox1_TokenValidating;
}
void radAutoCompleteBox1_TokenValidating(object sender, TokenValidatingEventArgs e)
{
e.IsValidToken = !isMouseDown;
isMouseDown = false;
}
void ListElement_MouseUp(object sender, MouseEventArgs e)
{
RadListVisualItem el = radAutoCompleteBox1.ListElement.ElementTree.GetElementAtPoint(e.Location) as RadListVisualItem;
if (el != null)
{
return;
}
isMouseDown = false;
}
void ListElement_MouseDown(object sender, MouseEventArgs e)
{
isMouseDown = true;
}
private void AddAutoCompleteItems()
{
RadListDataItemCollection items = this.radAutoCompleteBox1.AutoCompleteItems;
items.Add(new RadListDataItem("Joe Smith", "joe@fakecompany.com"));
items.Add(new RadListDataItem("Adam Petersen", "adam@qwerty.com"));
items.Add(new RadListDataItem("Jack Russel", "jack@russel.nocom"));
items.Add(new RadListDataItem("Daniel Finger", "daniel.pinger@gmail.com"));
items.Add(new RadListDataItem("Richard Vail", "rvail@richardvail.com"));
items.Add(new RadListDataItem("Sebastian Jonnson", "s.jonnson@sjonnson.com"));
items.Add(new RadListDataItem("Lee Cooper", "lee.cooper@coopercoorp.com"));
items.Add(new RadListDataItem("Kelvin Clain", "kclain@clainkevin.com"));
items.Add(new RadListDataItem("Maria Jenson", "mjenson@mariajenson.com"));
items.Add(new RadListDataItem("Chelsea Maarten", "chelsea@maarten.com"));
items.Add(new RadListDataItem("Jenson Chew", "jenson.chew@nospam.com"));
items.Add(new RadListDataItem("Martin Williams", "m.williams@martinandwilliams.com"));
items.Add(new RadListDataItem("Telerik", "clientservice@telerik.com"));
items.Add(new RadListDataItem("James Stone", "james.stone@manystones.com"));
items.Add(new RadListDataItem("Samuel Jackson", "samuel.jackson@nojackson.com"));
}
}
public class MyRadAutoCompleteBox : RadAutoCompleteBox
{
protected override RadTextBoxControlElement CreateTextBoxElement()
{
return new MyRadAutoCompleteBoxElement();
}
}
public class MyRadAutoCompleteBoxElement : RadAutoCompleteBoxElement
{
protected override TextBoxViewElement CreateViewElement()
{
return new MyAutoCompleteBoxViewElement();
}
protected override Type ThemeEffectiveType
{
get
{
return typeof(RadAutoCompleteBoxElement);
}
}
}
public class MyAutoCompleteBoxViewElement : AutoCompleteBoxViewElement
{
protected override int InsertTokenizedTextBlocks(int index, string text, bool performInvalidation)
{
bool isValid = performInvalidation ? this.OnTokenValidating(text) : true;
if (!isValid)
{
return index;
}
return base.InsertTokenizedTextBlocks(index, text, performInvalidation);
}
When working with RadAutoCompleteBox if one tries to remove a token from the collection through clicking on the close "x" button of the token the TextBoxElement of the text box loses focus, even though it look as if it still contains it.
To reproduce: - Add text that contain multiple blank lines to a textBox - Set SpellCheckMode to AllAtOnce - Perform a spell check.
To reproduce: - Subscribe to MaskedEditBox Element PropertyChanged event. - You will notice that when you changing the value will not raise the event. Workaround: You can track the Text property for changes and parse the text to appropriate value.
To reproduce:
- Add RadMaskedEditBox to a form and set its ReadOnly property to true.
- Paste a valid value using the Ctrl+V key combination.
Workaround:
- Disable the corresponding key combination in the KeyDown event:
void radMaskedEditBox1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && e.KeyCode == Keys.V)
{
e.SuppressKeyPress = true;
}
}
Add option to RadSpellChecker which will allow you to append the newly added words to the loaded dictionary and save them on the hard drive.
RadColorDialog does not work when assemblies has been merged, because RadColorEditor's CreateColorSelectorInstance method has hardcoded search for Telerik.WinControls.UI.dll assembly.
RadTextBox does not serialize its Size if it has been added into FlowLayoutPanel, and in run time it has incorrect size.
A possibility to specify the default time (to be different from 00:00) when choosing date value from the drop-down calendar.
A nice add-on to the control would be having Get/SetTextField methods, allowing for complete customization of each masked field.
Make the Title of RadColorDialog accessible in the ColorDialogLocalizationProvider class
Exception is thrown on key press if RadMaskedEditBox has MaskType set to Numeric, Mask to C2, and Value to Null.
RadColorDialog ignores some of the values provided in the overridden GetLocalizedString method. These are for example the tabs of the RadPageView.
Setting the ActiveMode property does not change the initially selected tab of the RadColorDialog.
FIX. RadDateTimePicker - when the NullDate is set for example to DateTime.Now and you clear the value with SetToNullText, then you can not type the value for the current month.
Add a functionality that allows the user to disable the spin editor like behavior when the MaskType is setting to Numeric.
If you put RadTextBox on a form, set its Anchor to Bottom \ Left and you show the form using the following code:
RadForm1 rf = new RadForm1();
rf.MdiParent = this;
rf.WindowState = FormWindowState.Maximized;
RadColorDialog is not localized properly when an instance of it is created after the localization provider is set.
FIX. RadDateTimePicker - black border appears on disabled control with Windows7 theme.