Telerik Forums
UI for WPF Forum
2 answers
296 views

Hi,

I've been using custom Group Descriptors on my RadGridView so I can specify the order the groups are sorted into however on these custom groups, (an example of how I create the descriptor is below), the column aggregates do not show. But if I do not override the group descriptor the column aggregates show on the row groups correctly. Is it possible for me to show these aggregate values on my custom groups?

Thanks for your help!!

01.private GroupDescriptor<PnlPosition, string, DateTime> GetInstrumentIdGroupDescriptor(ListSortDirection dir)
02.        {
03.            var descriptor = new GroupDescriptor<PnlPosition, string, DateTime>
04.            {
05.                GroupingExpression = o => o.InstrumentId.ToString(),
06.                GroupSortingExpression = group => group.ElementAt(0).Expiry.Value,
07.                SortDirection = dir,
08.                DisplayContent = "InstrumentId",
09.            };
10.            return descriptor;
11.        }
12. 
13.        private void PositionResultsGridView_Grouping(object sender, Telerik.Windows.Controls.GridViewGroupingEventArgs e)
14.        {
15.            if (e.Action == GroupingEventAction.Place)
16.            {               
17.                var columnGroup = e.GroupDescriptor as ColumnGroupDescriptor;
18.                if (columnGroup != null && columnGroup.Column.UniqueName == "InstrumentId")
19.                {
20.                    // cancel the default grouping
21.                    e.Cancel = true;
22.                    var descriptor = GetInstrumentIdGroupDescriptor(e.GroupDescriptor.SortDirection ?? ListSortDirection.Descending);
23.                     
24.                    //descriptor.AggregateFunctions = columnGroup.A
25.                    // add the new descriptor
26.                    ((RadGridView)sender).GroupDescriptors.Add(descriptor);
27.                }
28.                else if (columnGroup != null && columnGroup.Column.UniqueName == "Underlying")
29.                {
30.                    // cancel the default grouping
31.                    e.Cancel = true;
32.                    // add the new descriptor
33.                    var descriptor = GetUnderlyingGroupDescriptor(e.GroupDescriptor.SortDirection ?? ListSortDirection.Descending);
34.                    ((RadGridView)sender).GroupDescriptors.Add(descriptor);
35.                }
36.            }
37.        }

 

 

Vladimir Stoyanov
Telerik team
 answered on 13 Nov 2019
2 answers
391 views

I have an issue when loading the layout on Raddock. I'm trying to cancel a view loading if the users access has been revoked. However when I do LayoutSerializationCustomLoadingEventArgs.Cancel = true and return from OnCustomElementLoading I get the following error.

System.ArgumentOutOfRangeException
  HResult=0x80131502
  Message=Specified argument was out of the range of valid values.
