Telerik Forums
UI for WPF Forum
1 answer
154 views

Hi,

It is somehow possible to display/edit an EntityCollection of entities?

My entity looks like that:

public partial class Property : EntityObject
{....
  public string Name {set;get}
  public string Description {set;get}
  public string Value{set;get}
  public string RegExValidationString{set;get}
}

And I want to be able to edit a collection, each object in the collection to be displayed as an row in the PropertyGrid:

EntityCollection<Property> entityCollection = new EntityCollection<Property>();
entityCollection.Add(new Property() { Name = "test1", Description = "test1 description", Value = "111" });
entityCollection.Add(new Property() { Name = "test2", Description = "test2222 description", Value = "lallla" });
I tried by adding PropertyDefinitions, but I'm not able to edit values:

foreach (Property p in entityCollection)
{
    PropertyDefinition pd = new PropertyDefinition() 
    
        Binding = new Binding { Source = p.Value }, 
        DisplayName = p.Name, 
        Description = p.Description 
    };                
 
    radPropertyGrid.PropertyDefinitions.Add(pd);
}
Is there another way to do this? Do you have any examples?

albu
Top achievements
Rank 1
 answered on 07 May 2012
0 answers
139 views
  • Hi  Maya,

Please do reply to the below thread chain with sample application...

I just want to appply alternate grid row color for telerik:RadGridView  

instead of applying the following property in tag,
<telerik:RadGridView AlternateRowBackground="Aqua" AlternationCount="2"/>

 i want to do the same in common settings (resource dictionary)

Please advice me ASAP.
Mohamed
Top achievements
Rank 1
 asked on 07 May 2012
0 answers
141 views
Hi Team,

I have few requirements/solutions.

Requirement 1# : I have a custom Row Style, as shown in image attached. 
                            On Expansion/Collapase of row in Hirerchy grid, above mentioned row style should be applied.

Please find the attachement.

    
                           
Prakash
Top achievements
Rank 1
 asked on 06 May 2012
0 answers
85 views
Hi,

is it possible to drop in any position of a control? In a ListView the droppped items are in a line, but i want to drop them
somewhere in the crontrol i want, is tha possible and how?

Thanks
regards
Rene
ITA
Top achievements
Rank 1
 asked on 06 May 2012
1 answer
83 views
HI

 I am  using Radgridview in my first column binding the Combox Intemsource. second column is data column i want to bind the data  for second column based on the first column selection.

eg)
Gridview
First column displaying Country  code  (drop down)
second column should display the  country name based on the drop down selection.
I am using MVVM model

 can you help me  i checked telerik article but icouldnotable to achive..

regards
murugan
smith
Top achievements
Rank 1
 answered on 06 May 2012
0 answers
85 views
hi , I have done as per your doc shown here.
But I cannot get the add and delete buttons to show in the rad data form. i even tried implementing ieditable object etc. There is some complicated forum thread regarding implementing icollectionview etc. All I need is the add and delete buttons to show in addition to showing the raddataform in edit mode. (ok button enabled). I tried
<telerik:RadDataForm CurrentItem="{Binding CurrentItem,ElementName=RadGridView1}" 
no luck so far. Any simple solution to this ?
thankyou
Geena
Top achievements
Rank 1
 asked on 04 May 2012
2 answers
91 views
Is there a way to get notified when the user pans the digram? I didn't see an event that looked obvious to me and noticed that the RadDiagram does not implement the INotifyPropertyChanged interface so I can't get notified when the Viewport changes.
Eric
Top achievements
Rank 1
 answered on 04 May 2012
6 answers
870 views
Good evening,

How can I insert text into my RadRichTextBox / Document wrapped with custom annotations?

I have the following code, but it only works the first time the code is run. If I run the code a second time by inserted a second piece of text then the annotations aren't wrapped properly.
Please see my code & XAML output below.

Code to insert text and annotation:
//Focus RichTextBox - I have made my own Intellisense ListBox
radRichTextBox.Focus();
//Get Caret position (start position)
DocumentPosition startPosition = new DocumentPosition(radRichTextBox.Document);
//Insert text into document at caret position - text is from Intellisense ListBox selected item
radRichTextBox.Document.Insert(((Products)radListBox.SelectedItem).Name + ": ", radRichTextBox.Document.Style);
//Get caret position now text has been inserted (end position)
DocumentPosition endPosition = new DocumentPosition(this.radRichTextBox.Document);
//Adjust position of Intellisense ListBox to new Caret position
AdjustAutoCompletePosition();
//Reload Intellisense ListBox with new items based on previous selection
SetAutoCompleteListBoxItems(((Products)radListBox.SelectedItem).ID);
//Set Custom Annotation
SemanticRangeEnd rangeEnd = new SemanticRangeEnd();
SemanticRangeStart rangeStart = (SemanticRangeStart)rangeEnd.CreatePairedStart();
rangeStart.Name = "SemanticRange " + count++;
//Place annotation around newly inserted text - note start & end position
radRichTextBox.Document.InsertCustomAnnotationRange(startPosition, endPosition, rangeStart, rangeEnd);

