Telerik Forums
UI for WPF Forum
2 answers
416 views
I'm having trouble showing the actual number of items in my grid. When the application loads there are no items. The grid is bound to an ObservableCollection. When the user selects a query option from a list, the ViewModel clears the OC and adds the result items from the chosen query. This is done via background worker, then the results are cast to an IList and added to the collection via the OC.Add method.

What I want to do is show the user how many items are in the grid at any given time. It's working to some extent. As long as I don't change the initial query, it works. I have a textblock binding to the GridView's Items.ItemCount property.

The problem comes when I filter the results, then try to do a different query. The GridView's ItemCount isn't updating appropriately. Sometimes it shows 0 when there are clearly 3 items in the grid. If I clear the filters or change the filters for that query, the number gets reset and from them on it works properly, until I change the query.

For example, one query returns all records. There are 73. If I filter the grid on a status column to show all closed, it tells me there are 19. If I then try to run a different query, this one shows 3 items in the grid (because there are 3 items with closed status). The grid keeps the filtering and applies it to the new results. But the count shows 0. If I then change back to the original all records query, the count shows 1 even though the original 19 filtered records are once again shown in the grid.

So how do I get the correct count no matter how the grid is populated or filtered? I can't bind to the count of the bound collection, because if the user filters the grid, I want to show the filtered total. Basically (the total items that are displayed or visible).
Rayne
Top achievements
Rank 1
 answered on 28 Sep 2011
1 answer
810 views
Is there a way to modify the disabled buttons style? When the buttons in our application are disabled, they turn light gray with gray text and we need to change the style so that it is more legible for users.
Regards,
Strasz
Tina Stancheva
Telerik team
 answered on 28 Sep 2011
2 answers
155 views
Hi, 

We have implemented searching mechanism for RadGridView. It works fine when all the columns in Grid are of String type. 
But in one of the grid I have Int columns.

I figured out the problem. Currently my FilterOperator is "FilterOperator.Contains" and then it throws error "The method or operation is not implemented." for int column. If I changed FilterOperator to IsEqualTo it works great. But why can't I have FilterOperator.Contains for Int as well? I wish if it could do that.

Regards
Sanket
christine
Top achievements
Rank 1
 answered on 28 Sep 2011
2 answers
146 views
Hi all,

This is probably a very simple WPF binding question (it strikes me that it ought to be!) but I can't find an answer to it so am asking here.

I have a RadDataGrid bound to a collection of business objects (projects, to be specific).
Each project has a lead contact and a customer.
I am displaying customers in a GridViewComboBoxColumn, and contacts in another combo box column.

Currently, I'm data binding Customer combobox to a collection of customers, and the Contacts one to a collection of Contacts, like this:

<telerik:GridViewComboBoxColumn DataMemberBinding="{Binding CustomerId}" UniqueName="Customer" Header="Customer" DisplayMemberPath="CustomerName" SelectedValueMemberPath="CustomerId"></telerik:GridViewComboBoxColumn>

and in the code behind:

((GridViewComboBoxColumn)radarGridView.Columns["Customer"]).ItemsSource = customers.Values;

it's working, in that the lead contact and customer for that project are displayed in the grid - but the dropdown list for Contacts contains *all* contacts and I really want to display only Contacts which belong to the selected customer.


I know I could do this by overriding a databinding event on each row and binding the contacts column to a filtered list of contacts, but I would have to do that for every column which relates to another and I can't believe there isn't an easier way.

i.e. in effect I would like to bind the contacts combobox to something along the lines of (yes, I know this isn't valid C# :):

contacts.Where(c => c.CustomerId == <currently selected customer ID>)


What am I missing?

Kev
Kevin
Top achievements
Rank 1
 answered on 28 Sep 2011
1 answer
45 views
While coding the Backstage, the default selected tab and blank grid stay in view. Is there a way to pin-up the Backstage screen so I can see my changes dynamically as I code? I tried selecting 'Is Backstage Open' and nothing changes.
Thanks
Petar Mladenov
Telerik team
 answered on 28 Sep 2011
0 answers
78 views
{
    ...
    grid.RowIsExpandedChanged += new EventHandler<RowEventArgs>(grid_RowIsExpandedChanged);
}
 
 
void grid_RowIsExpandedChanged(object sender, RowEventArgs e)
{
    RadGridView cur = sender as RadGridView;
    IList<RadGridView> subgridlist = cur.ChildrenOfType<RadGridView>();
    for (int i = 0; i < subgridlist.Count; i++)
    {
        ...
    }          
}

Using RadGridView I wanted to edit the child-elements when the hirarchy is expanded. In my case another RadGridView. The child element is not existant when the hirarchy is opened, but it's there when I close it again. So I assume the RowIsExpandedChanged Event fired before generating the controls. Is there a way for me to access the child elements when the hirarchy has been loaded, e.g. "RowIsExpandedLoaded"?
marc
Top achievements
Rank 1
 asked on 28 Sep 2011
1 answer
130 views
Hi,

I am using Self reference grid, in that

1. How to hide (Isvisible = false) for some columns in the child grid
2. How to make the column width of parent and child as same.

Thanks,
Ramasamy
Maya
Telerik team
 answered on 28 Sep 2011
2 answers
101 views
Hello,

I have a radchart that I wish to add x series to dynamically depending on what you check off in a checkbox list.

I have a RadChart declared like this:
<telerik:RadChart x:Name="radChart" telerik:StyleManager.Theme="Metro" SeriesMappings="{Binding ChartSeriesMapping}" >
            </telerik:RadChart>

My ChartSeriesMapping is declaredl like this:
private SeriesMappingCollection _chartSeriesMapping;
public SeriesMappingCollection ChartSeriesMapping
{
    get
    {
        return _chartSeriesMapping;
    }
    set
    {
        if (_chartSeriesMapping != value)
        {
            _chartSeriesMapping = value;
            this.OnPropertyChanged("ChartSeriesMapping");
        }
    }
}

I'm adding series like this:
SeriesMapping salesAmountMapping = new SeriesMapping();
salesAmountMapping.LegendLabel = p.StoreName;
 
salesAmountMapping.ItemsSource = report.ChartData;
salesAmountMapping.SeriesDefinition = new BarSeriesDefinition();
 
salesAmountMapping.ItemMappings.Add(new ItemMapping("XValue", DataPointMember.XValue));
salesAmountMapping.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));
 
