Telerik Forums
UI for WPF Forum
3 answers
98 views
Hi,
   I'm working in a Wpf application which requires the transparent header & body area. I tried using different themes available with the telerik control, i'm not able to achieve the desired result. If i set "Transparent" to the rowstyle, the default theme style comes up, but if i use any color it works fine. I have attached the sample of my required grid. Please help me to achieve the desired style. Also let me know how to disable or configure the mouseover effect for the Rows.


Thanks
Selva
Selva M
Top achievements
Rank 2
 answered on 24 Jan 2012
5 answers
557 views
Hi,

I have following markup for my RadGridView:

<telerik:RadGridView  
    ItemsSource="{Binding PagedSource, ElementName=radDataPager}"
    SelectedItem="{Binding Path=SelectedAccount, Mode=TwoWay}"
    IsBusy="{Binding IsSearchActive}"
    IsReadOnly="True"
    CanUserDeleteRows="False"
    CanUserInsertRows="False"
    ShowGroupPanel="False"
     
    AutoGenerateColumns="False">
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn DataMemberBinding="{Binding AccountNumber}" Header="Account #" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding FullName}" Header="Name" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding Email}" Header="Email" />
        <telerik:GridViewDataColumn DataMemberBinding="{Binding OrganizationName}" Header="Organization" />
    </telerik:RadGridView.Columns>
    <telerik:RadGridView.InputBindings>
        <MouseBinding Gesture="LeftDoubleClick" Command="{Binding DisplayViewCommand}" />
        <KeyBinding Key="Enter" Command="{Binding DisplayViewCommand}" />
    </telerik:RadGridView.InputBindings>
     
    <telerik:RadGridView.RowStyle>
        <Style>
             
        </Style>
    </telerik:RadGridView.RowStyle>
 
</telerik:RadGridView>

Now, when I hit "Enter" key the DisplayViewCommand is invoked in my ViewModel as expected.
But the DoubleClick doesn't work for some reason. (BTW: if I am double click on the Grid Header (the empty cell in top right corner) the command is triggered but of course I expect that current row double click should work also)


What I am doing wrong?


Vlad
Telerik team
 answered on 24 Jan 2012
1 answer
95 views
How co-ordinates of zoom rectangle can be captured for RadChart ?
Yavor
Telerik team
 answered on 24 Jan 2012
4 answers
154 views
Hi,
I have a little problem here with the WPF RibbonView-Control:
The SelectionChanged-Event is not raised, when a RibbonTab is selected.
The PreviewSelectionChanged-Event works as expected.

To be sure, that there are no side effects from my application, I made a simple
wpf app (VS2010, .NET Framework 4, Q2 2011) with a RadRibbonWindow, RadRibbonView,
two empty RibbonTabs and the SelectionChangedEvent. Same effect.

Any Idea, what I am doing wrong?

thanks, 
Thomas
Tina Stancheva
Telerik team
 answered on 24 Jan 2012
