Telerik Forums
UI for WPF Forum
2 answers
301 views
Hi,

I have two questions, first i have a button in a column, but when a put the gridview in readonly, the button continues the same.

How i can put the button in readonly mode? This is the code.
<telerik:RadGridView x:Name="myListView" IsReadOnly="{Binding Path=pending, Converter={StaticResource booleanToInverseConv}}">
    <telerik:RadGridView.Columns>
        <telerik:GridViewColumn Header="" IsFilterable="False" HeaderCellStyle="{StaticResource estiloDaColuna}">
            <telerik:GridViewColumn.CellTemplate>
                <DataTemplate>
                    <Button Style="{DynamicResource ImageButtonStyle}" Tag="{Binding Path=id}" x:Name="btnRemoveProduto" Width="20" Click="removeProduto_Click" Height="20">
                        <Image Source="..\..\..\Icons\delete_red.png" Stretch="Fill" VerticalAlignment="Top" HorizontalAlignment="Left" />
                    </Button>
                </DataTemplate>
            </telerik:GridViewColumn.CellTemplate>
        </telerik:GridViewColumn>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

Second question, i want bind a business property in a column footer,
<telerik:GridViewDataColumn IsFilterable="False" IsReadOnly="True" Header="Desconto 2" DataMemberBinding="{Binding desconto2}" DataFormatString="{}{0:N2}%" Width="90" HeaderCellStyle="{StaticResource estiloDaColuna}" FooterCellStyle="{StaticResource GridViewCellStyleLeft}">
                                    <telerik:GridViewDataColumn.Footer>
                                        <StackPanel>
                                            <Label Content="Ola"></Label>
                                            <Label Content="{Binding Path=Descontos}"></Label>
                                        </StackPanel>
                                    </telerik:GridViewDataColumn.Footer>

Making that only appears the word "ola", the value in "Descontos" is not show. How can resolve it?

Thanks
Tiago
Top achievements
Rank 1
 answered on 07 May 2012
3 answers
365 views
When I insert a large jpeg into the richtextbox, the editor chops off the right side of the image to fit into the richtextbox without a horizontal scrollbar.  What I need is a way to make the richtextbox expands to fit the image.

<
telerik:RadRichTextBox HorizontalAlignment="Stretch" LayoutMode="Flow" x:Name="editor" AllowDrop="True" Drop="editor_Drop" ShowComments="False"
                        BorderBrush="Transparent" BorderThickness="0" IsSelectionMiniToolBarEnabled="False"
                        IsContextMenuEnabled="True" IsInHeaderFooterEditMode="False" DocumentPresentationChanged="EditorDocumentContentChanged"
                        LostFocus="editor_LostFocus" SizeChanged="editor_SizeChanged" HorizontalScrollBarVisibility="Disabled">
</telerik:RadRichTextBox>

private void editor_SizeChanged(object sender, SizeChangedEventArgs e)
{
    this.editor.UpdateEditorLayout();
}

Ivailo Karamanolev
Telerik team
 answered on 07 May 2012
1 answer
177 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
153 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
167 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
137 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
110 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
99 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
111 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
909 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
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
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?