Telerik Forums
UI for WPF Forum
5 answers
298 views
Hi all,

I have seen very few examples of the diagram control in the WPF Control demo that gets installed.  I think there are only 2 and 1 is just a theming demo.  Given the potential for this tool I think that is a shame; anyway...

I need to build an application that allows users to search for objects from a database.  They can then drag objects from the search results onto a diagram control where all the immediate relationships coming from those are drawn and laid out.  There is, as always, a slight twist in the fact these objects are effectively entities and any one entity can have more than one role (just names really) but the important things is an entity can have one or more relationships and a role can have one or more relationships.

I therefore need to diagram an objects relationships to other objects, baring in mind that if the object is an entity it can also have roles which have relationships and vice versa.

I'd appreciate it if someone could take the time to help get me started with a sample application that basically provides the above functionality which I can then grow on.  If anyone has experience developing something similar then I'd also be interested in any advice and lessons learnt...


Thanks,
Drammy
Pavel R. Pavlov
Telerik team
 answered on 04 Sep 2014
8 answers
2.3K+ views
Hi,

I have a requirement to display the row number (index of the binded ObservableCollection) similar to how Excel displays rows.  How can I accomplish this behavior?  I looked into different ways, but I didn't have much success.

Thanks in advance,

Wagner
Saykor
Top achievements
Rank 2
 answered on 03 Sep 2014
6 answers
329 views
Hi Team,

I am doing auto generate properties to false and providing my own property definitions.
The issue is the text box in my data template are not properly align some are of small size some are big based on the text.
I want it to be properly aligned like " stretch" when I resize the grid they should get resized properly and all will be of equal length.
 Also I want the splitter in the grid should uniformly separate the propert name from its value.

could le you help me achieve this
Yoan
Telerik team
 answered on 03 Sep 2014
3 answers
486 views
Hello, sorry if this is posted in the wrong section of the forum.

Now, my question is simple.
I want to find and replace text(strings) in a document, I've tried using the following code:

private void ReplaceAllMatches(RadDocument document, string toSearch, string toReplaceWith)
{
       DocumentTextSearch search = new DocumentTextSearch(document);
       List<TextRange> rangesTrackingDocumentChanges = new List<TextRange>();
       foreach (var textRange in search.FindAll(toSearch))
       {
                TextRange newRange = new TextRange(new DocumentPosition(textRange.StartPosition, true),
                new documentPosition(textRange.EndPosition, true));
                rangesTrackingDocumentChanges.Add(newRange);
            }
 
            RadDocumentEditor docEdit = new RadDocumentEditor(document);
            foreach (var textRange in rangesTrackingDocumentChanges)
            {
                document.CaretPosition.MoveToPosition(textRange.StartPosition);               
                document.DeleteRange(textRange.StartPosition, textRange.EndPosition);
                 
                StyleDefinition style = new StyleDefinition();
                style.SetPropertyValue(Span.ForeColorProperty, Colors.Red);
                                               
                document.Insert(toReplaceWith, style);
 
                textRange.StartPosition.Dispose();
                textRange.EndPosition.Dispose();
            }
        }

But I get two errors, "document.DeleteRange() is obsolete use RadDocumentEditor.Delete() instead." and "document.Insert() is obsolete use RadDocumentEditor.InsertInline() instead.".
I can't figure out how to use these functions instead so that's why I need help!

I've never used this library before so all help is very appreciated.
Best regards
Isak
Petya
Telerik team
 answered on 03 Sep 2014
7 answers
925 views
Hello,

i tried to get the text in RichTextBox with Binding with a property of my ViewModel with type 'string'.
But
something with binding is always wrong. I couldn't pass a defined
string from ViewModel, and i got always string.empty from RichTextBox.

Here is my code in xaml, i also tried RadWatermarkTextBox, that works fine.
<telerik:XamlDataProvider RichTextBox="{Binding ElementName=richTextBox1}" Xaml="{Binding PropertyName, Mode=TwoWay}" />
<telerik:RadRichTextBox Name="radRichTextBox"/>
 
<telerik:RadWatermarkTextBox Text="{Binding Path=PropertyName, Mode=TwoWay}"/>

