Telerik Forums
UI for WPF Forum
6 answers
411 views
Hi everybody,

I'm struggling for hours using the aggregate functions in my datagrid.
I'm using Telerik RadControls WPF Q2 2012 SP1.

Here is the code:

Xaml:
<Telerik:RadGridView x:Name="uxGratuitiesDataGrid"
                                     Margin="-11,-11,-11,0"
                                     Grid.Row="0"
                                     IsReadOnly="True"
                                     CanUserSortColumns="True"
                                     CanUserFreezeColumns="False"
                                     CanUserReorderColumns="False"
                                     AutoExpandGroups="False"
                                     ColumnWidth="*"
                                     AutoGenerateColumns="False"
                                     RowIndicatorVisibility="Collapsed"
                                     ShowGroupPanel="False"
                                     ShowColumnFooters="True"
                                     IsFilteringAllowed="False"
                                     ItemsSource="{Binding SelectedGroupBooking.DailyBreakDown, Source={StaticResource Presenter}}">
                    <Telerik:RadGridView.Columns>
 
                        <!-- Gratuity amount -->
                        <Telerik:GridViewDataColumn
                            DataMemberBinding="{Binding Gratuity.BaseAmount, Converter={StaticResource AmountConverter}, UpdateSourceTrigger=PropertyChanged}"
                                                    Header="Base Amount">
                        </Telerik:GridViewDataColumn>
                        <!-- Total Gratuity amount -->
                        <Telerik:GridViewDataColumn DataMemberBinding="{Binding Gratuity.TotalAmount, Converter={StaticResource AmountConverter}}"
                                                    Header="Total Amount">
                            <Telerik:GridViewDataColumn.AggregateFunctions>
                                <Telerik:SumFunction SourceField="Gratuity.TotalAmount"/>
                            </Telerik:GridViewDataColumn.AggregateFunctions>
                        </Telerik:GridViewDataColumn>
 
                    </Telerik:RadGridView.Columns>


My collection is a set of objects defined as this:

public ObservableCollection<VomRoomStayBreakDown> DailyBreakDown
        {
            get { return _dailyBreakDown; }
            set { _dailyBreakDown = value; OnPropertyChanged("DailyBreakDown"); }
        }

and the VomRoomStayBreakDown contains this:


        public VomGratuity Gratuity
        {
            get { return _gratuity; }
            set { _gratuity = value; OnPropertyChanged("Gratuity"); }
        }

Which itself contains this:


        
public FldInteger Quantity
        {
            get { return _quantity; }
            set { _quantity = value; OnPropertyChanged("Quantity"); }
        }
 
 
        public VomAmount BaseAmount
        {
            get { return _baseAmount; }
            set { _baseAmount = value; OnPropertyChanged("BaseAmount"); }
        }
 
        public VomAmount TotalAmount
        {
            get { return _totalAmount; }
            set { _totalAmount = value; OnPropertyChanged("TotalAmount"); }
        }


Amount is composed of a decimal (Value) and a currency (Currency).

I am trying to Sum the decimal values from my VomAmounts (correctly displayed in the columns), but it always lead to the exception. 
"No generic method 'Sum' on type 'System.Linq.Enumerable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic."

Can somebody tells me what I am doing wrong over there ?

Thanks a lot !
Julien
Top achievements
Rank 1
 answered on 08 Aug 2012
3 answers
123 views
Can the transition control be used in an MDI type scenario?

We have an application with multiple views, but each of them should only be showed inside the main view.

Is this advisable or is it a bad idea?

Thanks,
Jacques
Yana
Telerik team
 answered on 08 Aug 2012
2 answers
225 views
Hello,

First I would like to say that I'm very impressed with level of customization you allow and the easy to understand and quite comprehensive online documentation.

I don't know whether to post this question under 'Chart' or 'ChartView' yet I attend to use the one that will resolve my current issue.

Platform
I'm developing for a touch environment (wpf pixelsense sdk 2).  

My goal
When a user touches anywhere on a graph (stacked area series) - show him information about the data point he touched.

In a technical aspect:
1. Use touch down/click/manipulation events to recieve a data point 
2. Alternative solution - to be able to get the item (data point) in a given position. This way I will be able to trap touch events manually.

Limitations
I cannot use any mouse events, only touch events.

What I've tried:

experiment  1

1. Add 'ChartTrackBallBehavior' to my chart
2. Register to 'TrackInfoUpdated' event
3. Use 'e.Context.ClosestDataPoint' to get data point of current position

Result
Since I'm using touch device I need this event to be triggered when touching (touchdown event) but it doesn't. 
I saw a possible workaround but it seems to be relevant only to wp8 controls and not to wpf (link)

experiment 2
1. Register to 'radChart.DefaultView.ChartArea.ItemClick' event.
2 Use the event arguments which include information on the clicked item.

void ChartArea_ItemClick(object sender, ChartItemClickEventArgs e)
{
      // Here I can use e.DataPoint or e.ItemIndex
}

Result
It works only if I uses the mouse, when using touch the event is never beng promoted (might be because the chart is hosted inside scatterviewitem) . I have tried to bypass this issue without success.

Any workaround exists on current version will be much helpful.

Sincerely,
Guy
Giuseppe
Telerik team
 answered on 08 Aug 2012
2 answers
218 views
Hi, i need to print the RadMap on a Paper with format A0 (big dimension), it's possibile ?
Actually for print the map use the code on the post:http://www.telerik.com/community/forums/wpf/map/print-copy.aspx
it's work but the dimension of the map is the dimension on the screen resolution.

