Telerik Forums
UI for WPF Forum
1 answer
119 views
Hi,

I have a copy menu with command = Copy and CommandTarget=MyRadGridView. Now when i click copy and paste it in excel, it pastes the name of the binding object for the columns where I'm using converter to concatenate two fields. For columns which have direct binding defined it copies the data.

Copy command:

 

 

 

<MenuItem Header="Copy" InputGestureText="Ctrl+C" Command="ApplicationCommands.Copy" CommandTarget="{Binding ElementName=vpRadGridView}"/>

GridColumns
1.

 

 

 

 

 

<telerik:GridViewDataColumn

 

 

 

 

 

 

 

 

 

 

 

Header="Verification Path Pair"

 

 

 

 

 

 

 

 

 

 

 

UniqueName="VerificationPathPair"

 

 

 

 

 

 

 

 

 

 

 

DataMemberBinding="{Binding Path=., Converter={StaticResource VPPair}}"

 

 

 

 

 

 

 

 

 

 

 

/>

 

2.

<

 

 

telerik:GridViewDataColumn

 

 

 

Header="Verification Path ID"

 

 

 

UniqueName="VerificationPathID"

 

 

 

DataMemberBinding="{Binding Name, ValidatesOnExceptions=True, Mode=OneWay, ValidatesOnDataErrors=True}"

 

 

 

/>

 

Copy Results:

MySolution.OrmNhib.BusinessObjects.OnepValidochpath

   VP1
It should have copied actual data for column 1 also as it did for column 2. Any suggestion?

Ivan Ivanov
Telerik team
 answered on 26 May 2011
1 answer
58 views
I get the following error in my code after upgrading the controls. The problem is, even the demo of group header still uses the OrientedGroupHeaderContentTemplateSelector object. What gives?


Error 10 'Telerik.Windows.Controls.OrientedGroupHeaderContentTemplateSelector' is obsolete: 'Please, use the StringFormat properties, the System.Windows.Controls.GroupHeaderTemplateSelector or inherit from System.Windows.Controls.ScheduleViewDataTemplateSelector instead.' C:\Users\rodneyy\Documents\MetrixDevelopment\MetrixDevelopment\Client\Metrix.UI\Managers\RepairCenterComponent\RepairBoardManager.cs 62 148 Metrix.UI

This is the line that produces the error...
repairBoardScheduleView.GroupHeaderContentTemplateSelector = Application.Current.FindResource("GroupHeaderContentTemplateSelector") as OrientedGroupHeaderContentTemplateSelector;

So apparently this works but I don't understand why I am casting this resource to something that it is not....
repairBoardScheduleView.GroupHeaderContentTemplateSelector = Application.Current.FindResource("GroupHeaderContentTemplateSelector") as ScheduleViewDataTemplateSelector;
Yana
Telerik team
 answered on 26 May 2011
3 answers
100 views
Hello there,

I have an issue with SelectedItemRemoveBehaviour of RadPaneGroup - it is either not working as expected or I don't understand what is expected. I am using it to control which document is selected when the current one has been closed. It doesn't matter which value I use, everytime the first item (left to right) is selected.

Can you help me understand this property, please? Is there a bug, or I am missing something. Let me know if you need me to provide you with a basic project with this issue reproduced.

As a side note - I am adding dynamically items to RadPaneGroup of type RadDocumentPane. I would like when a user closes the current document, then the previous used one is selected. I know how to achieve this programatically, but I found this property and I thought I can use it.

Thanks for your assistance.

Best Regards,

Ivan.
Miroslav Nedyalkov
Telerik team
 answered on 26 May 2011
1 answer
74 views
When i set the properties MajorTickLength and MinorTickLength, at TimeLineViewDefinition, to 1day the application slows down when the control is rendered (maximizing or minimizing the window, scrolling, getting focus, ...). Reading the forum if found how to solve this problem out when scrolling (adding a container), but i haven't found a solution for the other issues.

