Telerik Forums
UI for WPF Forum
3 answers
310 views

Hello,

I want to set a custom user control as an entry for some properties (full MVVM support). If the user clicks the button a custom file selector (modal) should be shown. If the user selects a file, the file path should be shown in the textfield and also should be bind to the changed property in the propertygrid.

UserControl: A grid with a textfield and a button

<UserControl x:Class="EN.Editor.UI.ImageSelector"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:EN.Editor.UI"
             xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
             mc:Ignorable="d"
             Width="100"
             >
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*"></ColumnDefinition>
            <ColumnDefinition Width="30"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <TextBox Grid.Column="0" Name="txtPath" Text="{Binding ImagePath, Mode=TwoWay}" />
        <Button Grid.Column="1" Command="{Binding SelectFileCommand}" CommandParameter="{Binding}" Content="..." />
    </Grid>
</UserControl>

 

ViewModel of the User Control (set as DataContext in Code behind)

public class ImageSelectorViewModel : ViewModelBase
   {
       private string imagePath;
 
       public DelegateCommand SelectFileCommand { get; private set;}
 
       public ImageSelectorViewModel()
       {
           this.SelectFileCommand = new DelegateCommand(x => SelectFile());
       }
 
 
       public string ImagePath
       {
           get { return imagePath; }
           set
           {
               if (this.imagePath != value)
               {
                   imagePath = value;
                   OnPropertyChanged(() => ImagePath);
               }
           }
       }
 
 
       private void SelectFile()
       {
           FileSelector fs = new FileSelector("Choose file");
           if (fs.ShowDialog() == CommonFileDialogResult.Ok)
           {
               this.ImagePath = fs.FileName;
           }
       }
   }

 

I set the user control as a custom editor attribute on the autogenerated item of my property grid

[Display(AutoGenerateField = true, Name = "Video Transition")]
      [Telerik.Windows.Controls.Data.PropertyGrid.Editor(typeof(ImageSelector), EditorStyle.None)]
      public string NavigateToMovie
      {
          get
          {
              return this.navigateToMovie;
          }
          set
          {
              if (this.navigateToMovie != value)
              {
                  this.navigateToMovie = value;
                  this.OnPropertyChanged(() => NavigateToMovie);
              }
          }
      }

 

I've tried many different ways, but the click command isn't triggered. If I replace the click command on the button with a Click event handler the file selector is shown, but the selected file path isn't set on the property in the property grid. I've also tried to set the targetProperty Attribute to "ImagePath" but also without success.

For better code separation I need the full MVVM style.

I've spent lot of hours to get this done - without success.

What's wrong with my code? Thanks.

 

Martin
Telerik team
 answered on 23 Jan 2017
6 answers
224 views

Currently I'm using the themes Visualstudio2013 for gantt view. 

I only want to change background in one case and others would like to normal in the themes .

I found the sample "Tasks with different color" in the SDK.  But the sample didn't work well. the fonts color , progress bar color are reset.

 Any suggestion for this situation?

 

Thanks

-Jacky

Lance | Senior Manager Technical Support
Telerik team
 answered on 20 Jan 2017
3 answers
151 views

Hi,

I understand from this http://www.telerik.com/forums/parentrow-problem that it is an expected beahvior.

I can't disable virtualization as it leads to performance issues.

I might have huge tree items in my application and i'm trying the locate the parent row on left arrow key down (the parent item will not be in visible area).

I cannot get the parent object as this is common behavior implemented in common library.

Please let me know if there is any other workaround.

Stefan
Telerik team
 answered on 20 Jan 2017
1 answer
215 views
Hi,

I don't find any Brush Editor control for the Property Grid.
This Editor doesn't exist ?


Regards
Dilyan Traykov
Telerik team
 answered on 20 Jan 2017
1 answer
138 views

Hi,

I am currently hiding few columns in the activeWorkSheet ,my question was is there a way to enter data to hidden columns still keeping the column hidden state true??

Dinko | Tech Support Engineer
Telerik team
 answered on 20 Jan 2017
1 answer
118 views

 

when click cut or press Ctrl+X  the selected text is copyed but not disappear

Is any solution for this

 

Stefan Nenchev
Telerik team
 answered on 20 Jan 2017
1 answer
429 views

Hello All,

     I'm trying the tabcontrol for the first time, and  am very curious as to do I create a new view/viewmodel pair for each tab or handle everything in the first pair where the overall top tabcontrol is based???  I think that I would like to have separate ones for ease in development but I haven't figured out as to how to assign them to the tab items...  Or is it just better to have in all in one?

 

What am I missing?  

 

Any help would be greatly appreciated,

Thanks in advance,

Kevin Orcutt

 

 

Stefan
Telerik team
 answered on 20 Jan 2017
0 answers
98 views
I have grid with filter option, there are more than 15 records and window is resized when i click filter button then the last control(filter and cancel button) is getting curtailed. Please suggest to fix this and find screenshot for issue.
amit
Top achievements
Rank 1
 asked on 19 Jan 2017
1 answer
87 views

Hi,

Simple question, how can I subscribe to MailMergeCommand so that I can find out where the file is being saved. 

 

void radRichTextBox_CommandExecuted(object sender, CommandExecutedEventArgs e)
{
    if (e.Command is MailMergeCommand)
    {
       // File Dialog FilePath Location Code
    }
}
 
void radRichTextBox_CommandExecuting(object sender, CommandExecutingEventArgs e)
{
    if (e.Command is MailMergeCommand)
    {
         
    }
}

 

 

Martin Ivanov
Telerik team
 answered on 19 Jan 2017
3 answers
179 views

Has there been any work on touch support for the Chart control? I found this old post that mentioned support being worked on in 2012 Q2.

The features we want to implement are:

  • Swipe to pan
  • Pinch to zoom
  • Tap to place custom markers
  • Drag to move custom markers

I could not find anything in the API documentation, could you give me any pointers as to how to implement this?

Peshito
Telerik team
 answered on 19 Jan 2017
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?