Telerik Forums
UI for WPF Forum
5 answers
127 views
So the structure of my tree is something like:

RootObject
    ChildObject1
        GrandChildObject1
    ChildObject2
        GrandChildObject2

Problem 1: When I drag and drop GrandChildObject1 to ChildObject2, the collection in ChildObject1 calls its Delete method, and I don't want that, since there's a few steps I need to do before removing GrandChildObject1 from ChildObject1.

Problem 2: When I drop GrandChildObject1 into ChildObject2, there's a few steps I need to do before finally adding GrandChildObject1 to ChildObject2. So doing this, also triggers the Add Method, so I end up having two children of the same item (one added by the TreeView itself, and one I add with my own method in the TreeView.RadTreeView_DragEnded event).

So, is there a way to prevent the TreeView from handling this, and not losing the little Drag&Drop preview when the drag starts? I just want to disable the TreeView from triggering a change in the Collection. I found out it was doing it by setting a breakpoint here:

private void GrandChildren_CollectionChanged(object sender, NotifyCollectionChangedEventArgs e) 
    this.NotifyPropertyChanged("GrandChildren"); // breakpoint here

EDIT: The collection of GrandChildren is an ObservableCollection<T>, and I can't change that to BindingList<T> or List<T>

Thanks!
Valentin.Stoychev
Telerik team
 answered on 08 Apr 2010
2 answers
223 views
Hello,

I would like to bind cell background color to cell value (via converter of course). However when I declare style in GridViewResource like this:

<Style TargetType="{x:Type telerik:GridViewCell}"
  <Setter Property="Background"
    <Setter.Value> 
      <SolidColorBrush Color="{Binding Converter={StaticResource decimalToColor}}" /> 
    </Setter.Value> 
   </Setter> 
</Style> 
which simply should return Brushes.Red.Color for value < 0 Green for value  > 0 and left color White when value is equal to 0. In debug mode I discovered that value passed to value converter is eqal to whole object (I'm binding ItemSource to collection of custom business objects) instead of being equal to object property value which is binded to column.

When I try to do something like this:

<telerik:GridViewDataColumn Width="45" DataType="{x:Type sys:Decimal}" Header="H1" DataMemberBinding="{Binding Path=H1, Mode=TwoWay}" DataFormatString="{}{0:n0}" IsGroupable="False" IsSortable="False" IsFilterable="False"
  <telerik:GridViewColumn.CellStyle> 
     <Style TargetType="{x:Type telerik:GridViewCell}"
       <Setter Property="Background"
         <Setter.Value> 
           <SolidColorBrush Color="{Binding Converter={StaticResource cellBGConverter}}" />
         </Setter.Value> 
       </Setter> 
    </Style> 
  </telerik:GridViewColumn.CellStyle> 
</telerik:GridViewDataColumn> 

it's even working, color is changed (value converter gets cell value), but I get an error:

"System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=H1; DataItem='DailyPosition' (HashCode=7712694); target element is 'SolidColorBrush' (HashCode=16353339); target property is 'Color' (type 'Color')
"
which cause low performance :(
Any ideas? How to get cell value in first style declaration?

Thanks in advance,
MC



srinivas nch
Top achievements
Rank 1
 answered on 08 Apr 2010
0 answers
106 views
Hi Team,

May I'm posting in worng place, but i don't know where to post it.

Actually my problem is....

I have content which is in wordml format stored in database, now I have to replace those tags and should display it in Textbox again.

my actual content in DB is

------------------
<w:document xmlns:ve="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:wne="http://schemas.microsoft.com/office/word/2006/wordml" xml:space="preserve">    <w:body>      <w:sect>        <w:p>          <w:pPr>            <w:jc w:val="left" />            <w:spacing w:after="180" w:before="180" />          </w:pPr>          <w:r>            <w:rPr>              <w:rFonts w:ascii="Tahoma" w:hAnsi="Tahoma" w:cs="Tahoma" />              <w:sz w:val="16" />              <w:b w:val="off" />              <w:i w:val="off" />              <w:color w:val="000000" />            </w:rPr>            <w:t>dsafdsfdsafdfdsfdsfdfdf</w:t>          </w:r>        </w:p>        <w:p>          <w:pPr>            <w:jc w:val="left" />            <w:spacing w:after="180" w:before="180" />          </w:pPr>          <w:r>            <w:rPr>              <w:rFonts w:ascii="Tahoma" w:hAnsi="Tahoma" w:cs="Tahoma" />              <w:sz w:val="16" />              <w:b w:val="off" />              <w:i w:val="off" />              <w:color w:val="000000" />            </w:rPr>          </w:r>        </w:p>      </w:sect>    </w:body>  </w:document>

----------------------
Now I've to display actual content in Textbox by removing tags

Please suggest me a solution or any replated information

Thanks in advance.

Regards,

Sundari
sundaril lakshmi
Top achievements
Rank 1
 asked on 07 Apr 2010
1 answer
128 views
Hi there,

when using the Map control, do I need to get also a licence from the map provider (Bing->Microsoft)?

Kind regards,
Sörnt
Giuseppe
Telerik team
 answered on 07 Apr 2010
1 answer
308 views
Is it possible to databind the value of a RadProgressBar in XAML? For example:

<telerik:RadProgressBar  
     Name="PercentBar"  
     Orientation="Horizontal"  
     Margin="3"  
     Value="{Binding Path=My_Percent, StringFormat=P0}" /> 

Seems simple, but this particular code throws the following error:

System.InvalidOperationException was unhandled 
Message: A TwoWay or OneWayToSource binding cannot work on the read-only  
property 'My_Percent' of type 'System.Data.Common.DataRecordInternal'. 

There is no example in the current documentation for the control.
Art Kedzierski
Top achievements
Rank 2
 answered on 07 Apr 2010
2 answers
68 views
Hi...

Do you have some where your default styles for the grid view ?
I can't manage to load them in blend and modify them, so I thought to manually insert them to my app.xaml.

10x

Eran.
Eran Lahav
Top achievements
Rank 1
 answered on 07 Apr 2010
7 answers
726 views
Dear all
can some one give simple code for makie mdi for radwindows
(Multiple Document Interface (MDI) Design)

i need to make an aplication that creates multi radwindow on the mainwindow.
1.all the subwindow cannot go out of the mian page.
2.when i activiate the main window all the sub window will still on the front.
Miroslav Nedyalkov
Telerik team
 answered on 07 Apr 2010
1 answer
235 views
Hi!

We have two issues concerning the title of this post:

1) We're porting an application from VB6 to WPF. In VB6 we're using QuickTimePlayer to play MP4 files, but WPF MediaPlayer does not native play them and there is not any Support/Control using QuickTimePlayer directly. Questions: Is there a way to get MP4 files running in MediaPlayer (ideally without installing huge codec packages)? Or is there a way to get QuickTimePlayer into WPF not using WindowsFormsHost?

2) In the WPF application we need to play video files from stream because they are cryptographically secured an will be encrypted while streaming to the player (because only the application itself should be able to play the files). Is there a way within MediaPlayer?