Here it is the definition for the control:

<

 

telerik:RadScheduleView

 

 

x:Name="scheduleView"

 

 

 

AppointmentsSource="{Binding ImmovilizationModel.ImmovilizationAppointments}"

 

 

GroupDescriptionsSource="{Binding ImmovilizationModel.GroupDescriptions}">

 

 

 

<telerik:RadScheduleView.ViewDefinitions>

 

 

 

<telerik:TimelineViewDefinition>

 

 

 

<telerik:TimelineViewDefinition.MajorTickLength>

 

 

 

<telerik:FixedTickLengthProvider />

 

 

 

</telerik:TimelineViewDefinition.MajorTickLength>

 

 

 

<telerik:TimelineViewDefinition.MinorTickLength>

 

 

 

<telerik:FixedTickLengthProvider />

 

 

 

</telerik:TimelineViewDefinition.MinorTickLength>

 

 

 

</telerik:TimelineViewDefinition>

 

 

 

</telerik:RadScheduleView.ViewDefinitions>

 

 

 

</telerik:RadScheduleView>

 


¿Is there anything i can do to speed up control rendering?
Valeri Hristov
Telerik team
 answered on 26 May 2011
1 answer
92 views
Hello, 

I have a problem, 
How we can use personal convertors on labels on AxisX?

For instance : 
data(int) :3600,7200,10800
label(string) :1h,2h,3h

We need to use integers in our datas but labels need to be custom strings.

Best regards,
Yavor
Telerik team
 answered on 26 May 2011
2 answers
288 views
Hello Support-Team,

i'd like to customize the RadComboBox to have a masked input with autocompletion.

 
<telerik:RadComboBox x:Name="maskedComboBox"                      
 ItemsSource="{Binding Path=ValuesViewModel.ExistingValues}"
 DisplayMemberPath="ValueName" SelectedValuePath="ValueId"
 SelectedValue="{Binding Path=ValuesViewModel.SelectedValue, UpdateSourceTrigger=PropertyChanged}"
 CanAutocompleteSelectItems="True" IsFilteringEnabled="True" TextSearchMode="StartsWith"
 OpenDropDownOnFocus="True" IsEditable="True"
 EditableTemplate="{DynamicResource MaskedComboBoxEditableTemplate}" />

As far as I've read the only way to reach that is to customize the EditableTemplate,
so I used Blend to get me a copy to work on.
At first I exchanged the original PickerTextBox PART_EditableTextBox simply with a
RadMaskedTextBox, which of course didn't work out the way I wanted.
So I unsuccessfully tried to find a nice example, in which someone needed the same or a similar customization.

Because of that I decided to leave the PickerTextBox the way it is and just show a MaskedTextBox instead of
the PickerTextBox and bind the MaskedTextBox.Value-property to the PickerTextBox.Text-property.
That at least worked for the filtering, but I lost theOpenDropDownOnFocus, most likely because I need the
focus on the PickerTextBox.

Code snippet of PART_EditableTextBox:

<telerik:PickerTextBox x:Name="PART_EditableTextBox"
 BorderThickness="{TemplateBinding BorderThickness}"
 Background="{TemplateBinding Background}"
 Grid.Column="0"Visibility="Collapsed"
 HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
 IsReadOnly="{TemplateBinding IsReadOnly}"
 Padding="{TemplateBinding Padding}"
 VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
 Text="{Binding ElementName=maskedTextBox, Path=Value, Mode=TwoWay}" >
 <telerik:StyleManager.Theme>
  <telerik:Office_BlackTheme/>
 </telerik:StyleManager.Theme>
</telerik:PickerTextBox>
 
