Telerik Forums
UI for WPF Forum
10 answers
1.2K+ views

Hi,

I’m trying to use a data grid view to bind to a data table where each cell holds an object of a known type.  I would like to bind the grid cells’ values to a particular property of these objects and bind colours and other attributes to other properties.

For example, each cell might have the following as its value:

interface ICellObject

{

                object Value {get;set;}

                bool IsDirty {get;set;}

}

When someone edits a cell, I would like it to store the value in the Value property.  The cell colour would be bound to an expression using the IsDirty property.  The actual ICellObject reference would never be changed. Would this be possible, and how would I do it?

Thanks,

Kyle

Dimitrina
Telerik team
 answered on 24 Apr 2015
1 answer
135 views

Hi

I found many examples of custom aggregates and I'm able to do aggregate function with those helps for specific class with specific property which is used in my grid. But now I have few situations that I want to get count of checked (in class type boolean with value true) from that column. I would like to get it done in one function so I don't need to do several almost same kind code (only class and property changed).

So how I have to change this function to get it work universally (without class 'DeliveriesForAccountsCls' and property name 'isChecked')?

 

public class CheckedDeliveriesCount : AggregateFunction<DeliveriesForAccountsCls, double>
{
    public CheckedDeliveriesCount ()
    {
        this.AggregationExpression = items => Summary(items);
    }
 
    private double Summary(IEnumerable<DeliveriesForAccountsCls> source)
    {
        var itemCount = source.Count();
        if (itemCount > 1)
        {
            var values = source.Where(x => x.isChecked);
            var sum = values.Count();
            return sum;
        }
 
        return 0;
    }
}

 

 

Regards

Harri

 

Dimitrina
Telerik team
 answered on 24 Apr 2015
7 answers
1.2K+ views
Hi,

Can someone tell me why I keep getting the following error when I try to set a CellStyle on a GridViewDataColumn in a RadGridView control?

Error: A value of type 'GridViewDataColumn' cannot be added to a collection or dictionary of type 'GridViewColumnCollection'.

Here is the xaml:

    <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name">
     <telerik:GridViewDataColumn.CellStyle>
           <Style BasedOn="{StaticResource ReadOnlyStyle}" TargetType="{x:Type telerik:GridViewCell}" />
     </telerik:GridViewDataColumn.CellStyle>
    </telerik:GridViewDataColumn>

All I am trying to do is create a style - ReadOnlyStyle - that would set the foreground color of a grid column to a gray color when the style is set. Here is the style:

    <!--  GridView: Read Only Style  -->
    <Style x:Key="ReadOnlyStyle" TargetType="telerik:GridViewCell">
        <Setter Property="Foreground" Value="{DynamicResource ForegroundReadOnlyColor}" />
        <Setter Property="IsHitTestVisible" Value="False" />
    </Style>

Thanks!
Vanya Pavlova
Telerik team
 answered on 24 Apr 2015
1 answer
596 views

Hi,

 I'm trying to use very small decimal numbers for the Minimum and Maximum Values for the Range Slider however it doesn't show the labels for the ticks.

Am I doing something wrong or is it a limitation for the Minimum and Maximum values?

Example:

Minimum = -1.5080401719063519

Maximum = 1.2150488669618964

Tick = ((Maximum - Minimum) / 5) = 0.54461780777364965

Kiril Vandov
Telerik team
 answered on 24 Apr 2015
4 answers
120 views
Hello! I have a problem in a real-time display consistently huge stream of data (transactions on the Stock Exchange), which is formed in a different thread. Help me with the example so as not to suffer performance visualization. The data comes continuously and in very large quantities.
Maya
Telerik team
 answered on 23 Apr 2015
2 answers
778 views

I am using WPF tab control and each tab item has a user control, Some of the user controls have lot of UI elements and there are lot bindings, because by default tab control load/unload each tab item when you switch tabs it is very slow, I mean there is a delay of few seconds between user clicking on a tab and tab is completely rendered.

I am planning to give RadTabcontrol a try and use iscontent preserved proerty, but before i do that i wanted to find out what are the pros/cons of using iscontent preserved, according to your documentation "For performance optimization the ControlTemplate of the RadTabControl defines a single ContentPresenter which holds only the currently selected RadTabItem's Content. "

If i use content preserved will it also prevent call to the constructor of each user control and call to loaded/unloaded event of user control when you switch tabs. 

 

Thanks

Vikas

Vikas
Top achievements
Rank 1
 answered on 23 Apr 2015
1 answer
207 views

Hi,

 We're building MVVM/Caliburn based application. We are placing Views inside content control, alowing user to navigate to other child VM, and going back to parent.

The problem is that when we use TreeListView - it works correctly untill we won't go back to parent VM - which causes a view to be attached in place of other one. TLV Items are not rendered - control stays empty (border is there, column headers also). Silly thing is if I replace TLV with other control - event listbox it works - I can see all items bound to VM.

Only TLV is ignoring reattaching to view - all other controls are shown properly. Also VM's property is being accessed and returns proper list of items - so binding is probably working, but still items are not displayed.

 

Whan could cause such behaviour?

 

Dimitrina
Telerik team
 answered on 23 Apr 2015
1 answer
173 views
I am using the GridViewSelectColumn to select rows.  When I have rows grouped I want it to only select rows with are visible (that is, whose groups are expanded) but it selects every row in the grid.  How do I do this?
Dimitrina
Telerik team
 answered on 23 Apr 2015
1 answer
62 views

Hi,

 

I actually use the version 2015.1.225.45 of Telerik and I would like to know if it's possible to have a drawing tool with the control?

 

Thank's

Alain

Tanya
Telerik team
 answered on 23 Apr 2015
4 answers
177 views

We have a grid where we have enabled custom sorting and have hooked into the OnGridSorting event. This is getting called when someone clicking on a column header to sort it, as expected. However, the grid's SortDescriptors collection is null.

 I would like to be able to add a SortDescriptor for the column that is being sorted that uses an expression, if it's a particular type of data. However, the collection is empty, which suggests there is a problem.

 Thanks.

Max

 

Stefan
Telerik team
 answered on 23 Apr 2015
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?