1 answer
144 views
Hi All,
I have a problem where I have gone mad about a solution in the last hours. I have a RadChart with two Y-axis and on the X-Axis I would like to see string labels instead of numbers, but I always see the numbers...
My XAML is the following:
<telerik:RadChart ItemsSource="{Binding Chart2Data}" x:Name="chart2" >
        <telerik:RadChart.SamplingSettings>
            <telerik:SamplingSettings SamplingThreshold="240" />
        </telerik:RadChart.SamplingSettings>
        <telerik:RadChart.SeriesMappings>
            <telerik:SeriesMapping LegendLabel="{x:Static p:Resources.Report_MaskingTrail}" >
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" ShowItemToolTips="False" />
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:SeriesMapping.ItemMappings>
                    <telerik:ItemMapping DataPointMember="YValue" FieldName="Y2" />
                    <telerik:ItemMapping FieldName="XLabel" DataPointMember="XCategory" />
                </telerik:SeriesMapping.ItemMappings>
            </telerik:SeriesMapping>
            <telerik:SeriesMapping LegendLabel="{x:Static p:Resources.Report_CoreLoudness}" >
                <telerik:SeriesMapping.SeriesDefinition>
                    <telerik:LineSeriesDefinition ShowItemLabels="False" ShowPointMarks="False" ShowItemToolTips="False" />
                </telerik:SeriesMapping.SeriesDefinition>
                <telerik:SeriesMapping.ItemMappings>
                    <telerik:ItemMapping DataPointMember="YValue" FieldName="Y1" />
                    <telerik:ItemMapping FieldName="XLabel" DataPointMember="XCategory"  />
                </telerik:SeriesMapping.ItemMappings>
            </telerik:SeriesMapping>
        </telerik:RadChart.SeriesMappings>
        <telerik:RadChart.DefaultView>
            <telerik:ChartDefaultView >
                <telerik:ChartDefaultView.ChartArea>
                    <telerik:ChartArea LegendName="legendLive"
                                       NoDataString="{x:Static p:Resources.NoMeasurementData}"
                                       EnableAnimations="False">
                        <telerik:ChartArea.AxisX>
                            <telerik:AxisX AutoRange="true" LabelRotationAngle="270"  />
                        </telerik:ChartArea.AxisX>
                        <telerik:ChartArea.AxisY>
                            <telerik:AxisY AutoRange="{Binding Path=Configuration.Chart2ManualConfiguration1, Converter={StaticResource inverseBooleanConverter}}"
                                MinValue="{Binding Path=Configuration.Chart2Minimum1}"
                                MaxValue="{Binding Path=Configuration.Chart2Maximum1}"
                                Step="{Binding Path=Configuration.Chart2YStep1}"
                                           Title="{x:Static p:Resources.Chart2_Series_Title}">
                                <telerik:AxisY.AxisStyles>
                                    <telerik:AxisStyles AxisLineStyle="{StaticResource AxisLineStyle}"
                                                        TickLineStyle="{StaticResource MajorTickLineStyle}"
                                                        MinorTickLineStyle="{StaticResource MinorTickLineStyle}"
                                                        ItemLabelStyle="{StaticResource CustomLabel}" />
                                </telerik:AxisY.AxisStyles>
                            </telerik:AxisY>
                        </telerik:ChartArea.AxisY>
                    </telerik:ChartArea>
                </telerik:ChartDefaultView.ChartArea>
                <telerik:ChartDefaultView.ChartLegend>
                    <telerik:ChartLegend x:Name="legendLive"
                                         Header="{x:Static p:Resources.ChartLegend}"
                                         LegendItemStyle="{StaticResource CustomLegendItem}"
                                         Visibility="Collapsed"
                                         />
                </telerik:ChartDefaultView.ChartLegend>
            </telerik:ChartDefaultView>
        </telerik:RadChart.DefaultView>
    </telerik:RadChart>

The data class has four properties:

X => The counter of the value, not bound the the chart
XLabel => a string which should be visible in the X-Axis
Y1, Y2 => The values for the two Y-axis.

Can someone explain to me what I am doing wrong?

Thanks,
Chris
Yavor
Telerik team
 answered on 24 Jan 2012
0 answers
77 views
Dear experts!
I'm creating a persistent data streaming utility.
How it works:

  1. some remote server constanly adds a new records to the database table
  2. my app has a UI control to display few thousands of latest records - RadGridView

For 2. I use DispatcherTimer which asks for a new portion of data every second.
When new data comes, I simply rewrite old cell values.
So my datagrid has a constant number of rows - if I'll ask for 100000 latest rows in SQL query, I'll get 100000 rows in gridview.
I'm trying to be very careful with performance and to create as less new objects as it possible.
Maybe, my approach is far from optimal - I'll be happy to know better one.

So, my question is:

How to highlight new rows, added in a latest RadGridView ItemsSource change, with a best performance?

Here is a small quick demo project that illustrates my project in general.

(To run it you need SQL Server CE 3.5+)

Will be glad to get any help! :)

Regards,
Mykola
Mykola
Top achievements
Rank 1
 asked on 24 Jan 2012
2 answers
229 views
Hi all,

This is a somewhat exploratory question as to how I could go about implementing a behaviour that I have been requested to implement. Apologies for my hyper-verbosity below :-).

The short version:
How do I stop a filter being applied when the value in a cell changes to no longer match the filter?

The requested behaviour:
(For some context) - I am currently implementing a mechanism whereby a user can right click on an editable column in the datagrid and choose to apply the current value to all currently visible (given the filter conditions of the grid) cells of the same column via a context menu. I have managed to get this feature working (at least in an initial version) and am reasonably confident that I will be able to develop it into the foundation of my project. 

< ... breathes in  ... >

The issue I am having relates to the effect of applying a filter to the same column that I am editing, and as such is not directly related to the above functionality. When a filter is applied to a column, editing a value to one which no longer matches the filter specified causes the row of the grid to be hidden when the user looses focus from the cell. While this logically makes sense to me as a developer in that the filter descriptors and the displayed data remain consistent. To the user, it appears that the data they were just editing has just disappeared (maybe forever). The ensuing panicked call to the support desk is one thing that I am trying to avoid. Also the ability to change one of the values, then apply that value to all other visible cells of the same column (as mentioned above) without this action causing said rows to be removed from the list of visible rows.

This behaviour can be seen in something like Excel 2010, where a filter can be applied to one or more columns, however the filter is not updated when the values in the columns change, unless the user specifically re-applies said filter.