Thanks
Aurelio
Aurelio Righetti
Top achievements
Rank 1
 answered on 08 Aug 2012
2 answers
252 views
Hello, I am new with Telerik controls, but it's making my applications looks much better.
But I have a problem, My application has a RadTabControl with 4 RadTabItem, and the RadTabItems contains a grid with a RadGridView with an ItemsSource, this is the one that is wrong:

<telerik:RadTabItem Name="StatusTab" Header="Status Summary" IsSelected="True" MouseUp="StatusTab_MouseUp">
                <Grid>
                    <telerik:RadGridView Margin="47.773,61.105,0,0" Name="gridStatus" AutoGenerateColumns="False" ColumnWidth="Auto" telerik:StyleManager.Theme="Vista" CanUserDeleteRows="False" CanUserInsertRows="False" ActionOnLostFocus="None" Height="Auto" VerticalAlignment="Top" Width="Auto" HorizontalAlignment="Left">
                        <telerik:RadGridView.Columns>
                            <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Key}" Width="auto"/>
                            <telerik:GridViewDataColumn Header="Description" DataMemberBinding="{Binding Value.Description}"  Width="auto" />
                            <telerik:GridViewDataColumn Header="State" DataMemberBinding="{Binding Value.State}"  Width="auto"/>
                         </telerik:RadGridView.Columns>
                    </telerik:RadGridView>
                </Grid>
            </telerik:RadTabItem>

I have ser my RadGridView "gridStatus" Height, Width and ColumnWidth to Auto, but in runtime I get an extra column and the content does not fit the width of the RadGridView ( I attach a screen print)

I have tried to set Height and Width in Page1.xaml.cs but I can´t set it to Auto, because the value has to be a double.

But the weirdest thing is that I have another RadGridView that works fine, I copied the code from this to the other, and removed a column that I didn't need, and it was the same, the properties are set to Auto, but I have an "extra column".

Hope you can help me because I have no idea of what to to.
Thanks!
Rocio
Top achievements
Rank 1
 answered on 08 Aug 2012
5 answers
108 views
Hi,

I am trying to add a new row to RadGridView. I can add new row, BUT It doesn't allow me to enter more than 4letters in the new row. Could you check this and let me know what went wrong?

Attached screenshot.

Thank you,
-Prathibha
Pavel Pavlov
Telerik team
 answered on 08 Aug 2012
0 answers
81 views
Hi,
In application we are using the Grid where one of the column has "DateTime" data type.
I am using RadDataFilter to filter the column values, for this particular column when data filter comes up it comes with the DateTimePicker.
Inside this DateTimePicker if user types "Today" it converts the string into Today's DateTime
I want to stop this behavior so that if user types "Today" it will consider it as a string and
should not convert into corresponding DateTime value.
How can i achieve this?
Yogesh
Top achievements
Rank 1
 asked on 08 Aug 2012
3 answers
308 views
Hi all,

I am following the example given in WPF demo -> Controls -> Visualization -> Chart -> Performance -> Live Data, in particular, I am looking at this line of code: 
private void OnTimerTick(object sender, EventArgs e)
{
    this.nowTime = this.nowTime.AddMilliseconds(500);
    this.UpdateData(this.nowTime);
    this.SetUpAxisXRange(this.nowTime);
 
    this.Data = null;
    this.Data = this.cpuData;
}

In my data set, I am updating over 20 line series every second, and resetting the view data with this.Data = null and this.Data = this.cpuData seems to be incredibly slow. Is there a better way to update the chart with live data?

Thanks,
Jin
Rosko
Telerik team
 answered on 08 Aug 2012
3 answers
231 views
Hello,
I tried to use RadColorPicker ContentTemplate property (example in Telerik manuals). But I get exception:
The attachable propert 'ContentTemplate' was not found in type 'RadColorPicker'.


What happened?

version: RadControls for WPF Q1 2012 SP1
Petar Mladenov
Telerik team
 answered on 08 Aug 2012
1 answer
141 views
I'm exporting my radgrid to Excel, that part is working great.  What I'm having trouble with is one of the columns in the gridview is a listbox, so in my export, I want to export the list.  I do have that working correctly, I'm getting all items in the list.  Where I'm stuck is I want each item in the list to be on a different line in the Excel cell, so when it exports and I open Excel I want to see

Item A
Item B
Item C

what I currently get is Item A Item B Item C

Below is my code, is there something obvious I'm missing to accomplish this?

if

 

 

(e.Element == ExportElement.Cell)

 

{

 

 

if (e.Value is SurveyDetail)

 

{

 

 

SurveyDetail surveyDetail = (SurveyDetail)e.Value;

 

 

 

if (e.Context is Telerik.Windows.Controls.GridViewDataColumn)

 

{

Telerik.Windows.Controls.

 

GridViewDataColumn dc = (Telerik.Windows.Controls.GridViewDataColumn)e.Context;

 

 

 

if (dc.Name == "dcCPUJobCode")

 

{

 

 

StringBuilder sb = new StringBuilder();

 

 

 

foreach (CPUJobCode cpuJobCode in surveyDetail.SurveyJobCode.CPUJobCodes)

 

{

sb.Append(

 

string.Format("{0} {1} \n", cpuJobCode.JobCode, cpuJobCode.JobTitle));

 

}

e.Value = sb.ToString();

}

}

}

}

Vlad
Telerik team
 answered on 08 Aug 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?