Telerik Forums
UI for WPF Forum
1 answer
342 views

Hi

I have a RadPropertyGrid, being defined as:

       <telerik:RadPropertyGrid Item="{Binding ObjectBound, Mode=OneWay}" Width="300" Name="propertyGrid2"
                                 Grid.Column="1"
                                 VerticalAlignment="Stretch"
                                 VerticalContentAlignment="Stretch"
                                 NestedPropertiesVisibility="Visible"
                                 AutoGeneratePropertyDefinitions="True"
                                 SelectionMode="Multiple"
                                 PropertySetMode="Intersection"
                                 telerik:PropertySet.ShouldAddNullForNonMatchingValues="True"

 

where I would like to bind 0...n items

 

Let's say all of those items belong to the class Car

 

  public class CarEngine
    {
        public int PowerKW { get; set; }
        public int DisplacementCCM { get; set; }

    }
    public class Car
    {
        public Car()
        {
            Engine = new ();
        }
        public string Manufacturer { get; set; }
        public string Color { get; set; }
        public CarEngine Engine { get; set; }

    }

In the code behind I have a property to bind to the PropertyGrid

 

public object ObjectBound
        {
            get;
            set;
        }

and will create the items like this:

 

  Car c = new Car();
            c.Manufacturer = "Honda";
            c.Engine.PowerKW = 110;
            c.Engine.DisplacementCCM = 1799;
            c.Color = "black";


            Car c2 = new Car();
            c2.Manufacturer = "BMW";
            c2.Engine.DisplacementCCM = 2199;
            c2.Engine.PowerKW = 150;
            c2.Color = "black";

            List<Car> list = new();
            list.Add(c);
            list.Add(c2);

now first, I will bind just one car instance to the RadPropertyGrid:

            this.ObjectBound = c;

Here I can expand the nested engine instance and can write to each field which is absolutety perfect!

Then we have a second use case where I would like to bind to the list with two cars and get their common attributes while differerent properties will be displayed empty:

      this.ObjectBound = list;

Therefore I had choosen "Intersection" for the propertysetmode of the RadPropertyGrid

For the primitive Attributes Color (shared between both cars) and Manufacturer (different) that will work just fine. 

 

 

But as one can see the nested Attribute "Engine" cannot be set as it not able to be expanded! I'd like to set e.g. a common displacement for both of the two cars. How can I realize such a behaviour as it is required from business?

 

thanks!

         
Stenly
Telerik team
 answered on 01 Mar 2023
1 answer
152 views

Hello,

Our application has a requirement to automatically log a user out after a period of input inactivity, e.g. keyboard or mouse events for security reasons.

When we automatically log out a user, we also want to close any open modal dialogs in our application, including any modal dialogs open in the Telerik ReportViewer - such as the Export / Print dialogs.

Is there a way for cancel/close these modal dialogs?

I looked at the specific events such as ExportBegin  as it provides a way to cancel the export, but I need a way to close the dialogs at any time not just at the specific time the export starts.

 

Thanks,

Canice.

Todor
Telerik team
 answered on 01 Mar 2023
0 answers
125 views

In WPF there is an export icon looks like a diskette. One can specify what type of export. PDF, Exel etc. then a call to Windows "Save As" dialog box. 

My question is there a way to populate/specify the file path in the "Address bar"?

Some kind of registry or something. The end user can of course alter the destination if they wish.

Herb
Top achievements
Rank 1
 asked on 28 Feb 2023
1 answer
144 views

How can I repeat certain lines on each page of a workbook?

WorksheetPageSetup worksheetPageSetup = worksheet.WorksheetPageSetup;
worksheetPageSetup.PaperType = PaperTypes.A4;
worksheetPageSetup.PageOrientation = PageOrientation.Landscape;
worksheetPageSetup.FitToPages = true;
worksheetPageSetup.CenterHorizontally = true;
worksheetPageSetup.PrintTitle ...

Assignment via PrintTitle does not work.

Dimitar
Telerik team
 answered on 28 Feb 2023
2 answers
165 views

I have issue at WPF  Telerik.Windows.Controls.GridView

 

I created new columns (GridViewExpressionColumn) the names are "CalculatedColumn" at RadGridView and see the result as at image 

