I have a C# WPF application that contains a user control:
<UserControl x:Name="payrollEntryControl" x:Class="MyNamespace.PayrollEntryControl" [...] > [...]</UserControl>Within the user control, I have a Telerik RadDataForm:
<telerik:RadDataForm x:Name="payrollAddForm" CurrentItem="[...]" EditTemplate="{StaticResource myEditTemplate}" />
The template contains a Telerik RadGridView and a Button:
<telerik:RadGridView Grid.Row="0" Grid.Column="0" x:Name="workGridView" [...] ItemsSource="{Binding [...]}" > <telerik:RadGridView.Columns> [...] </telerik:RadGridView.Columns></telerik:RadGridView><Button Grid.Row="1" Grid.Column="0" Command="{Binding addWorkCommand, ElementName=payrollEntryControl}" > Add</Button>I want the command to do is call BeginInsert() on workGridView. But I can't seem to get access to workGridView.
My command, so far:
private DelegateCommand addWorkCommand_ = null;public DelegateCommand addWorkCommand{ get { if (this.addWorkCommand_ == null) { this.addWorkCommand_ = new DelegateCommand( o => addWork(o) ); } return this.addWorkCommand_; }}private void addWork(object o){ var addForm = this.payrollAddForm; var editTemplate = addForm.EditTemplate; var workGrid = editTemplate.FindName("workGridView", addForm);}
My problem? When I make the call to editTemplate.FindName(), I get an exception:
This operation is valid only on elements that have this template applied.Hi,
I'm having persistent issues with the grid when I try to set a saved list of selected rows when loading data into the grid in my WPF project.
The basic logic is as follows:
1. Load the ViewModel, get saved data and populate an observable collection for the ItemsSource property on the grid.
2. Set the SelectedItems property in the same procedure
3. Explicitly call the property changed event for the selected items collection.
I have implemented a custom behaviour to allow the RadGridView to use the Extended selection option and retain all selected items, and it works perfectly in this project and others, when setting the collection in the UI and binding to the collection in the ViewModel.
I put an OnCollectionChanged event onto my selected items collection, and while it gets called as expected when I set the items, it also seems to get called after the grid itself is rendered, which causes the saved selection to be lost.
If I use only a single item, i.e. SelectedItem, this does not get lost, and if I set SelectedItem by using the first line in the collection before setting SelectedItems collection itself, the UI retains the first one, but wipes the others.
I have tried a number of ways to work around this, including trying to fire an event after the selection is overridden but it's proving very tricky to get the right event, and anyway this behaviour should surely not be happening in the first place.
I am attaching a sample project which demonstrates a simpler version of this scenario, with the same problems.
Please advise.
Hi,
I am trying to use Telerik RadMap (OpenStreet Map) in offline mode(i.e without internet acess).For this purpose I am using Easy Openstreet Map downloader.So
I have some below queries.
1) Can we get whole world map as image tiles upto street level zooming by this downloader and integrate the same with radmap or there is some better approach to use offline map(upto street level zooming is a must) ?
2) How can we search a location by name on radmap (offline mode)[on open street map provider] ?
3) How to add a place i.e if we want to name a place not marked or already marked on radmap(openstreet map) and it will be permanently stored on the map tiles?
I have a requirement for displaying multiple charts side by side and share a common axis. Do you have any hints how I can implement this? I know I can display multiple series within a same chart. But in my case, the series should be laid out side by side, I think I should use multiple charts but somehow tie them to a common axis.
I attached a mock image to illustrate this problem.
Hi,
I need to catch the preview of ActivePaneChanged event so I can check if the changes was saved etc and to prevent ActivePaneChanged if the user cancel the navigation.
How can I do that?
Thanks
RadWindow.Alert("aaaa");Hi,
I have an advanced MVVM scenario with a GridView hosting an ObservableCollection via ItemsSource. The grid has some complicated editing scenarios, and in one case, I need to replace an object in my collection (due to a conversion where the underlying object needs to be converted to a different type). After the underlying object is replaced, the grid is updated as expected. The problem is that I want to preserve focus on the cell that was being edited, so the user can keep typing to continue editing.
This seems to work fine if it's the first row being edited. I have tried hooking into the RowEditEnded event and using grid.ScrollIntoViewAsync() or cell.Focus() without any success.
Please can someone provide any advice?
Thanks!
Hello,
I get StackOverflowException when I try to insert fragment to document and call InsertFragment function from RadRichTextBox. The error is not stable, sometimes everything works.
I attach a file with my list (please, rename it in .txt).
Can you help me? What's wrong with that?
Thanks in advance.