Considered Approaches:
Here are a couple of approaches that I have already considered:
  1. Prevent Filtering on affected columns: Possibly the easiest solution to this issue would be to prevent (disable) filtering on columns where the value can be set via a context menu option. However, the ability to filter these columns is a desirable feature of the application, I would rather not remove the functionality unless it is necessary.
  2. Disable the context menu if a filter is applied: This would be a bit better than the last option, in that it would allow both features, just not at the same time. The problem here is how to inform the user (in an unobtrusive manner) that the ability to set the value is disabled because they have applied some sort of filter to this column and that removing that filter will allow them to perform the update that they want to. The catch here is that the filter they applied will be restricting the results to those that they want to update, removing it will likely change that result set ... catch 22.
  3. Automatically include the updated value in the filter descriptors for that column: This is my current best candidate although it has some limitations. This option would ensure that the new value would not cause the column to be removed from the set of visible columns. However, including another value in the filter could have unforeseen consequences (for example if 90% of the rows had the value of "2" and the filter was set to include only items which are NOT equal to "2". Setting the remaining values to "2" would result in an invalid filter (all values = "2" AND != "2" ... none). That is a fairly simple example, but they could be infinitely more complicated). Alternatively, even if the resulting filter was valid, it could result in the inclusion of the other 90% of the data, resulting in the row that you were editing being lost in the sea of data and the user being "surprised" by the sudden unexpected flood of information (and we all know there is nothing more dangerous than a surprised user).
  4. Prevent the modification of a value from having the current filter applied: This approach most closely emulates Excel 2010. However I have a few issues with it. How would the user know that the results shown in the grid no longer match the specified filters? (Could be done by changing the filter icon, but that is blowing the scope of this change out a bit). Secondly, how would someone go about doing this? I have been thinking about how to achieve this for a couple of days with no joy.

Any suggestions or comments, particularly on how to implement point 4 (above) would be greatly appreciated.

Regards,
    Mark
 
Ben
Top achievements
Rank 1
 answered on 24 Jan 2012
0 answers
166 views
For the same viewmodel, RadComboBox does not fire the command, whereas the WPF Combobox fires the command. Here is the xaml for both in the same view.

For the below xaml, the action part of the command is NEVER executed in the itemviewmodel. 
<telerik:RadComboBox x:Name="myNewComboBox1"
                                 Height="30"
                                 Width="150"
                                 Margin="10,20"
                                 ItemsSource="{Binding Path=DateRanges}"
                                 SelectedItem="{Binding Path=SelectedValue, Mode=TwoWay}">
                <telerik:RadComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock>
                            <Hyperlink Command="{Binding Path=HyperLinkCommand}">
                                <Run Text="{Binding Path=Text}" />
                            </Hyperlink>
                        </TextBlock>
                    </DataTemplate>
                </telerik:RadComboBox.ItemTemplate>
  </telerik:RadComboBox>

Commands fires in this case.
<ComboBox x:Name="myNewComboBox2"
                                 Height="30"
                                 Width="150"
                                 Margin="10,20"
                                 ItemsSource="{Binding Path=DateRanges}"
                                 SelectedItem="{Binding Path=SelectedValue, Mode=TwoWay}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock>
                            <Hyperlink Command="{Binding Path=HyperLinkCommand}">
                                <Run Text="{Binding Path=Text}" />
                            </Hyperlink>
                        </TextBlock>
                    </DataTemplate>
                </ComboBox.ItemTemplate>
  </ComboBox>

Any reason why RadComboBox behaves like this and eats up the command?

Thanks.



Gautam
Top achievements
Rank 1
 asked on 23 Jan 2012
1 answer
108 views
Multiple click the "up" arrow of the map navigator.
Get the exception:
System.ArgumentException was unhandled
  Message='-0,030812377929665;-Infinito' is not a valid value for property 'To'.
Source=WindowsBase
StackTrace:
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
at System.Windows.Media.Animation.PointAnimation.set_To(Nullable`1 value)
at Telerik.Windows.Controls.Map.MultiScaleImage.SetSpringsAnimationTimer()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.Run()
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at RadarSoft.Report.EditorWPF.App.Main() in D:\Report\RadarSoft.Report.EditorWPF\obj\x86\Release\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:


Andrey
Telerik team
 answered on 23 Jan 2012
1 answer
61 views
I have a chart that contains two custom grid lines. However, I only want to show them under certain circumstances. I noticed the Visibility property doesn't support binding. I'd rather not set this property in code-behind, as I'm trying to bind everything via MVVM. Is code-behind my only choice here?
Randy Minder
Top achievements
Rank 1
 answered on 23 Jan 2012
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?