Telerik Forums
UI for WPF Forum
1 answer
135 views

I am trying to use DataPager on my grid. My goal is to put the pager on the different part of my screen.

For example, I have a window with two main grid. I used a Frame on the first grid to display a page with RadGridView. This Grid is the one I want to have the Pager. But I want to put the Pager on the second Grid of my main window. This is for layout purpose. Is this possible? 

 

Thank you

Martin Ivanov
Telerik team
 answered on 21 Jul 2020
1 answer
188 views
I've got DropBox installed on Windows.  When I look at Windows Explorer, I see it as a top-level node, alongside "This PC" and "Quick Access"

Is there any way to incorporate this into the Telerik File/Folder dialogs and RadPathPicker?
Dilyan Traykov
Telerik team
 answered on 20 Jul 2020
2 answers
114 views

Hello.  I have a RadGridView with a large collection of items (4000 columns, up to 400 rows), which are grouped together (4 columns in each group).  Currently, we're generating the columns and groups in the codebehind, but it takes a long time to generate the table since we're creating every column and group object, even if they're not currently shown.

We end up with a table that looks similar to the (completely fake) attached image - 4 columns of statistics for each item in the header.

 

I'd like to try autogenerating the columns and groups, using virtualization so we don't have to create the view objects for every column and group unless they're needed.  However, I don't know how to autogenerate the groups.  Is there a way to do so in the xaml?  Or, is the solution to autogenerate the columns, but add the groups programatically as the columns are generated?

I haven't attached any dummy data, since I expect the data has to be organized in a specific manner to get this to work.

 

Thanks in advance for any help you can provide.

Vladimir Stoyanov
Telerik team
 answered on 20 Jul 2020
0 answers
3.0K+ views

Hello,

I have a new issue. I'd like to change and update the display name of a property at run-time.

The scenario is that if we want to change the name of a property (for example, LinkBudgetApp1 with "App1" as display name),

we do the changes in the project settings, so the current display is overwritten. So far, I did the appropriate changes in the code 3.

However, nothing changes.

Maybe I'm using ICustomTypeDescriptor and PropertyDescriptor in the wrong way, please tell me what are the changes to do to make

this work. Thank you.

 

A sample model class

