Telerik Forums
UI for WPF Forum
1 answer
295 views
This is my code:
<telerik:RadComboBox Height="30" HorizontalAlignment="Left" Margin="126,63,0,0" Name="RadComboBox1" VerticalAlignment="Top" Width="262">
            <telerik:RadComboBoxItem Content="Item 1" />
            <telerik:RadComboBoxItem Content="Item 2" Visibility="Collapsed"/>
            <telerik:RadComboBoxItem Content="Item 3" />
        </telerik:RadComboBox>
But Item 2 not collapse.

Thanks,
Yana
Telerik team
 answered on 17 Mar 2011
3 answers
217 views

I have a completely dynamic RadTreeView that users can add items to. To add a child item, the user selects an existing item and presses a button to generate a new item under the currently selected item. All of that works fine, but the parent item doesn't expand to show the newly added item. I'm trying to get this to happen so that the user doesn't have to manually expand the parent after adding a child.  

This project is using MVVM and the tree items are all databound to an ObservableCollection of a custom class located in my View-Model. The currently selected item is also databound to a property in my View-Model that is of the same custom class as the ObservableCollection. 

Since I'm adding the new items to my tree through the databound property in the View-Model, I can't simply tell the parent to expand from there because it has no access to the UI elements. Immediately after I create the new item I set it in the View-Model as the currently selected item. I figure this will trigger the SelectionChanged event on the RadTreeView (which it does)  so my idea is to try and expand the parent of the currently selected item from there. 

The problem there is that I can't get anything working properly in the SelectionChanged event.

The "SelectionChangedEventArgs" Source property only gives me an object of the custom class type. Obviously that doesn't allow me to change the IsExpanded property. Whenever I try to cast the Source property as a RadTreeViewItem it always returns null. Similarly I have also tried iterating through the RadTreeView itself, but that does the same thing. I can easily get the object of the custom class from the View-Model, but nothing I try gives me the RadTreeViewItem for me to expand. 

I've messed around with the GetItemByPath and ExpandItemByPath methods, but it is completely possible for items in my tree to have the exact same name. In that case, how would those methods know which path is the right path? I don't think those will work for me.

I have also tried the code here, specifically this:

private void radTreeView_SelectionChanged( object sender, Telerik.Windows.Controls.SelectionChangedEventArgs e )
{
   // Get a reference to the treeview
   Telerik.Windows.Controls.RadTreeView treeView = sender as Telerik.Windows.Controls.RadTreeView;
   // Get the currently selected items
   ObservableCollection<Object> selectedItems = treeView.SelectedItems;
   RadTreeViewItem item = selectedItems[ 0 ] as RadTreeViewItem;
}

However, as I mentioned before, "item" is always coming out null. If I instead cast it to my custom class, item holds the correct data and I can get the parent item, but is not a RadTreeViewItem for me to expand.

Thanks in advance for any help...

Petar Mladenov
Telerik team
 answered on 17 Mar 2011
1 answer
111 views
Hi,

We're just implementing Telerik controls in our WPF (PRISM) application and having some problems with the DataFilter control.
We have a radgrid and can bind the control to the grid and filter without any problems. However, the requirement is display 3 filterable fields when the screen loads and for only 3 fields out of a possible 8 of the grid view.

So we're trying to go down the FilterDescriptions route and define our 3 filters programatically

                var companyFilter = new FilterDescriptor("Receiver Company", FilterOperator.Contains, "", true);
            radDataFilter.FilterDescriptors.Add(companyFilter);
 
            var addressFilter = new FilterDescriptor("Address Line 1", FilterOperator.Contains, "", true);
            radDataFilter.FilterDescriptors.Add(addressFilter);
 
            //// DateTime filter.
            var dateFilter = new FilterDescriptor("Created Date", FilterOperator.IsGreaterThan,
                                                 new DateTime(2007, 5, 1));
            radDataFilter.FilterDescriptors.Add(dateFilter);

However when we do this it throws an error saying the source isn't IEnumerable. The source in this instance is defined in the XAML as the radgrid, which has loaded an IList<Receiver> object, which last time I checked was IEnumerable.

Even if I set the Datasource programatically to a List<Receiver> still get the same error.

