Telerik Forums
UI for WPF Forum
2 answers
240 views
Hello folks!


How can I add DockingPanesFactory to the RadDocking dynamically?

 <telerik:RadDocking 
                            x:Name="Docking"
                            >
            <telerik:RadDocking.DockingPanesFactory>
                <local:CustomDockingPanesFactory />
            </telerik:RadDocking.DockingPanesFactory>
   </telerik:RadDocking>

 var Dock = new Telerik.Windows.Controls.RadDocking();
.....
Any advise or suggestion will be greatly appreciated.

hokushin
Top achievements
Rank 1
 answered on 06 Dec 2016
1 answer
272 views
Hi, I try use RadChartView to display finance data with Candle-style series. After setup data, I set horizontal zoom, but vertical zoom remains unchanged (see screenshot). How to make radchartview auto-Y-scale  for visible part of chart?
Martin Ivanov
Telerik team
 answered on 06 Dec 2016
1 answer
625 views

Hello,

I am looking a generic solution to import excel to radgridview.

I want to do this at my control(not viewmodel or codebehind,I custimized radgridview)

Is there a way to do that

Lance | Senior Manager Technical Support
Telerik team
 answered on 05 Dec 2016
1 answer
175 views

Hello!

      I'm using the "RadRichTextBox" in my project. I'm facing a problem when the control is disabled (i.e. IsEnabled = False). In disabled state the controls turns Grey and the text visibility is very low. I cannot use read-only or any other property as they are being used for other purpose. I need to change the template for Disabled control, so as to not make it Grey but make the Disable mask transparent instead. Need help for the same.

Thanks

Tushar

     

Lance | Senior Manager Technical Support
Telerik team
 answered on 05 Dec 2016
3 answers
661 views

I am replacing a TreeView control with a RadTreeView control however I have run in to a issue. I want the user to be able to click on the body of the TreeView (instead of a node) and have it deselect the item in the tree view.

 

With the original TreeView I would do

<TreeView Grid.Row="0" MouseDown="TreeView_OnMouseDown">
    <TreeViewItem Header="Item 1"/>
    <TreeViewItem Header="Item 2"/>
</TreeView>

Then in the code behind I would have

private void TreeView_OnMouseDown(object sender, MouseButtonEventArgs e)
{
    var treeView = (TreeView)sender;
    var items = treeView.Items.Cast<TreeViewItem>();
    foreach (var treeViewItem in items)
    {
        treeViewItem.IsSelected = false;
    }
     
}

 

And this would work correctly. However if I do

<telerik:RadTreeView Grid.Row="1" MouseDown="RadTreeView_OnMouseDown">
    <telerik:RadTreeViewItem Header="Item 3"/>
    <telerik:RadTreeViewItem Header="Item 4"/>
</telerik:RadTreeView>

and

private void RadTreeView_OnMouseDown(object sender, MouseButtonEventArgs e)
{
    var treeView = (RadTreeView)sender;
    treeView.SelectedItem = null;
    MessageBox.Show("RadTreeView_OnMouseDown fired!");
}

the OnMouseDown event never fires.

Looking at the OnMouseDown event with Snoop it appears to be getting marked as handled by the ScrollViewer inside the RadListView.

What is the correct way to deselect the node when clicking on the body of the tree view? Attached is a simple example program that shows the two controls side by side with their different behaviors.

Scott
Top achievements
Rank 1
 answered on 05 Dec 2016
3 answers
260 views

Hi,

At the moment I'm facing an issue, I have a RadGridView which can show different tables with different definitions(not at the same time)
So AutoGenerateColumns is set to True.

now it can happen that some columns have an FK to another table.
Before I replaced those columns in the DataLoaded event but because of performance reasons I would like to do those replaces in the CurrentCellChanged event.

The problem when I do this is that the new GridViewComboBoxColumn misses the link to the actual datasource, and while reading the value for saving in the database, the value is DBNULL.

the gridview in de Xaml looks like this

<DataTemplate x:Key="AdminViewMainSectorTemplate">
        <Grid Margin="10">
            <Grid>
                <telerik:RadBusyIndicator x:Name="BusyIndicator" Grid.Row="2" >
                    <telerik:RadGridView x:Name="gridViewAdminData"
                                                     ItemsSource="{Binding DataRecords, Mode=TwoWay}"
                                         RowEditEnded="EditRecord"
                                         Deleted="deleteRecord"
                                         AddingNewDataItem="AddingNewDataItem"
                                         MinColumnWidth="100"
                                         ColumnWidth="*"
                                         NewRowPosition="Top"                                         
                                         AutoGeneratingColumn="AutoGeneratingColumn"
                                         DataLoading="LoadData"
                                         DataLoaded="DataLoaded"
                                         CurrentCellChanged="CurrentCellChanged"
                                         SelectionUnit="Cell"
                                         >
                        <!--DataLoading="LoadData"
                                         DataLoaded="DataLoaded"-->
                        <telerik:EventToCommandBehavior.EventBindings>
                            <telerik:EventBinding
                            Command="{Binding HandleAddingNewRecordToDevicesGridCommand}"
                            EventName="AddingNewDataItem"
                            PassEventArgsToCommand="True"/>
                        </telerik:EventToCommandBehavior.EventBindings>
                    </telerik:RadGridView>
                </telerik:RadBusyIndicator>
            </Grid>
        </Grid>
    </DataTemplate>

