Currently one cannot set the field name at design time as well.
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;
Hello,
I'm populating a CardView from a BindingList:
CardView1.DataSource = BindingList<Model1>;
Aftre loading the information inside the cards is not displayed until i click on a card (see attachment), after clicking on a card all the cards display the information correctly
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; } }
Populate a RadListView with data, apply ListViewType.DetailsView and disable the ShowGridLines property.
With the ControlDefault theme it works, but if you apply the CrystalDark theme, the grid lines are still visible
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: run the attached sample project. Select an item and press F2, select a new item from the drop-down. You will encounter an error because the ActiveEditor is now null in the ItemValueChanging event. Workaround: in the EditorInitialized event you can subscribe to the RadDropDownListElement.SelectedIndexChanging event: private void radListView1_EditorInitialized(object sender, ListViewItemEditorInitializedEventArgs e) { ListViewDropDownListEditor editor = e.Editor as ListViewDropDownListEditor; if (editor==null) { return; } RadDropDownListElement dropdown = (RadDropDownListElement)editor.EditorElement; dropdown.SelectedIndexChanging-=dropdown_SelectedIndexChanging; dropdown.SelectedIndexChanging+=dropdown_SelectedIndexChanging; }
To reproduce: run the sample project, select an item, press F2 and select a new item. You are expecting the BaseDropDownListEditorElement.SelectedIndexChanging event is fired in this case and you may be able to cancel the new selection in certain conditions.
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.