I have seen some articals with using selection. But i don't want to use it instead of lovely binding...
Another try i have done is with TextRange
var startPosition = new DocumentPosition(radRichTextBox.Document.CaretPosition);
var endPosition = new DocumentPosition(radRichTextBox.Document.CaretPosition);
startPosition.MoveToFirstPositionInDocument();
endPosition.MoveToLastPositionInDocument();
 
var text = new TextRange(
           // TextPointer to the start of content in the RichTextBox.
           startPosition,
           // TextPointer to the end of content in the RichTextBox.
           endPosition).Text;
But Telerik TextRange has difference of MS TextRange, it has no property Text...

Is there a easy way to implement that? That could not be so hard, right? Or what i did wrong in my code?
Petya
Telerik team
 answered on 03 Sep 2014
3 answers
189 views
Is it possible to get hold of the Office2013Palette.Palette.AccentMainColor in XAML?

I know you can get hold of the brushes, using something such as
      telerik:Office2013Resource ResourceKey=EffectAccentHighBrush

however, I need to assign to a color property in the XAML. For the Windows 8 theme, I would use something along the lines of 
      Color="{Binding Source={StaticResource Windows8Colors}, Path=Palette.MainColor}"

Is there a way to get the similar value for the Office2013 theme? 

Thanks
Jason
Vanya Pavlova
Telerik team
 answered on 03 Sep 2014
3 answers
345 views
Hello,

I want to implement drag n drop functionality from RadGridView to RadTreeView. I dont want to use ViewModel.

in the RadGridView i have some data pulled from Database , i.e a list of songs with their tags as columns.

In the treeview i have made some categories of songs. I want to drag a song / or multiple songs from RadGridView and drop it on a category node of treeview. internally i will get a list of all selected rows of grid which or dragged on the Drop Event of treeview and update it to my collection and later in DB. I looked in your demos but all are using MVVM. I want a pure C# code , which would implement my task ASAP.
Yana
Telerik team
 answered on 03 Sep 2014
3 answers
214 views
Hi,

I've app with default theme and I would like to know if it is possible to use Windows8Theme scrollview for my gridview. And I also  need to perform some customization for example I need to change thumb color, remove up/down repeatbuttons.  Thanks in advance for any help.
Vanya Pavlova
Telerik team
 answered on 03 Sep 2014
1 answer
197 views
I have a GridView which contains a name column - and the name may be null or " " or "" or a real name.

Ex:
Name1: null
Name2: " "
Name3: ""
Name4: "Obama"
Name5: "obama"
Name6: " obama" (should be grouped with Obama and not with "")

In the group header I would like to group by the names first letter - or "" if there String.IsNullOrWhiteSpace is true. And I would like the group header to ignore the case of the first letter.
There are other columns in the GridView which I do not want grouped like this.

I have done this:
 GroupMemberPath="Entity.Name[0]"

But that leaves an ugly square in the header if the name is null - (and " " and "" are grouped in two different groups. So is "Obama" and "obama" and " obama").

I have a quite a few of these name-columns around in my program, so I would like an elegant, reusable solution :ø) What I really need is a way to add a Converter to the group binding.

Normally I would use a converter, but there does not seem to be a way to add a converter to the groupmemberpath (?)
There is a GroupHeaderFormatString; but I have failed to find a way to get {}{0:<something>} to return the first letter.
The type of Name is String. I really do not want to change this so adding a FirstLetter-property is not a solution either.
Seems like adding a GroupHeaderTempate will only affect the text in the group header. It will not allow me to group "Obama" and "obama" in the same group.

Is there a solution to this?
Thanks


Dimitrina
Telerik team
 answered on 02 Sep 2014
7 answers
234 views
Hi,

I try to follow the thread about CustomStyle (http://www.telerik.com/help/wpf/styling-apperance-custom-styles-themes-runtime.html) by replacing the RadButton by a RadGridView.

<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style TargetType="telerik:RadGridView" BasedOn="{StaticResource RadGridViewStyle}">
        <Setter Property="Background" Value="Red"/>
    </Style>
</ResourceDictionary>

When I click on Button to switch the theme, an exception is raised ('System.Windows.Markup.XamlParseException') because it's not able to resolve the RadGridViewStyle. It seems that it can not resolve staticresource presents in another files (app.xaml), i don't understand why it's work with RadButton and not RadGridView.

Thanks for feedback.
Regards
Dimitrina
Telerik team
 answered on 02 Sep 2014
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
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?