Telerik Forums
UI for WPF Forum
3 answers
388 views

I have a web application that is using your Kendo editor.  The HTML output of the Kendo editor is saved in a database and can be opened in another WPF application to be edited in a RadRichTextBox.  The HTML is imported as follows, where "editor" is a RadRichTextBox:

private void ImportHtml(string HTML)
{
    HtmlFormatProvider _provider = new HtmlFormatProvider();
    HtmlImportSettings settings = new HtmlImportSettings();
 
    _provider.ImportSettings = settings;
    settings.UseDefaultStylesheetForFontProperties = true;
   editor.Document = _provider.Import(HTML);
}

 

When tables are created in the Kendo editor and imported to the RadRichTextBox, several issues are seen:

  1. Table, row, and cell heights are not maintained.  All rows and cells become the same height.
  2. Cell padding is not correct.  I can see the padding in the imported HTML as <td style="padding:5px;", but after import the padding is changed to padding: 5px 0px 0px 0px; (Padding="0,5,0,0" in the XAML).
  3. Table borders are not visible.  The borders are still in the HTML and can be seen in the Table Borders properties dialog, but are not visible in the editor and seem to not always work correctly if modified in the Table Borders properties dialog.  If cell spacing is added to the table in Kendo, then the borders will display in WPF.  Therefore, it appears as if the outer cell borders are covering the table borders.

Please let me know if there is anything I am missing here that will provide proper display of the tables in the RadRichTextBox.

Thanks!

Georgi
Telerik team
 answered on 03 Jan 2020
2 answers
851 views

Hi,

I'm working with the RadSyntaxEditor (WPF R3 2019) and loving it. It is a great control with lots of potential for our team.

 

The issue I have is simple and I feel silly having to ask something so trivial, but is there a way access the underlying text of the TextDocument? We need it to write to a stream and save the document after editing. I've tried looking in the TextDocument and TextSnapShot objects, iterating all the lines and spans, and calling all their ToString() methods, but nothing seemed to work. Is there a way to access the raw text from the rope, or even the rope itself?

 

Thank you ahead of time for your help,

Happy New Year.

Tim

Tim
Top achievements
Rank 1
 answered on 03 Jan 2020
4 answers
140 views
I was able to bind a model's text and tooltip to the SelectionBoxTemplate. However, sometimes the tooltip is empty and sometimes it is populated.
However, without a datatrigger in place, even on the empty tooltips, I see an empty tooltip window popup which is a bit of annoyance. Any possible way to fix this?
John
Top achievements
Rank 1
 answered on 02 Jan 2020
8 answers
217 views

Hi,

I am trying to drop shape into a container shape, but the shape is not displaying inside the container. Could anyone help me solve it? Here is my code.

 

EventManager.RegisterClassHandler(typeof(RadDiagramContainerShape), RadDiagramShape.DropEvent, new System.Windows.DragEventHandler(OnDrop));

 

 

private void OnDrop(object sender, System.Windows.DragEventArgs e)
        {
            e.Handled = true;
            if ((e.Data as DataObject)?.GetData(typeof(DragObject)) is DragObject dragObject)
            {
                var itemBase = (ActivityBase)Activator.CreateInstance(dragObject.ContentType);
                var p = e.GetPosition(MainDiagram);
                var shape= createDiagramShape(itemBase);
 
                RadDiagramContainerShape target = (sender as RadDiagramContainerShape);
                target.Items.Add(shape);
            }
        }
 
 
private RadDiagramShape createDiagramShape(ActivityBase activity)
        {
            var shape = new RadDiagramShape
            {
                Content = activity,
                BorderThickness = new Thickness(1),
                UseGlidingConnector = true,
                HorizontalContentAlignment = HorizontalAlignment.Stretch,
                VerticalContentAlignment = VerticalAlignment.Stretch,
                DataContext = activity,
                UseDefaultConnectors = false,
                IsRotationEnabled = false,
                 
                Background = new SolidColorBrush(Color.FromArgb(255, 255, 255, 255)),
                GlidingStyle = GlidingStyle.Rectangle
            };
 
            var outconnector = new InOutConnector
            {
                Offset = new Point(1, 0.2),
                Direction = eDirection.drOut,
                Name = "out" + DateTime.Now.Millisecond
            };
            shape.Connectors.Add(outconnector);
 
            var inconnector = new InOutConnector
            {
                Offset = new Point(0, 0.2),
                Direction = eDirection.drIn,
                Name = "in" + DateTime.Now.Millisecond,
            };
            shape.Connectors.Add(inconnector);
            return shape;
        }

 

 