Thx!

Miro Miroslavov
Telerik team
 answered on 07 Apr 2010
7 answers
164 views
Hello,

I'm running internal build 2010.1.326.35. When i host the RadDocking control inside of a windows form using a ElementHost I'm getting "Object reference not set to an instance of an object."

sample code.
using System; 
using System.Collections.Generic; 
using System.ComponentModel; 
using System.Data; 
using System.Drawing; 
using System.Linq; 
using System.Text; 
using System.Windows.Forms; 
 
namespace WindowsFormsApplication1 
    public partial class Form1 : Form 
    { 
        public Form1() 
        { 
            try 
            { 
                InitializeComponent(); 
                this.elementHost1.Child = new UserControl1(); 
            } 
            catch (Exception ex) 
            { 
                MessageBox.Show(ex.ToString()); 
            } 
        } 
    } 
 

usercontrol code
<UserControl x:Class="WindowsFormsApplication1.UserControl1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:radDock="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"
    <Grid> 
        <radDock:RadDocking /> 
    </Grid> 
</UserControl> 
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Text; 
using System.Windows; 
using System.Windows.Controls; 
using System.Windows.Data; 
using System.Windows.Documents; 
using System.Windows.Input; 
using System.Windows.Media; 
using System.Windows.Media.Imaging; 
using System.Windows.Navigation; 
using System.Windows.Shapes; 
 
namespace WindowsFormsApplication1 
    /// <summary> 
    /// Interaction logic for UserControl1.xaml 
    /// </summary> 
    public partial class UserControl1 : UserControl 
    { 
        public UserControl1() 
        { 
            InitializeComponent(); 
        } 
    } 


any suggestions for a workaround would be great. we have a conference coming up next week to demonstrate our product and this control is in all of our WPF maintenance screens.

Thanks much
~Boots
Miroslav Nedyalkov
Telerik team
 answered on 07 Apr 2010
2 answers
271 views
Problem:
    1. How to Refresh Radgridview when i Insert Record in database and update record.
    2.when i am Insert or Update Record than in radgridview that row is selected.

i am useing sql server 2005.

i am use to set data source of radgridview like " radgridview1.ItemsSource = ds; "  ==> ds is dataset.

i am beginner so if possible than tel me by code it is easy to understand.......

can u help me as early as possible ....


xola139
Top achievements
Rank 1
 answered on 06 Apr 2010
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?