I would like to get the data of the columns from RadGridView, and to create from this column the list of values 

for example:

on first column I would to get all Booleans values as list

 

n/a
Top achievements
Rank 1
Iron
 answered on 27 Feb 2023
1 answer
266 views

Hello,

How can I select all expanded/visible rows in a radgridview control, which have been grouped and possibly filtered, even if the rows fall out of view of the window container?

I have a window that contains a radgridview and a button that is outside of the grid which selects or deselects all visible rows in the radgridview. An end user may add multiple groupings and filters. There is a lot of data in the item source, at the time of this test over 3 thousand rows. The resulting data display after the end user has made changes will likely exceed the window containers viewable area. when I implemented the line of code below only the expanded row visible in the window was selected. The expanded rows that I had to scroll down to see were not selected. I would like to select all of the expanded/visible rows.

 var visibleRows = grdBatches.ChildrenOfType<GridViewRow>();

I have read that ChildrenOfType<T> works on visual elements. In another forum question, the answer stated that the use of visual elements is not advised when working with virtualized controls such as the radgridview.


Martin Ivanov
Telerik team
 answered on 24 Feb 2023
0 answers
413 views

I get the following error when I try to add a Telerik WPF Form

Project template

Adding a WFP forms triggers this and nothing added?

So I tried a WPF .NET Core template and got prompted for this"

 

No idea how to proceed ... just trying to create a new project?

Rob.

Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
 asked on 22 Feb 2023
1 answer
253 views

Dear Team,

I have a WPF app (vb.net) where i use radgridview. Virtualization is on because we have more hundreds of rows, and in the CELLLOADED event i color the cell backgrounds based on cell content.

The result is something like this: (attached: mapps.jpg)

The customer wants me to create excel output, including the colors. I browsed a lot of forums and i found multiple approaches but the result is always the same. The background is colored, but all column inherits the color of the first row. (attached: excel.jpg)

 

    Sub ExcelExport_Colored(rgv As RadGridView)

        Dim workbook As Workbook = rgv.ExportToWorkbook(New GridViewDocumentExportOptions() With {
                        .ExportDefaultStyles = True,
                        .AutoFitColumnsWidth = True,
                        .ShowColumnHeaders = True})
        Dim dialog As SaveFileDialog = New SaveFileDialog()
        dialog.DefaultExt = "xlsx"
        dialog.Filter = String.Format("{1} files (*.{0})|*.{0}|All files (*.*)|*.*", "xlsx", "Excel")
        dialog.FilterIndex = 1

        If dialog.ShowDialog() = True Then
            Dim provider = New XlsxFormatProvider()

            Using output = dialog.OpenFile()
                provider.Export(workbook, output)
            End Using
        End If

        Dim excelPath2 As String = Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\excel.exe",
"Path", "Key does not exist")
        Microsoft.VisualBasic.Interaction.Shell(excelPath2 & "EXCEL.EXE /e/min """ & dialog.FileName & """", AppWinStyle.NormalFocus)

    End Sub

 

I tried other export options as well, like radgridview.export, radgridview.exporttoxlsx.. all give the same result or worse.
Can you give any advice how to achieve it? I don't insist to the icons, if i could export the data with bgcolors i would be happy already.

Thank you !!

Peter

Martin Ivanov
Telerik team
 answered on 20 Feb 2023
1 answer
316 views
Hello,

With reference to the below link,
https://www.telerik.com/forums/add-header-to-each-pages-when-export-telerik-radgridview-to-a-workbook-exporttoworkbook-in-wpf

I need to set font size for the workbook (overwrite default settings) and also apply word wrap for the columns. I have implemented with the above reference. Can you please guide me to achieve this? or if any idea or lead much appreciated. Please let me know if you need more information.

Thanks in advance.
Dimitar
Telerik team
 answered on 20 Feb 2023
1 answer
127 views

Hi , 

In one of my wpf window I have two grids. In one grid I only have product name that lists all the products available and another grid i have product details( id, name, price etc.) and there is a add and remove button. If I select one product name add click add then it should add the details to the product details grid and also should be able to remove it. How can I implement it. Do you have any sample code?

Stenly
Telerik team
 answered on 20 Feb 2023
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?