I'm not sure where to turn and thinking maybe Data annotations are an option.

Any views?

Thanks.


Rossen Hristov
Telerik team
 answered on 17 Mar 2011
3 answers
373 views
Hello Telerik Team,
                             I have one clarification in my latest WPF project.Here I am  having one radcombo box.Its contains 3 values.
<telerik:RadComboBox HorizontalAlignment="Left" SelectedIndex="{Binding xx}"  Margin="114,207,0,0" Name="radComboBox2" VerticalAlignment="Top" Width="205">
            <telerik:RadComboBoxItem Content="Item 1" />
            <telerik:RadComboBoxItem Content="Item 2" />
            <telerik:RadComboBoxItem Content="Item 3" />
        </telerik:RadComboBox>
When window loading time i want to display item3 in radcombobox.After window loading client can change the value and storing into database.
So i am binding into selectedindex in XAML.
codebehind sample
public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.radComboBox2.SelectedIndex = 2;
        }
    }
 But it display empty Combobox?
why?
pls give me any suggestions
Konstantina
Telerik team
 answered on 17 Mar 2011
2 answers
84 views
When entering a date in the RadDatePicker, where the century is not specified (e.g. 6/20/76), is there a way to instruct the parser to deliver 1976 instead of 2076, short of reimplementing it?
Even if SelectableDateEnd and DisplayDateEnd are set to DateTime.Now, the parser still selects the future date.

Alternatively, is there a way to call your builtin parser (which works like a charm except for this small issue) from a custom Parse... event handler in order to tweak its result a bit?

Thanks
Phil
Philip
Top achievements
Rank 1
 answered on 17 Mar 2011
19 answers
204 views
Hi!

I'm currently using the GridView component. But I see that the text above(Drag a column header and drop it here to group by that column) doesn't seems to change depending of the current localisation.

I've to do a fully multilanguage interface, how can I change this text?

Thank you :)
Maya
Telerik team
 answered on 17 Mar 2011
2 answers
307 views
Hello,

I have a RadGridView control with flow direction set from right to left.
Inside the grid I have a MaskedTextBoxColumn that is used to display and edit a DateTime object.

I want to have only this column with flow direction from left to right so the date is displayed to the left of the time.
I don't see FlowDirection Property on this column or on any other column.
If I'm setting the FrameworkElement.FlowDirection property it is being ignored.

Is it possible?

Thanks,
Evgeny
Evgeny
Top achievements
Rank 1
 answered on 17 Mar 2011
7 answers
195 views
We have installed the new version of the GridView and some bug/issues occurs.

1. If setting the items source before columns created (throw code), the list wont display the cell content (rows are empty)...
    (We fix this issus will setting the itemssource after...)

2. the sort is not woking... (wont change the result) (this is not fixed for us..)

Version working : 2010.3.1110.35
Not working : 2010.3.1314.40

We have put back the old version and its working..

Any clues...

Yavor Georgiev
Telerik team
 answered on 17 Mar 2011
3 answers
118 views
I trying to bind a "weakly-typed" data list into RadGridView, I considered IList<>, ObservableCollection<> but I think they not suit my scenario because I need to define type of element in those collections.

I found RadDataPager later but I do not need paging feature.

I wonder whether WPF RadGridView can bind to something like "DataTable" like in WinForm, but I asking it for WPF in case there is any ready component in Telerik WPF.

Anyway this is my scenario, single RadGridView is use and ready to receive data collection which may consist of different data type.

Please advise, thanks
tzuhsun
Top achievements
Rank 1
 answered on 17 Mar 2011
11 answers
683 views
Hello all,

I am new to WPF and RadControls and I am trying to use the RadGridView right now (reauirements of a new customer).

I bound my RadGridView to a simple collection of object. Displaying properties of objects works like a charm.
Anyway, I wasn't able to find how to create a calculated column based on on or several properties of the objetcs in the bound collection!

I searched the forum, the documentation and found nothing (even for the classic MS DataGrid)!

Is there any known working solution to create calculated data columns?
(be aware that it will not be possible for me to add the calclated field directly in the objects of the collection)

Thank you,
Best regards,

Daniel
Yavor Georgiev
Telerik team
 answered on 16 Mar 2011
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?