public class LinkBudgetExpandableAttribute : ObservableObjectBase
    {
 
        // Constructor here
 
        // Implementation of ObservableObjectBase
 
  
        [DisplayName("App1")]
        public string LinkBudgetApp1
        {
            get { // some code here }
            set { // some code here }
        }
 
        [[DisplayName("App2")]
        public string LinkBudgetApp2
        {
            get { // some code here }
            set { // some code here }
        }
 
        [DisplayName("App3")]
        public string LinkBudgetApp3
        {
            get { // some code here }
            set { // some code here }
        }
 
        public override string ToString()
        {
            // returns all properties values
        }
}

 

Implementation of ICustomTypeDescriptor

class LinkBudgetToPropertyGridAdapter : ICustomTypeDescriptor
    {
        public readonly LinkBudgetExpandableAttribute lbe;
        Dictionary<string, IEnumerable<Attribute>> dctPropertyConfiguration = new Dictionary<string, IEnumerable<Attribute>>();
         
        public LinkBudgetToPropertyGridAdapter(object feature, Dictionary<string, IEnumerable<Attribute>> attributes)
        {
            this.lbe = feature as LinkBudgetExpandableAttribute;
            this.dctPropertyConfiguration = attributes;
        }
 
        public object GetValue()
        {
            return lbe;
        }
 
        public AttributeCollection GetAttributes()
        {
            return TypeDescriptor.GetAttributes(lbe, true);
        }
 
        public string GetClassName()
        {
            return GetType().Name;
        }
 
        public string GetComponentName()
        {
            throw new NotImplementedException();
        }
 
        public TypeConverter GetConverter()
        {
            return TypeDescriptor.GetConverter(lbe, true);
        }
 
        public EventDescriptor GetDefaultEvent()
        {
            return TypeDescriptor.GetDefaultEvent(lbe, true);
        }
 
        public PropertyDescriptor GetDefaultProperty()
        {
            return TypeDescriptor.GetDefaultProperty(lbe, true);
        }
 
        public object GetEditor(Type editorBaseType)
        {
            return TypeDescriptor.GetEditor(lbe, editorBaseType, true);
        }
 
        public EventDescriptorCollection GetEvents()
        {
            return TypeDescriptor.GetEvents(lbe, true);
        }
 
        public EventDescriptorCollection GetEvents(Attribute[] attributes)
        {
            return TypeDescriptor.GetEvents(lbe, attributes, true);
        }
 
        public PropertyDescriptorCollection GetProperties()
        {
            return GetProperties(new Attribute[0]);
        }
 
        public PropertyDescriptorCollection GetProperties(Attribute[] attributes)
        {
            List<PropertyDescriptor> props = new List<PropertyDescriptor>();
            string[] linkBudgetAttributeNames =
                {FeatureAttributes.LinkBudgetInput,
                FeatureAttributes.LinkBudgetInputApp1,
                FeatureAttributes.LinkBudgetInputApp2,
                FeatureAttributes.LinkBudgetInputApp3
            };
             
            foreach (var attributeName in linkBudgetAttributeNames)
            {
                if (dctPropertyConfiguration.Keys.Contains(attributeName))
                {
                    var prop = new LinkBudgetDescriptor(attributeName, lbe, dctPropertyConfiguration[attributeName]);
                    props.Add(prop);
                }
            }
            return new PropertyDescriptorCollection(props.ToArray());
        }
 
        public object GetPropertyOwner(PropertyDescriptor pd)
        {
            return this;
        }
    }

 

A method to define and retrieve attributes in some class

protected virtual Project GetCurrentProject { get; }
 
protected Dictionary<string, IEnumerable<Attribute>> getAttributeConfiguration()
        {
            Dictionary<string, IEnumerable<Attribute>> result = new Dictionary<string, IEnumerable<Attribute>>();
 
            foreach (var fa in FeatureAttributes.StandardFeatureAttributes)
            {
                var attributes = new List<Attribute>();
                attributes.Add(new CategoryAttribute(fa.Category));
                attributes.Add(new DisplayNameAttribute(fa.DisplayName));
                attributes.Add(new DescriptionAttribute(fa.Description));
                attributes.Add(new ReadOnlyAttribute(fa.IsReadOnly));
                if (fa.Converter != null)
                {
                    attributes.Add(new TypeConverterAttribute(fa.Converter));
                }
                attributes.Add(new BrowsableAttribute(fa.IsBrowsable));
                 
 
                /// *** HACK *** Telerik uses a DisplayAttribute instead of a DisplayNameAttribute to define the name displayed
                var displayAttribute = new DisplayAttribute();
                if (fa.Name.Contains("App1"))
                {
                    displayAttribute.Name = GetCurrentProject.Settings.Applications["Application1"].Name;
                    displayAttribute.AutoGenerateField = true;
                
                else if (fa.Name.Contains("App2"))
                {
                    displayAttribute.Name = GetCurrentProject.Settings.Applications["Application2"].Name;
                    displayAttribute.AutoGenerateField = GetCurrentProject.Settings.Applications["Application2"].IsVisible;
                }
                else if (fa.Name.Contains("App3"))
                {
                    displayAttribute.Name = GetCurrentProject.Settings.Applications["Application3"].Name;
                    displayAttribute.AutoGenerateField = GetCurrentProject.Settings.Applications["Application3"].IsVisible;
                }
                else
                    displayAttribute.Name = fa.DisplayName;
                displayAttribute.GroupName = fa.Category;
                displayAttribute.Description = fa.Description;
                 
                attributes.Add(displayAttribute);
 
                result.Add(fa.Name, attributes);
            }
 
            return result;
        }

Implementation of PropertyDescriptor

public class LinkBudgetDescriptor : PropertyDescriptor
    {
        private readonly List<Attribute> PropertyAttributes;
        private readonly LinkBudgetExpandableAttribute lbe;
        public LinkBudgetDescriptor(string attributeName, LinkBudgetExpandableAttribute lbe,
            IEnumerable<Attribute> dctPropertyConfiguration)
            : base(attributeName, dctPropertyConfiguration.ToArray())
        {
            this.lbe = lbe;
            PropertyAttributes = dctPropertyConfiguration.ToList();
        }
        public override AttributeCollection Attributes
        {
            get
            {
                return base.Attributes;
            }
        }
        public override string Category { get { return PropertyAttributes.OfType<CategoryAttribute>().SingleOrDefault()?.Category; } }
        public override string Description { get { return PropertyAttributes.OfType<DescriptionAttribute>().SingleOrDefault()?.Description; } }
        public override string DisplayName { get { return PropertyAttributes.OfType<DisplayNameAttribute>().SingleOrDefault()?.DisplayName; } }
        public override bool IsReadOnly { get { return PropertyAttributes.OfType<ReadOnlyAttribute>().SingleOrDefault() != null ? PropertyAttributes.OfType<ReadOnlyAttribute>().SingleOrDefault().IsReadOnly : false; } }
        public override Type ComponentType { get { return typeof(LinkBudgetToPropertyGridAdapter); } }
        public override Type PropertyType
        {
            get
            {
                var val = lbe.GetType();
                return val;
            }
        }
    
        public override bool CanResetValue(object component)
        {
            return true;
        }
        public override object GetValue(object component)
        {
            return (component as LinkBudgetToPropertyGridAdapter).GetValue();
        }
        public override void ResetValue(object component)
        {
            
        }
        public override void SetValue(object component, object value)
        {
           
        }
        public override bool ShouldSerializeValue(object component)
        {
            return false;
        }
    }
Yefan
Top achievements
Rank 1
Veteran
 asked on 20 Jul 2020
3 answers
164 views

Using latest version of UI for WPF R2 2020 SP.

I have a RadRichTextBox and RadRichTextBoxRibbonUI on a user control.

All of the buttons on the ribbon view are synced with the selected text on the rich text box, other than font size. Note that if I highlight text and select a new font size, it works as expected, except that the newly selected size is not displayed in the ribbon view (the combobox is empty after the selection).

Snippet of code attached to show that the Command binding is set correctly, or so I believe.

Any help greatly appreciated.

 

<telerik:RadRichTextBoxRibbonUI CollapseThresholdSize="50,50" VerticalAlignment="Top" DataContext="{Binding Commands, ElementName=radRichTextBox}" ApplicationButtonContent="File">

     .....

</telerik:RadRichTextBoxRibbonUI>

<telerik:DocumentRuler Grid.Row="1">
    <telerik:RadRichTextBox Name="radRichTextBox" LayoutMode="Paged" />
</telerik:DocumentRuler>
<telerik:RadRichTextBoxStatusBar Grid.Row="2"  AssociatedRichTextBox="{Binding ElementName=radRichTextBox, Mode=OneTime}" />

Tanya
Telerik team
 answered on 20 Jul 2020
3 answers
273 views

I have a strange new bug in Visual Studio XAML Editor when I place a RadGridView inside a DataTemplate. It is quite easy to reproduce:

  1. create a new WPF Core 3.1 project
  2. add Telerik.UI.for.Wpf.NetCore 2020.2.513 (as NuGet package)
  3. place the following code inside the Resource-part of the window:
01.<Window.Resources>
02.    <DataTemplate x:Key="testTemplate">
03.        <Grid>
04.            <telerik:RadGridView>
05.                <telerik:RadGridView.Columns>
06.                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Title}"></telerik:GridViewDataColumn>
07.                </telerik:RadGridView.Columns>
08.            </telerik:RadGridView>
09.        </Grid>
10.    </DataTemplate>
11.</Window.Resources>

 

It does not matter that there is no ItemsSource or which field you are binding the GridViewDataColumn to. As soon as I include the property DataMemberBinding="{...}" I get a warning from "Microsoft.CodeAnalysis.Xaml.Diagnostics.Analyzers.XamlDocumentDiagnosticAnalyzer" saying that there is a NullReferenceException. From there on there is no more Intellisense or Autocomplete inside my Xaml Editor.

Could someone at Telerik check if it is just my developer machine or is it a bug that I detected? Visual Studio 2019 is Version 16.6.0.

Thanks in advance!

Regards
Heiko

Doug
Top achievements
Rank 1
Veteran
 answered on 19 Jul 2020
0 answers
138 views

Good day.

How can I have a paginated GridView using SQL LIMIT/OFFSET.

I tried using DataPager and GridView but what i understand is the control loads the records in full. Is it possible to have the Pager or the GridView use something like LIMIT/OFFSET when retrieving the date from the database.

For example 1 have 100,000 records. I just want to load the first 1000 on my page load and navigate via pager(with 100 page indicator) to show the other records. And also have it affect the GridView column filter and other header controls which means when I filter/sort it will look on the full records list. 

 

Thank you very much.

gerardo
Top achievements
Rank 1
Veteran
 asked on 19 Jul 2020
2 answers
227 views

I have seen the following example in this forums.

-->  https://www.telerik.com/forums/geoserver-as-provider

 

 

 

i just change 

1. BaseUri="http://localhost:8080/geoserver/hc_test/wms"

2. TileUrlFormat = @"?SERVICE=WMS&REQUEST=GetMap&VERSION=1.1.1&FORMAT=PNG&WIDTH={1}&HEIGHT={2}&SRS=EPSG:42310&BBOX={0}&LAYERS=hc_test:N3A_G0100000";

3. XYZoomToBBox Function

 

my GetTile Function is  return url that "http://ocalhost:8080/geoserver/hc_test/wms?service=WMS&version=1.1.1&request=GetMap&layers=hc_test:N3A_G0100000&styles=&bbox=956779,1928520,1142111,2015940&width=1000&height=1000&srs=EPSG:42310&format=application/openlayers"
This url works well in the browser. However, the map is not visible in the radmap.

The rest of the code is the same as example code.

 

Can I get the latest examples or advice for working with geoserver?


 

MCanitez
Top achievements
Rank 1
 answered on 17 Jul 2020
3 answers
271 views

Hi,

I would like to style the search results that are displayed in HighlightTextBlock so that the found text is bold or underlined or similar. Any simple solution for that?

Regards
Heiko

Vicky
Telerik team
 answered on 17 Jul 2020
3 answers
463 views

Hello,

 

I was wondering if there is a way to export data from my RadGrid to an Excel File Template.  I am currently using Microsoft.Office.Interop.Excel and looping through my list to input each record in its according row and column but I am noticing it is running very slow now with the amount of records I have.   I believe this was a question asked in 2012 (http://www.telerik.com/forums/export-to-a-template-excel-file) and I am hoping it may now be supported.

 

Thank you

 

Derrick

Martin Ivanov
Telerik team
 answered on 16 Jul 2020
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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?