Telerik Forums
UI for WPF Forum
3 answers
83 views

I have a problem using InformationLayer.GetItemsInLocation(Location);

My InformationLayer is binded to an ObservableCollection<MyClass> myObjektCollection

<Map:InformationLayer Name="myObjektLayer" ItemsSource="{Binding myObjektCollection }" ItemTemplate="{StaticResource informationLayerFlyttObjektTemplate}" Visibility="Visible" />

While adding MyClass items to myObjektCollection , I can see that both InformationLayer(myObjektLayer) and myObjektCollection increases.

If I ,just after adding a new MyClass item to myObjektCollection, try to call

InformationLayer(myObjektLayer).GetItemsInLocation(myLocation); returns no items found.

If I later, after refreshing the map call the same method InformationLayer(myObjektLayer).GetItemsInLocation(myLocation); returns with expected items.

I know that myLocation is valid.

Ex.

myObjektItemCollection.Add(myClass);

InformationLayer(myObjektLayer).GetItemsInLocation(myLocation) -  No result

In method MapMoved()

InformationLayer(myObjektLayer).GetItemsInLocation(myLocation) -  OK result

Is there any method I should call on InformationLayer or Observablecollection before I call InformationLayer(myObjektLayer).GetItemsInLocation(myLocation)?

I tried:

InformationLayer(myObjektLayer).BeginInit();

myObjektItemCollection.Add(myClass);

InformationLayer(myObjektLayer).EndInit();

InformationLayer(myObjektLayer).GetItemsInLocation(myLocation)? No result

Andrey
Telerik team
 answered on 30 Sep 2011
2 answers
360 views
Hello,

Our team is trying to use the Export functionality of the RadGridView, which works as expected, but include a Header and Footer in the resulting ExcelML output.  We are currently using version 2010.2.924.35.  Is there currently a way to add a Header and Footer to an excel file being exported from the RadGridView?

By hooking into the ElementExporting and ElementExported events, I see how we could format the data, or add details to the existing data, but I'm not seeing a way to include a Header or Footer for the entire output.

The data for both the Header and Footer reside in our ViewModel, along with the data source for the RadGridView, but is not currently connected to the RadGridView.

Desired Result:

[Header]
<HeaderRow><HeaderCell/<HeaderCell/><HeaderCell/><.../></HeaderRow>
<Row><Cell/><Cell/><Cell/><.../></Row>
<.../>
[Footer]

Edit:  Just to clarify.  Our goal is an overall file header and footer, NOT column headers or footers.  Something like:
Header--"Report Generated on April 17, 2010"
Body--Grid Export
Footer--"Values are rounded to the nearest dollar"
Charles Jarvis
Top achievements
Rank 1
 answered on 30 Sep 2011
1 answer
76 views
Hello Everyone,

What I am looking for is a way to have the legend sidebar have scrolling. Is this possible with the RadChart?

Thanks,
Chris
Evgenia
Telerik team
 answered on 30 Sep 2011
2 answers
127 views
Hi, I need to set my own text to the current cell.  I tried with this instruction:

RadGridView1.CurrentCell.Value = "sometext";

But the cell remains empty.  Thanks in advance
Maya
Telerik team
 answered on 30 Sep 2011
2 answers
127 views
Hi,

I have several controls in my app that uses grid. Grid is being used on all of them in the same way:
        <telerik:RadGridView x:Name="RadGridView1" ItemsSource="{Binding Items}" Margin="0"
                             RowIndicatorVisibility="Collapsed" IsReadOnly="True"                           
                             AutoGenerateColumns="False" CanUserFreezeColumns="False"
                             CanUserResizeColumns="True" MouseDoubleClick="RadGridView1_MouseDoubleClick" IsFilteringAllowed="True">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding BusinessItem.Name}" Width="*" />
...

however on some of those grids filtering and sorting is working properly, on some grids it is working only on bool columns and on some it is not working at all (I cannot see the 'tube' symbol for filtering and I cannot sort the column by clicking its header).

What may be wrong?
Rossen Hristov
Telerik team
 answered on 30 Sep 2011