<Controls:RadMaskedTextBox x:Name="maskedTextBox"
 Grid.Column="0"
 Mask="{Binding Path=SizeChartViewModel.SizeChartMask.Mask}"
 MaskType="Standard"
 SelectionOnFocus="CaretToBeginning"
 BorderThickness="{TemplateBinding BorderThickness}"
 Background="{TemplateBinding Background}"
 HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
 IsReadOnly="{TemplateBinding IsReadOnly}" Padding="{TemplateBinding Padding}"
 VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">
 <telerik:StyleManager.Theme>
  <telerik:Office_BlackTheme/>
 </telerik:StyleManager.Theme>
</Controls:RadMaskedTextBox>

Is there any better approach to customize the ComboBox to get what I need?
Or is there any workaround to get my changes of the EditableTemplate to work the way I want it to?

Thank you!


										
Björn
Top achievements
Rank 1
 answered on 26 May 2011
0 answers
67 views
Hi Support,

I have some queries in Telerik controls as follows.

Please check the below with Both WPF/Silverlight.

1. Does Telerik Have DataGrid with RichText Box cell type.
2. If so, Can i export and import the content of Richt Text box in DataGrid to Excel  and viseversa.
3. Can i copy the content of the RTB cell and paste in Excel to obtain the same formatted text.

Thanks
Kamal.
kamal
Top achievements
Rank 1
 asked on 26 May 2011
2 answers
384 views
I start to use mvvm pattern and i have situation like this:
On my View I have RadGridView implement in this way. On View exist button "Edit". When user click on this button i show new window to edit SelectedNews (in constructor i give this object). I implement IEditableObject on NewsModelItem. Problem is that when i click "Close" on my edit window and i call NewModelitem.EndEdit() my RadGridView is not refresh.
<telerik:RadGridView  DockPanel.Dock="Top" Width="auto"  SelectedItem="{Binding SelectedNews,Mode=TwoWay}"
                                    ItemsSource="{Binding NewsModelDTO.NewsItems}" 
                                    Grid.Row="0"
                                    AutoGenerateColumns="False" 
                                    CanUserDeleteRows="False"
                                    CanUserInsertRows="False"
                                    CanUserSelect="True"
                                    GridLinesVisibility="Horizontal"
                                    ShowInsertRow="False"
                                    ShowGroupFooters="False"
                                    ShowColumnHeaders="True"
                                    RowIndicatorVisibility="Collapsed">
              <telerik:RadGridView.Columns>
                      <telerik:GridViewDataColumn Header="UsuÅ„" DataMemberBinding="{Binding NewsIsSelected}"
                         IsReadOnly="True">
                          <telerik:GridViewDataColumn.CellTemplate>
                              <DataTemplate>
                                  <CheckBox IsChecked="{Binding NewsIsSelected, Mode=TwoWay}"/>
                              </DataTemplate>
                          </telerik:GridViewDataColumn.CellTemplate>
                      </telerik:GridViewDataColumn>
                      <telerik:GridViewDataColumn IsReadOnly="True" MaxWidth="200"  Header="Nazwa" DataMemberBinding="{Binding NewsTitle}" />
                      <telerik:GridViewDataColumn IsReadOnly="True" Width="0.4*" Header="Treść" DataMemberBinding="{Binding NewsText}" />
                      <telerik:GridViewDataColumn IsReadOnly="True" Width="120"  Header="Uruchom" DataMemberBinding="{Binding NewsDateFrom}"/>
                      <telerik:GridViewDataColumn IsReadOnly="True" Width="120"  Header="ZakoÅ„cz" DataMemberBinding="{Binding NewsDateTo}"/>
                      <telerik:GridViewCheckBoxColumn IsReadOnly="True" Width="120" Header="Czy aktywny" DataMemberBinding="{Binding NewsIsactive}"/>
              </telerik:RadGridView.Columns>
              </telerik:RadGridView>

