Use attached to reproduce. Workaround: class MyListView : RadListView { protected override RadListViewElement CreateListViewElement() { return new MyListViewElement(); } } class MyListViewElement : RadListViewElement { protected override Type ThemeEffectiveType => typeof(RadListViewElement); public override void SynchronizeVisualItems() { for (int i = 0; i < this.ViewElement.ViewElement.Children.Count; i++) { BaseListViewVisualItem visualItem = (BaseListViewVisualItem)this.ViewElement.ViewElement.Children[i]; visualItem.Synchronize(); } this.Invalidate(); } }
Hello,
I have 2 models with properties. I get an error when changing the datasource
I assign them in the following way:
CardView1.DataSource = BindingList<Model1>
CardView1.Datasource = BindingList2>Model2>
When i swap the datasource i get the following error: "There is no property descriptor corresponding to property name: Code"
"Code" is a property only present in the first model (Model1).
Seems like i have to reset some properties before swapping datasource? i already tried CardView1.DataSource = null before assigning Model2 but got same error
To reproduce: run the attached sample project on 150%. Workaround: this.radCheckedDropDownList1.Multiline = true;
Hi,
This is related to ticket#1401471 , the other ticket was accidentally closed. Please see the screen shot using the below settings mentioned i was able to achieve the Icon display but grouping is not showing correctly, is there setting for grouping also to display correctly?
https://www.telerik.com/account/support-tickets/view-ticket/1401471
radListView1.CheckBoxesPosition = CheckBoxesPosition.Top
Private
Sub
RadListView1_VisualItemFormatting(
ByVal
sender
As
Object
,
ByVal
e
As
ListViewVisualItemEventArgs)
Dim
item = TryCast(e.VisualItem, IconListViewVisualItem)
If
item IsNot
Nothing
Then
item.TextImageRelation = TextImageRelation.TextAboveImage
item.TextAlignment = ContentAlignment.MiddleCenter
item.ImageAlignment = ContentAlignment.MiddleCenter
End
If
End
Sub
Steps:
1) Add a RadForm with a button and a ListView in DetailView mode.
2) Add some columns. Add some items with values for each cell.
3) Apply Fluent Theme to all controls.
4) In the click handler of the button clear the listview items collection.
5) Run the app, select a row. Click the button to clear the list.
Desired Result:
The listview should have a consistent column highlight style between the default Rad theme and Fluent Theme, and/or MS WinForms.
Actual Result:
See attachment. The associated column of the selected cell is highlighted but only in the Fluent Theme, and it remains highlighted even in an empty listview. My user's are confused and complaining.
Not sure why Fluent is highlighting columns when the default theme doesn't.
Work Around:
Loop through all of the listview headers and reset the colors.
foreach(var item in this.radListView1.RootElement.ChildrenHierarchy) { if (item is DetailListViewHeaderCellElement) { var Header = item as DetailListViewHeaderCellElement; Header.BackColor = SystemColors.Control; Header.ForeColor = SystemColors.ControlText; } }
How to reproduce: check the attached video Workaround: create a custom drag-drop service public partial class RadForm1 : Telerik.WinControls.UI.RadForm { public RadForm1() { InitializeComponent(); this.radListView1.AllowDragDrop = true; this.radListView2.AllowDragDrop = true; this.radListView1.ListViewElement.DragDropService = new CustomListViewDragDropService(this.radListView1.ListViewElement); this.radListView2.ListViewElement.DragDropService = new CustomListViewDragDropService(this.radListView2.ListViewElement); } } public class CustomListViewDragDropService : ListViewDragDropService { public CustomListViewDragDropService(RadListViewElement owner) : base(owner) { } protected override void HandleMouseMove(Point mousePos) { int? scroll = null; SimpleListViewVisualItem item = this.DropTarget as SimpleListViewVisualItem; if (item != null && item.Data.Owner != this.Owner) { scroll = this.Owner.ViewElement.VScrollBar.Value; Point clientPos = item.Data.Owner.ViewElement.PointFromScreen(mousePos); if ((clientPos.Y < 0 && item.Data.Owner.ViewElement.Orientation == Orientation.Vertical) || (clientPos.X < 0 && item.Data.Owner.ViewElement.Orientation == Orientation.Horizontal)) { item.Data.Owner.ViewElement.Scroller.Scrollbar.PerformSmallDecrement(1); } else if ((clientPos.Y > item.Data.Owner.Size.Height && item.Data.Owner.ViewElement.Orientation == Orientation.Vertical) || (clientPos.X > item.Data.Owner.Size.Width && item.Data.Owner.ViewElement.Orientation == Orientation.Horizontal)) { item.Data.Owner.ViewElement.Scroller.Scrollbar.PerformSmallIncrement(1); } } base.HandleMouseMove(mousePos); if (scroll.HasValue) { this.Owner.ViewElement.VScrollBar.Value = (int)scroll; } } }
To reproduce: add a RadListView with several items that start with "a". One of the items should start with "aa". Enable the keyboard navigation. If you type "aa" fast so that it is within the specified KeyboardSearchResetInterval, the user should be navigated to the item that starts with "a". Dim dt As New DataTable dt.Columns.Add("Column1") dt.Columns.Add("Column2") dt.Columns.Add("Column3") Dim dr1 As DataRow = dt.NewRow Dim dr2 As DataRow = dt.NewRow Dim dr3 As DataRow = dt.NewRow Dim dr4 As DataRow = dt.NewRow Dim dr5 As DataRow = dt.NewRow dr1.ItemArray = {"aaron", "Waters", "Florida"} dt.Rows.Add(dr1) dr2.ItemArray = {"Andrew", "Smith", "Ohio"} dt.Rows.Add(dr2) dr3.ItemArray = {"Art", "Graves", "Michigan"} dt.Rows.Add(dr3) dr4.ItemArray = {"Bridgette", "Patterson", "Colorado"} dt.Rows.Add(dr4) dr5.ItemArray = {"Amanda", "Patterson", "Colorado"} dt.Rows.Add(dr5) LV_Contacts.DataSource = dt LV_Contacts.DisplayMember = "Column1" Me.LV_Contacts.KeyboardSearchEnabled = True Me.LV_Contacts.KeyboardSearchResetInterval = 2000 Workaround: Public Class MyListView Inherits RadListView Protected Overrides Function CreateListViewElement() As RadListViewElement Return New MyRadListViewElement() End Function Public Overrides Property ThemeClassName As String Get Return GetType(RadListView).FullName End Get Set(value As String) MyBase.ThemeClassName = value End Set End Property End Class Public Class MyRadListViewElement Inherits RadListViewElement Protected Overrides Function CreateViewElement() As BaseListViewElement If Me.ViewType = ListViewType.DetailsView Then Return New CustomDetailListViewElement(Me) End If Return MyBase.CreateViewElement() End Function Protected Overrides ReadOnly Property ThemeEffectiveType() As Type Get Return GetType(RadListViewElement) End Get End Property End Class Public Class CustomDetailListViewElement Inherits DetailListViewElement Public Sub New(owner As RadListViewElement) MyBase.New(owner) End Sub Protected Overrides ReadOnly Property ThemeEffectiveType() As Type Get Return GetType(DetailListViewElement) End Get End Property Dim searchBuffer As StringBuilder Protected Overrides Sub HandleNavigation(keyChar As Char) If Not Me.Owner.KeyboardSearchEnabled Then Return End If Dim fi As FieldInfo = GetType(BaseListViewElement).GetField("typingTimer", BindingFlags.Instance Or BindingFlags.NonPublic) Dim typingTimer As Timer = TryCast(fi.GetValue(Me), Timer) If typingTimer.Enabled Then typingTimer.[Stop]() typingTimer.Start() Else searchBuffer = New StringBuilder() typingTimer.Start() End If searchBuffer.Append(keyChar) Dim searchCriteria As String = searchBuffer.ToString() Dim itemToSelect As ListViewDataItem = GetFirstMatch(searchCriteria) If itemToSelect IsNot Nothing Then Me.ProcessSelection(itemToSelect, Keys.None, False) End If End Sub End Class
To reproduce: please run the attached sample project and follow the steps illustrated in the gif file. Workaround: use customRadCheckedListDataItems and disabled the autocomplete functionality while refilling the items private void button1_Click(object sender, EventArgs e) { radCheckedDropDownList1.Items.Clear(); radCheckedDropDownList1.AutoCompleteMode = AutoCompleteMode.None; foreach (string item in list) { radCheckedDropDownList1.Items.Add(new CustomRadCheckedListDataItem(item, false)); } radCheckedDropDownList1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; } public class CustomRadCheckedListDataItem : RadCheckedListDataItem { public CustomRadCheckedListDataItem(string item, bool isCheched) : base(item,isCheched) { } public override bool Checked { get { if (this.ownerElement == null) { return false; } return base.Checked; } set { base.Checked = value; } } }
This is necessary in order to create custom items in the autocomplete drop down and add checkboxes in this popup as well.
To reproduce: run the attached sample project and follow the steps in the gif file. Workaround: don't use Begin/EndUpdate when best-fitting the column.
To reproduce: use the following code snippet and follow the steps from the attached gif file: private List<sampleClass> MyList = new List<sampleClass>(); public RadForm1() { InitializeComponent(); MyList.Add(new sampleClass("Test 1")); MyList.Add(new sampleClass("Test 2")); MyList.Add(new sampleClass("Test 3")); MyList.Add(new sampleClass("Test 4")); MyList.Add(new sampleClass("Test 5")); radListView1.DataSource = MyList; } private void radButton1_Click(object sender, EventArgs e) { this.radListView1.BeginEdit(); } private void radButton2_Click(object sender, EventArgs e) { this.radListView1.EndEdit(); } private void radListView1_ItemValueChanged(object sender, Telerik.WinControls.UI.ListViewItemValueChangedEventArgs e) { radListView1.BeginUpdate(); radListView1.CurrentColumn.BestFit(); radListView1.EndUpdate(); } } public class sampleClass { public string test { get; set; } public sampleClass() { } public sampleClass(string Val) { test = Val; } } Workaround: use the ItemEdited event instead of the ItemValueChanged event.
Use attached to reproduce.
To reproduce: run the attached project and click the button. Workaround: set the RadCheckedDropDownList.AutoSize property to false before manipulating the Dock property.
By default, RadCheckedDropDownList.AutoSize property is true. If you put the control inside a TableLayoutPanel and check several items, the internal autocomplete box is sized properly , but the height of RadCheckedDropDownList is not adjusted. Workaround: set explicitly the RadCheckedDropDownList.AutoSize property to true;
To reproduce: run the attached sample project. Note that if the exceptions are enabled a ParserException will be shown. Pressing 'Continue' will show the list view will all data as if no filter is applied.
To reproduce: public RadForm1() { InitializeComponent(); for (int i = 0; i < 10; i++) { this.radCheckedDropDownList1.Items.Add("Item" + i, i % 2 == 0); } this.radCheckedDropDownList1.ShowCheckAllItems = true; } Workaround: public RadForm1() { InitializeComponent(); this.radCheckedDropDownList1.ShowCheckAllItems = true; for (int i = 0; i < 10; i++) { this.radCheckedDropDownList1.Items.Add("Item" + i, i % 2 == 1); } CheckedItemTraverser traverser = this.radCheckedDropDownList1.ListElement.Scroller.Traverser as CheckedItemTraverser; this.radCheckedDropDownList1.ItemCheckedChanging += radCheckedDropDownList1_ItemCheckedChanging; traverser.CheckAllItem.Checked = false; this.radCheckedDropDownList1.ItemCheckedChanging -= radCheckedDropDownList1_ItemCheckedChanging; } private void radCheckedDropDownList1_ItemCheckedChanging(object sender, RadCheckedListDataItemCancelEventArgs e) { if (e.Item.Text != "Check All") { e.Cancel = true; } }
If you try to change the MinimumSize at design time, the first entered value is serialized and it can't be changed further. Workaround: manipulate the size programmatically at run time.
To reproduce: populate RadListView with data and enable editing. Allow multiline text for the editor private void radListView1_EditorInitialized(object sender, Telerik.WinControls.UI.ListViewItemEditorInitializedEventArgs e) { ListViewTextBoxEditor editor = e.Editor as ListViewTextBoxEditor; if (editor!=null) { editor.Multiline = true; editor.AcceptsReturn = true; } } Workaround: private void radListView1_EditorRequired(object sender, ListViewItemEditorRequiredEventArgs e) { e.Editor = new CustomListViewTextBoxEditor(); } public class CustomListViewTextBoxEditor : ListViewTextBoxEditor { protected override void OnKeyDown(KeyEventArgs e) { if (e.KeyCode== Keys.Enter && e.Modifiers== Keys.Shift) { return; } base.OnKeyDown(e); } }
To reproduce: use the following code to populate RadCheckedListBox: for (int i = 0; i < 10; i++) { this.radCheckedListBox1.Items.Add("Item" + i); } this.radCheckedListBox1.Items[3].Enabled = false; Handle the SelectedIndexChanged event: private void radCheckedListBox1_SelectedIndexChanged(object sender, EventArgs e) { Console.WriteLine(this.radCheckedListBox1.SelectedIndex); } If you run the application and navigate through the items by using the arrow keys you will notice that the SelectedIndexChanged event will be fired for the disabled item. Although it is not visually selected, the SelectedIndex of the control confirms that it is selected. Then, if you press the Space key you will notice that it is toggled. Workaround: in order to prevent selecting a disabled item you can cancel the SelectedItemChanging event: private void radCheckedListBox1_SelectedItemChanging(object sender, Telerik.WinControls.UI.ListViewItemCancelEventArgs e) { if (e.Item.Enabled==false) { e.Cancel = true; } }