3 answers
162 views
When binding a gridview to a datatable.defaultview and autogenerating columns, what is the best way to assign data formats to columns? In particular datetime columns to short format? All I can find in documentation is to use XAML DataFormatString of column, but I don't see the C# option to set this in the column objects.
Vlad
Telerik team
 answered on 30 Sep 2011
4 answers
106 views

Hi there,

I am currently evaluating your RadGridView and I must say that I'm quite surprised. Your RadGridView control is easy and straight forward to use compare to other bigger brands in the market. It's very unfortunate that I had wasted several weeks evaluating other grid controls.

I'm currently having a problem with MultipleSelect when it's set to True. Please have a look at the following sample,

XAML code:

<Window x:Class="WpfApplication1.Window1" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    Title="Window1" Height="412" Width="447" 
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" 
        xmlns:WpfApplication1="clr-namespace:WpfApplication1">  
    <Window.Resources> 
        <ObjectDataProvider x:Key="viewModel" ObjectType="{x:Type WpfApplication1:CustomerViewModel}" /> 
    </Window.Resources> 
    <Grid> 
        <telerik:RadGridView Name="uxdGrid" AutoGenerateColumns="False" 
                             ItemsSource="{Binding Source={StaticResource viewModel}, Path=CustomersList}">  
            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="Customer Id" UniqueName="CustomerId" /> 
            </telerik:RadGridView.Columns> 
        </telerik:RadGridView> 
    </Grid> 
</Window> 
 

Code behind:

using System.Collections.Generic;  
using System.ComponentModel;  
using System.Windows;  
using System.Windows.Data;  
 
namespace WpfApplication1  
{  
    /// <summary>  
    /// Interaction logic for Window1.xaml  
    /// </summary>  
    public partial class Window1 : Window  
    {  
        public Window1()  
        {  
            InitializeComponent();  
        }  
    }  
 
    public class CustomerViewModel  
    {  
        public CustomerViewModel()  
        {  
            List<Customer> customers = new List<Customer>();  
 
            for (int i = 0; i < 10; i++)  
            {  
                Customer customer = new Customer();  
                customer.CustomerId = i;  
                customer.CustomerName = string.Format("Name {0}", i);  
                customers.Add(customer);  
            }  
 
            _view = new ListCollectionView(customers);  
        }  
 
        private readonly ListCollectionView _view;  
 
        public ListCollectionView CustomersList  
        {  
            get 
            {  
                return _view;  
            }  
        }  
    }  
 
    public class Customer : INotifyPropertyChanged  
    {  
        private int _customerId;  
        private string _customerName = string.Empty;  
 
        public int CustomerId  
        {  
            get 
            {  
                return _customerId;  
            }  
            set 
            {  
                _customerId = value;  
                SendPropertyChanged("CustomerId");  
            }  
        }  
 
        public string CustomerName  
        {  
            get 
            {  
                return _customerName;  
            }  
            set 
            {  
                _customerName = value;  
                SendPropertyChanged("CustomerName");  
            }  
        }  
 
        private event PropertyChangedEventHandler _propertyChanged;  
 
        public event PropertyChangedEventHandler PropertyChanged  
        {  
            add  
            {  
                _propertyChanged += value;  
            }  
            remove  
            {  
                _propertyChanged -= value;  
            }  
        }  
 
        /// <summary>  
        /// Raises the property changed event.  
        /// </summary>  
        /// <param name="propertyName">The property name which value has been changed</param>  
        protected void SendPropertyChanged(string propertyName)  
        {  
            if (_propertyChanged != null)  
            {  
                _propertyChanged(thisnew PropertyChangedEventArgs(propertyName));  
            }  
        }  
    }  
}  
 

It works as it's expected. But if you set the property MultipleSelect="True",

    <Grid>    
        <telerik:RadGridView Name="uxdGrid" AutoGenerateColumns="False" MultipleSelect="True"   
                             ItemsSource="{Binding Source={StaticResource viewModel}, Path=CustomersList}">     
            <telerik:RadGridView.Columns>    
                <telerik:GridViewDataColumn Width="100" IsReadOnly="False" DataType="{x:Null}" HeaderText="Customer Id" UniqueName="CustomerId" />    
            </telerik:RadGridView.Columns>    
        </telerik:RadGridView>    
    </Grid>    
 