In my VM class i have:
public class UcCommunicatesViewModel : ViewModelBase 
    {
        private NewsModelDTO newsModelDTO = new NewsModelDTO();
        private NewsServiceClient newsService;
        private NewsItemModel selectedNews;
        private RelayCommand addNewsCommand;
        private RelayCommand editNewsCommand;
        private RelayCommand deleteNewsCommand;
  
        public RelayCommand AddNewsCommand
        {
            get
            {
                if (addNewsCommand == null)
                {
                    addNewsCommand = new RelayCommand(param => this.AddNewNews(),
                        param => this.CanAddNewNews());
                }
                return addNewsCommand;
  
            }
        }
  
        public RelayCommand EditNewsCommand
        {
            get
            {
                if (editNewsCommand == null)
                {
                    editNewsCommand = new RelayCommand(param => this.EditNews(),
                        param => this.CanEditNews());
                }
                return editNewsCommand;
            }
        }
  
        public RelayCommand DeleteNewsCommand
        {
            get
            {
                if (deleteNewsCommand == null)
                {
                    deleteNewsCommand = new RelayCommand(param => this.DeleteNews(),
                        param => this.CanDeleteNews());
                }
                return deleteNewsCommand;
            }
        }
  
        public bool CanAddNewNews()
        {
             
            return true;
        }
  
        public bool CanEditNews()
        {
            if (SelectedNews == null) return false;
            else return true;
        }
  
        public bool CanDeleteNews()
        {
            foreach (NewsItemModel ni in newsModelDTO.NewsItems)
            {
                if (ni.NewsIsSelected) return true;
            }
            if (SelectedNews == null) return false;
            else return true;
        }
  
        public void AddNewNews()
        {
            AddNewsPopup popup = new AddNewsPopup(false,new NewsItemModel());
            popup.ShowDialog();
            
            if (popup.DialogResult == true)
            {
                FillDataGrid();
                OnPropertyChanged("NewsModelDTO");
            }
            else
            {
               
            }
        }
        public void EditNews()
        {
            AddNewsPopup popup = new AddNewsPopup(true,SelectedNews);
            popup.ShowDialog();
            if (popup.DialogResult == true)
            {
                FillDataGrid();
                OnPropertyChanged("NewsModelDTO");
            }
            else
            {
                OnPropertyChanged("SelectedNews");
                OnPropertyChanged("NewsModelDTO");
            }
             
        }
        public void DeleteNews()
        {
              
              
        }
        public NewsServiceClient NewsService
        {
            get { return newsService; }
            set { newsService = value; }
        }
  
        public NewsModelDTO NewsModelDTO
        {
            get { return newsModelDTO; }
            set 
            {
                newsModelDTO = value;
                OnPropertyChanged("NewsModelDTO");
            }
        }
  
        public NewsItemModel SelectedNews
        {
            get { return selectedNews; }
            set
            {
                selectedNews = value;
                OnPropertyChanged("SelectedNews");
            }
        }
  
        public UcCommunicatesViewModel()
        {
            EndpointAddress endpointAddress = new EndpointAddress("http://localhost:5737/Service/NewsService.svc");
            newsService = new NewsServiceClient(new BasicHttpBinding(), endpointAddress);
            FillDataGrid();
        }
        
        private void FillDataGrid()
        {
            NewsDTO newsDto = newsService.GetNews();
            NewsModelDTO NewsModelDTOCpy = new NewsModelDTO();
            foreach (NewsItem ni in newsDto.NewsItems)
            {
                NewsItemModel nim = new NewsItemModel
                (
                  ni.NewsId,
                  ni.NewsTitle,
                  ni.NewsText,
                  ni.NewsDatefrom,
                  ni.NewsDateto,
                  ni.NewsIsactive
                );
                NewsModelDTOCpy.NewsItems.Add(nim);
            }
            newsModelDTO = NewsModelDTOCpy;
  
        }
       
    }