Here is the XAML output when the code is run for the first time (this is correct as it should be):
<t:Paragraph>
  <custom1:SemanticRangeStart AnnotationID="1" Name="SemanticRange 0" />
      <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Appliances: " />
  <custom1:SemanticRangeEnd AnnotationID="1" />
</t:Paragraph>

If I run the code a second time to insert a second piece of text then I get the following output (this isn't what I want):
<t:Paragraph>
  <custom1:SemanticRangeStart AnnotationID="1" Name="SemanticRange 1" />
  <custom1:SemanticRangeEnd AnnotationID="1" />
  <custom1:SemanticRangeStart AnnotationID="2" Name="SemanticRange 0" />
     <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Appliances: " />
  <custom1:SemanticRangeEnd AnnotationID="2" />
 <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Hob: " />
</t:Paragraph>

This is the XAML output that I want to achieve (each piece of inserted text has it's on annotation range):
<t:Paragraph>
 <custom1:SemanticRangeStart AnnotationID="2" Name="SemanticRange 0" />
    <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Appliances: " />     
<custom1:SemanticRangeEnd AnnotationID="2" />
<custom1:SemanticRangeStart AnnotationID="1" Name="SemanticRange 1" />
    <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Hob: " />
<custom1:SemanticRangeEnd AnnotationID="1" /> 
</t:Paragraph>

I think the problem is that I'm not getting the correct start & end positions of the newly inserted text. Please see my c# code "positionStart" & "positionEnd".

Basically my application is an intellisense autocomplete application where the ListBox autcomplete items are drawn from a database. Thus I need the custom annotations to wrap around my text to relate it to the database ID tags. I haven't setup the proper annotation values yet, I'm just playing with the example code from a telerik demo project.

Any advice would be greatly appreciated.

I think I need to achieve the following:
  • Get Caret Position (start position)
  • Insert text into document
  • Get Carent Position (end position)
  • Apply annotation based on start & end positions

 

Thank you for your time,

Rob


************   EDIT   *************

I have tried setting the start and end positions like so but it still doesn't work:

C# Code to insert text & annotations:
//Get caret position (start)
DocumentPosition startPosition = this.radRichTextBox.Document.CaretPosition;
 
//Insert text into document at caret position - text is from Intellisense ListBox selected item
radRichTextBox.Document.Insert(((Products)radListBox.SelectedItem).Name + ": ", radRichTextBox.Document.Style);
 
//Get caret position now text has been inserted (end of text)
DocumentPosition endPosition = this.radRichTextBox.Document.CaretPosition;


XAML Output:
<t:Paragraph>
  <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Appliances: " />
  <custom1:SemanticRangeStart AnnotationID="1" Name="SemanticRange 0" />
  <custom1:SemanticRangeEnd AnnotationID="1" />
    <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Hob: " />
  <custom1:SemanticRangeStart AnnotationID="2" Name="SemanticRange 1" />
  <custom1:SemanticRangeEnd AnnotationID="2" />
    <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Electric: " />
  <custom1:SemanticRangeStart AnnotationID="3" Name="SemanticRange 2" />
  <custom1:SemanticRangeEnd AnnotationID="3" />
    <t:Span FontFamily="Verdana" FontSize="16" FontStyle="Normal" FontWeight="Normal" Text="Beko HIC64102" />
</t:Paragraph>




Robert
Top achievements
Rank 1
 answered on 04 May 2012
1 answer
156 views
Good evening,

Is there a list or information detailing what properties & methods can be overridden and the function they serve for the Annotation Ranges ?

For example I have SmanticRangeStart & SemanticRangeEnd classed with the following properties:

Range End
public override bool SkipPositionBefore
{
    get
    {
        return true;
    }
}
 
public override bool IsCopyable
{
    get
    {
        return true;
    }
}
 
public override AnnotationMarkerDeleteBehavior BackspaceBehavior
{
    get
    {
        return AnnotationMarkerDeleteBehavior.SelectAnnotation;
    }
}

Range Start
public override bool SkipPositionBefore
{
    get
    {
        return true;
    }
}
 
public override bool IsCopyable
{
    get
    {
        return true;
    }
}
 
public override bool SkipPositionsInRange
{
    get
    {
        return true;
    }
}

Any information would be very useful.

Thanks,

Rob



Iva Toteva
Telerik team
 answered on 04 May 2012
2 answers
194 views
Hi,

How do you get the custom annotation of a selected span?

For example:
<t:Paragraph>
  <custom1:SemanticRangeStart AnnotationID="1" Name="SemanticRange 0" />
     <t:Span FontFamily="Segoe UI" FontSize="14" FontStyle="Normal" FontWeight="Normal" Text="Appliances: " />
  <custom1:SemanticRangeEnd AnnotationID="1" />
  <custom1:SemanticRangeStart AnnotationID="2" Name="SemanticRange 1" />
     <t:Span FontFamily="Segoe UI" FontSize="14" FontStyle="Normal" FontWeight="Normal" Text="Dishwasher" />
  <custom1:SemanticRangeEnd AnnotationID="2" />
</t:Paragraph>

Suppose my select range covers the last span which contains the text "Dishwasher".
From the selection, how can I retrieve it's annotation programmatically?

Thank you for your time,

Rob
Robert
Top achievements
Rank 1
 answered on 04 May 2012
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
Book
FileDialogs
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
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?