
I have a listbox defined in the xaml -
<telerik:RadListBox x:Name="CartLineItems" ItemsSource="{Binding LineItems}" SelectedItem="{Binding SelectedArticle, Mode=TwoWay}"ItemTemplate="{StaticResource ConfectioneryDataTemplate}" VerticalAlignment="Stretch"HorizontalAlignment="Stretch" Background="LightGray"></telerik:RadListBox>
I frequently need to clear and repopulate the ItemsSource to refresh the Listbox. (LineItems is an observable collection). When I clear the collection, the SelectedItem is also cleared (visually). When I repopulate and set the SelectedItem object with data, there is no item in the ListBox which is selected. Below is the code -
private void RefreshLineItems(){ // Store the selected article for later use. LineItem selectedLineItem = null; if (SelectedArticle != null) selectedLineItem = SelectedArticle; // Clear all the line items. LineItems.Clear(); // Iterate through the cart to re-populate LineItems and reset the selected article. if (ActiveCart != null) { foreach (LineItem lineItem in ActiveCart.lineItems) { LineItems.Add(lineItem); } if (selectedLineItem != null) SelectedArticle = ActiveCart.lineItems.Find(x => x.articleID == selectedLineItem.articleID); }}
How do I get the selected item to re-appear on the listbox after the ItemsSource is cleared?
Thanks.
Gopinath

Dear sir,
I am using the Rad Masked Currency Input control in my project. One of the requirement is to show empty content when the value is null.
Unfortunately, when I set the empty Content property to string. Empty or to null , I still see the default value in the control ( zero number).
I can see an error in the output window of problem to convert null object to value.
I have noticed that after pressing the clear button and opening again the control the content become empty.
Do you have a solution to this scenario?
Thank you,
Yafit hamilton
Hey everyone,
I'm currently working through some existing project, and would like to set up a RadComboBox that will complain if it doesn't have a current selection, or the current selection is an empty string. The current ComboBox is the stock WPF control, and populates itself like this:
const string sql = @" SELECT Item AS ListItem FROM...";DataTable table = GetTable(...)cbx.ItemsSource = table.DefaultView;cbx.DisplayMemberPath = "Item";cbx.SelectedValuePath = "Item";
I'm new to MVVM and WPF, and this doesn't seem standard. So, what I want to know is if there's a nice way to have the RadComboBox control complain about an invalid SelectedItem? Do I need to rip this apart and do data binding? If so, is there an example I can look at to get an idea?
As always, thanks for the help,
Lee

Hi guys,
I am currently working on a way to display data, that is structured on 3 levels.
On first level is a week, on second level a day, and on the third level a basic entry.
Based on that system I thought about the RadGridView and the Child-Relations.
My main problems now are, that I have especially on the third level way too less space in the child-table so its basically unreadable.
Is there any way to give the childtables more space?
The other problem is, that I haven't found out, how I could set different Templates for the childtables.
The HierarchyChildTemplate only works for one Child as it seems.
The reason why I not just Group by the Days and weeks is, that I later want to use Drag and Drop entries between the days.
I thought this would be more possible in a hierarchical system.
I also tested the RadPanelBar, but there I would need to create somethin like a table with frozen headers and so on manually.
Greetings,
Benedikt
Hello,
I am using a Docking-Layout in my Application with some RadPane's in it. Each RadPane is bound to a different ViewModel. When the RadPane is visible, everything works as expected.
But I struggle with some Binding Errors when the RadPane is hidden on start up of my application. Is there a way to reset/update the DataContext of the RadPane when the PaneStatus changed to visible?
I can provide a code example if you want.
Cheers!
Tobias
I'm trying to spread out the items in my carousel so there is a bit of space between them (and ideally no change in z depth as they animate).
It seems like the items can only spread out to the edges of the screen. In my case I need 3 landscape images visible at once.
Instead of overlapping 3 images on screen like |[--][--][--]| where the center image is raised/focused, I'd like [-|-][--][-|-] where the side images are the same size and partially off screen.
I've tried the following, as well as using bezier curves with control points, etc.
<Path x:Key="horizontalPath" Stretch="Fill">
<Path.Data>
<LineGeometry StartPoint="-1000,0" EndPoint="1000,0" />
</Path.Data>
</Path>


Hi, on RadGridView ShowSearchPanel,
1. How to change the text 'Full Text Search' ?
2. and How to delete of disable 'x',close boutton, in ShowSearchPanel?
Please give the solution and example Code.
Thanks.