And my edit window
public class AddNewsPopupViewModel : ViewModelBase
    {
        private NewsItemModel newsItem;
        private RelayCommand saveNewsCommand;
        private RelayCommand closeCommand;
  
        private NewsServiceClient newsService;
        private bool isEditMode=false;
        public event Action RequestClose;
  
        public AddNewsPopupViewModel(bool isEditMode, NewsItemModel newsItem)
        {
            this.newsItem = newsItem;
            this.isEditMode = isEditMode;
            if (isEditMode)
            {
               ((IEditableObject)newsItem).BeginEdit();
            }
        }
  
        public RelayCommand SaveNewsCommand
        {
            get
            {
                if (saveNewsCommand == null)
                {
                    saveNewsCommand = new RelayCommand(param => this.SaveNews(), param => this.CanSaveNews());
                }
                return saveNewsCommand;
            }
        }
  
        public RelayCommand CloseCommand
        {
            get
            {
                if (closeCommand == null)
                {
                    closeCommand = new RelayCommand(param => Close(), param => CanClose());
                }
                return closeCommand;
            }
        }
  
        public bool CanSaveNews()
        {
            if (newsItem.NewsText == string.Empty || newsItem.NewsTitle == string.Empty)
            {
                return false;
            }
            return true;
        }
  
        public NewsItemModel NewsItem
        {
            get { return newsItem; }
            set
            {
                newsItem = value;
                OnPropertyChanged("NewsItem");
            }
        }
  
        public void SaveNews()
        {
            EndpointAddress endpointAddress = new EndpointAddress("http://localhost:5737/Service/NewsService.svc");
            newsService = new NewsServiceClient(new BasicHttpBinding(), endpointAddress);
            if (isEditMode)
            {
                NewsItem itemToSave = ReWriteDataToServiceItem(newsItem);
                newsService.SaveEditedNews(itemToSave);
                ((IEditableObject)NewsItem).EndEdit();
                Common.MessageBox.Show("Dane zostaÅ‚y zapisane", "Informacja", MessageBox.MesageBoxButtons.OK, MessageBox.MessageBoxImage.Information);
                DialogResult = true;
                this.Close();
            }
            else
            {
               NewsItem itemToSave = ReWriteDataToServiceItem(newsItem);
               newsService.AddNews(itemToSave);
               Common.MessageBox.Show("Dane zostaÅ‚y zapisane", "Informacja", MessageBox.MesageBoxButtons.OK, MessageBox.MessageBoxImage.Information);
               DialogResult = true;
               this.Close();
               
            }
        }
        public NewsItem ReWriteDataToServiceItem(NewsItemModel newsItemModel)
        {
            NewsItem newsItemService = new NewsItem();
            newsItemService.NewsId = newsItemModel.NewsId;
            newsItemService.NewsText = newsItemModel.NewsText;
            newsItemService.NewsTitle = newsItemModel.NewsTitle;
            newsItemService.NewsDatefrom = newsItemModel.NewsDateFrom;
            newsItemService.NewsDateto = newsItemModel.NewsDateTo;
            newsItemService.NewsIsactive = newsItemModel.NewsIsActive;
            return newsItemService;
        }
        
  
        public virtual void Close()
        {
            if (isEditMode)
            {
               ((IEditableObject)NewsItem).CancelEdit();
  
            }
            if (RequestClose != null)
            {
                RequestClose();
            }
        }
  
        public virtual bool CanClose()
        {
            return true;
        
         
          
         
    }
Marcin
Top achievements
Rank 1
 answered on 26 May 2011
1 answer
96 views
hi all
when we have flowdocumentscroller in radbook then how can add annotation to texts in flowdocumentscoller?
thankful.
Tina Stancheva
Telerik team
 answered on 25 May 2011
1 answer
65 views
hi all
i add several text to an list<run> and assign radbook itemssource to it.
several of my text is biggest page and dont show.
how can i show that text?
can wrap text in next page or add an scroll to scroll page?
thankful.
Tina Stancheva
Telerik team
 answered on 25 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?