report.ChartSeriesMapping.Add(salesAmountMapping);
Where ChartData is containing XValue and YValue public properties.

But the charts is always empty when I'm adding new series... How is this supposed to work? Also, how come legend Label is always set to Series 0, Series 1, etc?

Thanks in advance.
Yavor
Telerik team
 answered on 28 Sep 2011
1 answer
83 views
I use row detail in radgridview but encounter some tricky problem. Please use the code below, and click the + to show the detail row one by one, at least open one screen, then scroll the vertical scrollbar , or use mouse wheel, then if you are lucky, the sceen will tremble, unless you scroll again. To reproduce it maybe need some fortume, but i could reproduce it everytime. I am not sure if I make myself clear. How to solve this problem? Thanks.

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"   
        mc:Ignorable="d"
        Title="MainWindow" d:DesignHeight="1024" d:DesignWidth="1280" MinHeight="700" MaxHeight="1024" MaxWidth="1280" SnapsToDevicePixels="True">
    <Grid>       
        <telerik:RadGridView x:Name="radGridView" AutoGenerateColumns="False" IsReadOnly="True">            
            <telerik:RadGridView.Columns>
                <telerik:GridViewToggleRowDetailsColumn/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ID}" Header="" Width="600"/>
                <telerik:GridViewDataColumn DataMemberBinding="{Binding UserID}" TextAlignment="Center"  Header="CUSIP" Width="400" />
                <telerik:GridViewDataColumn DataMemberBinding="{Binding ClientID}" TextAlignment="Center" Header="PRCMnum" Width="400" />
            </telerik:RadGridView.Columns>
 
            <telerik:RadGridView.RowDetailsTemplate>
                <DataTemplate>                    
                    <Grid x:Name="rowDetails">
                        <StackPanel Orientation="Horizontal" Margin="200,5,0,5">
                            <Label Content="ID:" Margin="0,0,5,0"/>
                            <TextBox Text="{Binding ID}"  Width="80" />                                    
                            <Label Content="UserID:" Margin="10,0,5,0"/>
                            <TextBox Text="{Binding UserID}"  Width="80" />
                            <Label Content="ClientID:" Margin="10,0,5,0"/>
                            <TextBox Text="{Binding ClientID}" Width="80" />                                    
                        </StackPanel>                        
                    </Grid>                       
                </DataTemplate>
            </telerik:RadGridView.RowDetailsTemplate>
        </telerik:RadGridView>        
    </Grid>
</Window>

using System;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Documents;
using System.Collections.ObjectModel;
 
namespace WpfApplication1
{   
    public partial class MainWindow : Window
    {
        
        public MainWindow()
        {
            InitializeComponent();          
           
            this.radGridView.ItemsSource = new ObservableCollection<AgencySpecPool>(GetSpecPoolInfoHierarchy());    
        }
 
        List<AgencySpecPool> GetSpecPoolInfoHierarchy()
        {
            List<AgencySpecPool> list = new List<AgencySpecPool>();
            for (int i = 0; i < 1000; i++)
            {
                int seed = (int)DateTime.Now.Ticks + i;
                Random rand = new Random(seed);
                list.Add(new AgencySpecPool(rand.Next(), rand.Next(), rand.Next()));
            }
            return list;
        }
    }
 
    public class AgencySpecPool
    {        
        public int ID {get;set;}
        public int UserID { getset; }
        public int ClientID { getset; }
        public AgencySpecPool(int id, int uid, int cid)
        {
            ID = id;
            UserID = uid;
            ClientID = cid;
        }
    }
}
Yordanka
Telerik team
 answered on 28 Sep 2011
1 answer
108 views
Hi,

I have a RadTabControl on my WPF form with multiple tabs (9). If I click on the "WindowState=Normal" button to shrink my form, some tabs become not visible due to the display space but the scroll buttons of my RadTabControl doesn't appear. I have to resize my form manually to get the RadTablControl scroll buttons visible.

I use VS2008 and Telerik v.2011.2.712.35

Thank's
Petar Mladenov
Telerik team
 answered on 28 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?