The following function to drop shape inside the diagram works.

private void OnDropShape(object sender, DragEventArgs e)
        {
            e.Handled = true;
            if ((e.Data as DataObject)?.GetData(typeof(DragObject)) is DragObject dragObject)
            {
                var itemBase = (ActivityBase) Activator.CreateInstance(dragObject.ContentType);
                var p = e.GetPosition(MainDiagram);
                var shape = createDiagramShape(itemBase);
 
                MainDiagram.AddShape(shape, MainDiagram.GetTransformedPoint(p));
                _mainViewModel.ShapeCollection = MainDiagram.Shapes;
                _mainViewModel.SelectedActivity = calendar.DataContext as ActivityBase;
                 
            }
        }

 

 

Thanks,

Rahul

Martin Ivanov
Telerik team
 answered on 02 Jan 2020
1 answer
102 views

If there is only one wizardpage in the WizardPages collection, the AllowFinish property is ignored completely and the Finish button is enabled even if set to false directly or using a binding.

 

Using the latest version of UI for WPF.


Martin Ivanov
Telerik team
 answered on 01 Jan 2020
3 answers
361 views

I tried looking at the WPF GridView example for server side paging/sorting/filtering and it failed with an error. However I looked at the code and you are simply using entity framework to do all the work.

Are there any examples where I can use a different ORM like Ormlite? We don't use entity framework and frankly don't want to.

The only other solution for us would be to switch to using something like Kendo because then it is much easier in the web.

Aseman
Top achievements
Rank 1
Veteran
 answered on 01 Jan 2020
13 answers
3.8K+ views

Have a User Control that is called when a button "about" is pressed.

The UC works. Want to add a "Close" button that will close the window so it won't get orphaned later.

I could use the "IsVisible = Visibility.Collapsed;" which works but it is not really gone. The UC has to RadListboxes which collects different data in each box. When I use the "IsVisible = Visibility.Collapsed;" the box disappears. When click on the "About" button it reappears with previous data. I prefer to make it truly close/destroyed.

Is this possible and if so how? please.

What code do you need the XAML or the .CS?

herb
Top achievements
Rank 1
Veteran
Iron
 answered on 30 Dec 2019
9 answers
1.2K+ views
Hello Telerik Team,

I wanted to reduce the height of the header row but cannot figure out how. Setting the RowHeight property works only for the rows and not for the header row.

Is there a way to reduce the height of the header row?

Thanks,
Kumar
Martin Ivanov
Telerik team
 answered on 30 Dec 2019
4 answers
1.1K+ views

hello

I am trying to implement a Grid View with row number column and pagination.That is, the row number can also be changed when the page is changed

but the code I wrote is that the row number column on each page is only 1 to 10. And by going to the next page the row number starts again from 1 and does not increase to 11 and more.

this is my cs code for row number:

public override FrameworkElement CreateCellElement(Telerik.Windows.Controls.GridView.GridViewCell cell, object dataItem)

        {
            TextBlock textBlock = cell.Content as TextBlock;

            if (textBlock == null)
            {
                textBlock = new TextBlock();
            }
            textBlock.Text = string.Format("{0}", this.DataControl.Items.IndexOf(dataItem) + 1);
            return textBlock;
        }

and xaml code:

<telerik:RadDataPager DisplayMode="all" PageSize="10" Source="{Binding Items, ElementName=RadGridView}"  />

also i need a label that represents the total number of Grid View rows. The value of this label must be updated by applying a filter or searching.

but my code always represents total number of Grid View rows and does not change with filtering.

 

Thanks!

Sara.

Sara
Top achievements
Rank 1
 answered on 28 Dec 2019
1 answer
292 views

Have a RadListbox, in xaml have set (SelectionMode="Multiple").

Want the user able to copy a selected item(s) and paste it anywhere (text file, excel, etc.) having issue finding topics in forum that helps me complete the operation of "copy".

Is there a method to do this?

Martin Ivanov
Telerik team
 answered on 26 Dec 2019
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?