You will notice that the grid is showing the correct number of rows but unfortunately it's not showing any data. Is there anything that I miss here?

Regards,

Hardi
Vlad
Telerik team
 answered on 30 Sep 2011
2 answers
226 views
Hi,

I have this situation where my business object exposes a DateTime property
and I'm binding a GridViewDataColumn to that property using a custom IValueConverter
which "simplify" the date. It converts the datetime to a string, something like "today, 10:15" or
"September 1st, 9:45" (without the current year). The point is that the target value is now a string.

Then I set up a GroupMemberPath to point at "MyProperty.Date" in order to group by day.

I just realized that group headers get populated by accessing that special path and pushing the value
through whatever IValueConverter is specified in the DataMemberBinding.

The only problem is that I cannot set a different ConverterParameter, so the time portion
(which is included in the "simplified" output) gets printed as well (00:00 in all groups).

The point is: wouldn't it be better to have a "GroupMemberBinding" instead of "GroupMemberPath"?
So that if a different conversion is needed for the grouped data to make sense we can specifiy
a different converter and/or converterParameter?

Am I splitting a hair?  :-)

Thanks.

-Rodrigo-
Rodro
Top achievements
Rank 2
 answered on 30 Sep 2011
7 answers
793 views
I am using a RadGridView to display information about people.
The last column is for edit/delete buttons.
Whenever I set the last column's width to "*" (to fill the rest of the space), a horizontal scroll bar appears.
If I have 1 column in my grid, then the last column's width properly fills the remaining space and no horizontal scroll bar appears; however, the more columns that I add to the grid, the more you have to scroll to see the edit buttons (the worse the horizontal scroll bar becomes).

This is the markup for my GridView:

<telerik:RadGridView Name="PeopleGrid"
                     Width="{Binding ElementName=theRootElement, Path=ActualWidth}"
                     ItemsSource="{Binding Source={StaticResource people}, Path=People}"
                     IsReadOnly="True"
                     EditTriggers="None">
    <telerik:RadGridView.Columns>
        <telerik:GridViewToggleRowDetailsColumn ExpandMode="Single" />
        <telerik:GridViewDataColumn Header="First Name" DataMemberBinding="{Binding FirstName}" />
        <telerik:GridViewDataColumn Header="Last Name" DataMemberBinding="{Binding LastName}" />
        <telerik:GridViewDataColumn Header="Age" DataMemberBinding="{Binding Age}" />
        <telerik:GridViewDataColumn Header="Marital Status" DataMemberBinding="{Binding MaritalStatus}" />
        <telerik:GridViewDataColumn Width="*">
            <telerik:GridViewDataColumn.CellStyle>
                <Style TargetType="telerik:GridViewCell">
                    <Setter Property="Template">
                        <Setter.Value>
                            <ControlTemplate>
                                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                                    <Button x:Name="btn_EditPerson" ToolTip="Edit">
                                         Edit
                                    </Button>
                                    <Button ToolTip="Delete"
                                            Command="{Binding Source={StaticResource people}, Path=DeletePerson}"
                                            CommandParameter="{Binding .}">
                                              Delete
                                    </Button>
                                </StackPanel>
                            </ControlTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </telerik:GridViewDataColumn.CellStyle>
        </telerik:GridViewDataColumn>
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.RowDetailsTemplate>
        <DataTemplate>
            <!-- Additional Controls to Display Additional Info...has no affect on problem if I comment this part out -->
        </DataTemplate>
    </telerik:RadGridView.RowDetailsTemplate>
</telerik:RadGridView>


Thanks, in advanced, for your help!




newbie
Top achievements
Rank 1
 answered on 29 Sep 2011
13 answers
279 views
I am using the ScheduleView to allow the user to add and edit custom appointments.
These appointments are always recurring weekly.

Since the appointments are always recurring, I would like to always edit the series.
I'm not sure how to prevent the window that prompts the user to select whether edit the series or the individual appointment from opening...

I am looking for a way to always edit the series.

Thanks!
newbie
Top achievements
Rank 1
 answered on 29 Sep 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?