and my code behind looks like this:

private void CurrentCellChanged(object sender, GridViewCurrentCellChangedEventArgs e)
       {
           RadGridView rgv = (RadGridView)sender;
           GridViewCell cell = rgv.CurrentCell;
           if (cell != null && typeof(GridViewDataColumn) == cell.Column.GetType())
           {
               Models.MyEntities db = new Models.MyEntities();
               string tableName = Helpers.GlobalParameters.currenTableName;
               if (tableName =="batches")
               {
                   string fieldname = cell.Column.UniqueName;
                   if (fieldname == "ProductieOrderId")
                   {
                       int index = cell.Column.DisplayIndex;
                       GridViewComboBoxColumn cbb = new GridViewComboBoxColumn();
                       cbb.DataMemberBinding = new System.Windows.Data.Binding(fieldname);
                       //cbb.DataMemberBinding = cell.DataColumn.DataMemberBinding;
                       cbb.ItemsSource = db.productieorder.ToList();
                       cbb.SelectedValueMemberPath = fieldname;
                       cbb.DisplayMemberPath = "Id";
                       //cbb.Name = fieldname;
                       cbb.UniqueName = fieldname;
                       cbb.DisplayIndex = index;
                       rgv.Columns.Remove(cell.Column);
                       //rgv.Columns.Remove(cell.DataColumn);
                       rgv.Columns.Add(cbb);
 
                   }
               } else if (tableName =="artikel")

where the Field "Id" is the related field on the related table
If I do this
cbb.SelectedValueMemberPath = "Id";

what I would say is logical, the shown value in the combobox stays empty.

does anyone know where to look to fix this issue?

Martin
Telerik team
 answered on 05 Dec 2016
1 answer
220 views

Hi,

I am using a DataTemplateSelector and DataTemplates to show and interact with Custom Appointments in the schedule.

The Custom Appointment has a field called BindingItem added which holds a reference to my data.I then have checkboxes and drop down boxes that bind to fields within the BindingItem.

Everything works great until I refresh the entire appointments collection.

It seems like DataTemplates are being reused (by the container?) and any interaction seems to be with the old BindingItem not the new one, even though the appointment collection is brand new and each appointment has a new BindingItem set.

I can get this resolved in 2 ways, the first is to scroll the offending appointments off the screen and back again which must be forcing some kind of container refresh. Not very useful for end users.

The second is to use the following code to force a container refresh, note that AddIdleAction adds the code onto the dispatcher at application idle priority:

        private void RefreshAppointmentBindingItem(CustomAppointment appt)
        {
            if (appt != null)
            {
                object item = appt.BindingItem;

                AddIdleAction(() =>
                {
                    appt.BindingItem = null;
                });

                AddIdleAction(() =>
                {
                    appt.BindingItem = item;
                });
            }
        }

Both ways are messy, do you have any better suggestions?

Thanks

Anthony

Stefan
Telerik team
 answered on 05 Dec 2016
6 answers
166 views
I have an RTF document that is made up of many smaller RTF documents merged together.  The document that I am using for testing contains over 1100 pages. Printing this document setting the Document property of a RadRichTextBox and calling the print method is very slow.  I can open the same document in Word and it prints about 10 times faster.  Are there any recommendations for improving printing performance?  Thanks.
tushar
Top achievements
Rank 1
 answered on 05 Dec 2016
1 answer
95 views

Basically, when the use hits the OK button in the raddataform for a particular row I want to collapse the details.

An Mvvm friendly solution would be great!

Thanks ... Ed

 

Dilyan Traykov
Telerik team
 answered on 05 Dec 2016
1 answer
278 views

Also with RadListBox, of course. This is using the VisualStudio 2013 theme.

Simple repro:

Create a ListBox with IsEnabled=false.

Add a CheckBox item, with a Content="Testing" or whatever.

Notice that it is very dark, nearly unreadable. It's because in your theme XAML, you have set the RadListBoxItem disabled state contentPresenter to an Opacity of 0.2. Now, inside of a CheckBox, you also have similar code for the disabled state where the content's Opacity is set to 0.2.

Guess what? The 2 values multiply, which means now the CheckBox has an effective Opacity value of 0.2*0.2 = 0.04. :( That's dark.

I can see why this was done, because if your ListBox has strings only, then it works, because a TextBlock doesn't have a disabled state. Yeah, but what if your ItemTemplate has controls that they themselves have a darkened disabled state??? That doubles up the disabled-ness.

I like how Microsoft handles it by changing the Foreground to grey in their themes instead of screwing with Opacity (since Foreground is inherited), and that would work perfectly in both my cases, string-only lists and checkbox lists.

 

Martin
Telerik team
 answered on 05 Dec 2016
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?