Parameter name: elementTypeName
  Source=Telerik.Windows.Controls.Docking
  StackTrace:
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.NotifyCustomElementLoading(String elementTypeName, String serializationTag, Dictionary`2 attributes)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.ReadPaneXml(XmlReader reader)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.LoadPaneGroup(LoadingParentElementArgs args)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.LoadSplitContainer(LoadingParentElementArgs args)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.LoadDocking(LoadingParentElementArgs args)
   at Telerik.Windows.Controls.Docking.DefaultDockingLayoutFactory.LoadLayout(XmlReader reader)
   at Telerik.Windows.Controls.RadDocking.LoadLayout(Stream source, Boolean raiseEventsIfNoSerializationTag)
   at MyApp.LoadLayout(LoadLayoutEventParameters loadLayoutEventParameters) in.. 

Here is the code:

 

public void LoadLayout(LoadLayoutEventParameters loadLayoutEventParameters)
{
     using (FileStream layoutFile = new FileStream(Path.Combine(this.configPath, this.layoutFilename), FileMode.Open))
      {
             radDocking.LoadLayout(layoutFile);
      }
}

 

My views inherit RadPane so I use CustomElementLoading.

this.radDocking.CustomElementLoading += this.MyApp.OnCustomElementLoading;

 

 

public void OnCustomElementLoading(object sender, Telerik.Windows.Controls.LayoutSerializationCustomLoadingEventArgs e)
{
    if (!userCanAccess)
    {
          e.Cancel = true;
          return;
    }
    e.SetAffectedElement(MyAppView);
 
}

 

Here is my xaml

<telerik:RadDocking Grid.Row="2" x:Name="radDocking"
                            BorderThickness="0"
                            HasDocumentHost="False">
 
            <telerik:RadDocking.DockingPanesFactory>
                <docking:ShellDockingPanesFactory />
            </telerik:RadDocking.DockingPanesFactory>
 
            <telerik:RadDocking.GeneratedItemsFactory>
                <docking:CustomDefaultGeneratedItemsFactory />
            </telerik:RadDocking.GeneratedItemsFactory>
 
            <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup HorizontalAlignment="Left"  x:Name="leftGroup" telerik:RadDocking.SerializationTag="leftGroup" />
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="DockedRight" >
                <telerik:RadPaneGroup HorizontalAlignment="Right" x:Name="rightGroup" telerik:RadDocking.SerializationTag="rightGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="DockedBottom" >
                <telerik:RadPaneGroup x:Name="bottomGroup" telerik:RadDocking.SerializationTag="bottomGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="DockedTop" >
                <telerik:RadPaneGroup x:Name="topGroup" telerik:RadDocking.SerializationTag="topGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="FloatingOnly" >
                <telerik:RadPaneGroup x:Name="floatingOnlyGroup" telerik:RadDocking.SerializationTag="floatingOnlyGroup"/>
            </telerik:RadSplitContainer>
            <telerik:RadSplitContainer InitialPosition="FloatingDockable" >
                <telerik:RadPaneGroup x:Name="floatingDockableGroup" telerik:RadDocking.SerializationTag="floatingDockableGroup"/>
            </telerik:RadSplitContainer>
        </telerik:RadDocking>

 

How can I control which views are loaded from the saved layout at runtime? I think it would get a bit messy if I start parsing the saved layout file and removing views. I usually save the layout when the app closes, this will remove the views the user can no longer access because I'm hoping they won't open in the first place if the access is revoked.

 

YBOT
Top achievements
Rank 1
Veteran
 answered on 12 Nov 2019
5 answers
145 views
Hi,

CloudUpload is a relay good idea, but how about CloudDownload?

And I relay like to see support for "One Drive" or "Dropbox", this a an alernitive for the users that Azure is to expensive.

Thanks!
Martin Ivanov
Telerik team
 answered on 12 Nov 2019
5 answers
137 views

Hi,

I recently set the SearchMode to MatchAllTerms in my default style for the RadGridView. Ever since, my application crashes when I try to do a lookup in a RadMultiColumnComboBox.  After removing the line from the default style, everything works fine again.  Could this be a bug ?

Regards
Hans

Hans
Top achievements
Rank 1
Veteran
 answered on 12 Nov 2019
2 answers
270 views

I've followed the 'getting started' documention for the chartview. 

I've created a new WPF .NET Core project. I've then added the following references:

- Telerik.Windows.Controls

- Telerik.Windows.Controls.Chart

- Telerik.Windows.Data

Then I've added the following xaml to the main window xaml file:

<telerik:RadCartesianChart>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:CategoricalAxis />
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis/>
            </telerik:RadCartesianChart.VerticalAxis>
        </telerik:RadCartesianChart>

 

Nothing shows at all - I've was expecting something/anything before going on to binding a source of data.

What am i missing?

 

I'm using VS 2019 and the latest public version of the .NET Core wpf components.

 

Thank you

Rob
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 12 Nov 2019
1 answer
181 views

The RadComboBox seems to require the user to have the cursor over the item text to be able to select the item. This is not the case for the standard ComboBox. Is it possible to change this without creating a custom ControlTemplate?

It is not bad when the items are longer strings. But we have a combo box with individual characters, and you have to click directly on the character to select the item. For whatever reason, if the items in the combo box are integers, selection works as expected.

See the attached animated gif.

Todd
Top achievements
Rank 1
 answered on 11 Nov 2019
8 answers
228 views
In Excel, if you select a row and then drag down past the bottom of what is visible, it scrolls automatically for you. But the RadSpreadsheet does not do this. Is there an option I am missing or an easy workaround?
Peshito
Telerik team
 answered on 11 Nov 2019
2 answers
540 views

Hi All,

I am opening RadWindow with ShowDialog() from viewmodel. I am not able to detect close 'X' button event. I want to prompt user before closing. 

My code looks like:

AssetViewModel.cs

var AssetWindow = new RadWindow
            {
                Header = "Asset Information",
                Owner = Application.Current.MainWindow,                
                WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner,
                Content = new UserControl()
            };          
AssetWindow.ShowDialog();

What is the best approach to detect close event, prompt user and proceed with user selected option i.e Yes/No

 Any help would be appreciated,

Regards,

Prashant Kirpan

 

 

 

Prashant
Top achievements
Rank 1
 answered on 10 Nov 2019
1 answer
237 views

Hi All,

I am using RadTabControl and validation is working only if tab is selected. i.e. updating UI only for selected tab and not others.

I have a RadTabControl control with three RadTabItem. Every tabitem contains usercontrol with own view model.

For all user controls, i have used  IDataErrorInfo for validation. From main control, manually i am triggering validation using notifyproperty change i.e.  RaisePropertyChanged(string.Empty).

This is working fine only if tab is selected. validation is executing properly on other tabs but UI is not updating

Control Structure:

MainVM.cs

      - TabControl1VM = new TabControl1ViewModel();

      - TabControl2.VM = new TabControl2ViewModel();

 

MainControl.xaml

  <telerik:RadTabControl  >
            <telerik:RadTabItem  Header="Location" DataContext="{Binding TabControl1VM}" >
                <telerik:RadTabItem.Content >                    
                        <local:TabControl1></local:TabControl1>                    
                </telerik:RadTabItem.Content>
            </telerik:RadTabItem>

            <telerik:RadTabItem Header="Asset Type" DataContext="{Binding TabControl2VM}">
                <telerik:RadTabItem.Content>
                    <local:TabControl2></local:TabControl2>
                </telerik:RadTabItem.Content>
            </telerik:RadTabItem>

 

Any help would be appreciated,

Regards,

Prashant
           

 

 

 

 

Petar Mladenov
Telerik team
 answered on 08 Nov 2019
15 answers
1.1K+ views
Hi,

I'm looking for a way to bind a List of key / value objects to the propertygrid. Consider the following snippets of code:

public void PopulatePropertyGrid()
{
    List<MyKeyValueClass> propertyList = new List<MyKeyValueClass>();
    propertyList.Add(new MyKeyValueClass(){ Key="property1", Value="value1" });
    propertyList.Add(new MyKeyValueClass(){ Key="property2", Value="value2" });
    propertyList.Add(new MyKeyValueClass(){ Key="property3", Value="value3" });
    //How do I bind this List to a RadPropertyGrid, so I get 3 properties with filled in values?
}


public class MyKeyValueClass
{
    public string Key {get;set;}
    public string Value {get;set;}
}



I tried something like this:
XAML:
<telerik:RadPropertyGrid x:Name="radPropertyGrid" AutoGeneratePropertyDefinitions="false" />


.cs:
radPropertyGrid.PropertyDefinitions.Clear();
foreach (MyKeyValueClass mkvc in propertyList)
{
    radPropertyGrid.PropertyDefinitions.Add(new PropertyDefinition()
    {
        DisplayName = mkvc.Key,
        Binding = new Binding("Value")
    });
}
radPropertyGrid.Item = propertyList;




This sets the displaynames accordingly, but won't show / bind the values 
Is this possible?

Stan

-Edit: code blocks formatted
Dilyan Traykov
Telerik team
 answered on 08 Nov 2019
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?