Hi Joe,
I will do that, of course.
WPF is even easier to do (for me) as most of my pure X# programming is done in WPF (and XIDE).
My WPF windows are all done in pure code, and that helps me be more flexible.
Wolfgang
Beginners Example
Beginners Example
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Beginners Example
Hi Joe,
here it is: It seems even easier than the Windows Forms example.
Wolfgang
here it is: It seems even easier than the Windows Forms example.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Beginners Example
Very nice, Wolfgang.
Me being a WPF-noob - is there an easy way to change the font used in the datagrid?
Me being a WPF-noob - is there an easy way to change the font used in the datagrid?
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Beginners Example
Hi Karl,
really hard <g>:
Wolfgang
really hard <g>:
Code: Select all
_oDataGrid:FontFamily := FontFamily{ "Courier New" }
_oDataGrid:FontSize := 20
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Beginners Example
Blush...
(But, by way of excuse, i had looked in the api browser, there's no entry regarding font in DataGrid's properties...)
While blushing , Datagrid has a backround property, but that's only the little rectangles fencing the scrollbar.
Probably, i need oDataGrid:CellStyle := Style{ } ? But i don't get, what/which "type" the style constructor wants...
THX!
(But, by way of excuse, i had looked in the api browser, there's no entry regarding font in DataGrid's properties...)
While blushing , Datagrid has a backround property, but that's only the little rectangles fencing the scrollbar.
Probably, i need oDataGrid:CellStyle := Style{ } ? But i don't get, what/which "type" the style constructor wants...
THX!
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Beginners Example
Hi Karl,
unfortunately it is not that easy. This is code from my own class library:
Sometimes it is hard to work without XAML.....
Wolfgang
unfortunately it is not that easy. This is code from my own class library:
Code: Select all
oHeaderStyle := Style{ TypeOf( System.Windows.Controls.Primitives.DataGridColumnHeader ) }
oHeaderStyle:Setters:Add( Setter{ System.Windows.Controls.Primitives.DataGridColumnHeader.BackgroundProperty, MVVMControlSettings.DataGridHeaderBackground } )
oHeaderStyle:Setters:Add( Setter{ System.Windows.Controls.Primitives.DataGridColumnHeader.SeparatorVisibilityProperty, Visibility.Visible } )
oHeaderStyle:Setters:Add( Setter{ System.Windows.Controls.Primitives.DataGridColumnHeader.SeparatorBrushProperty, MVVMControlSettings.DataGridVerticalGridLinesBrush } )
oHeaderStyle:Setters:Add( Setter{ System.Windows.Controls.Primitives.DataGridColumnHeader.PaddingProperty, MVVMControlSettings.DataGridHeaderPadding } )
self:ColumnHeaderStyle := oHeaderStyle
oCellStyle := Style{ TypeOf( System.Windows.Controls.DataGridCell ) }
oCellStyle:Setters:Add( Setter{ System.Windows.Controls.DataGridCell.PaddingProperty, MVVMControlSettings.DataGridCellPadding } )
self:CellStyle := oCellStyle
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Beginners Example
Argh...
I think i sort of understand this, so to play further, could you solve "MVVMControlSettings"? Probably a Using missing, but as the apibrowser knows nothing about this term, so what to add?
I think i sort of understand this, so to play further, could you solve "MVVMControlSettings"? Probably a Using missing, but as the apibrowser knows nothing about this term, so what to add?
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Beginners Example
Hi Karl,
that is my static settings class - I have copied this code from there.
These are the defaults for all my applications, but are settable on an application level.
Normally, you use stylesheets for this - that is easier.
But since I don't select always the easiest way, but the way that seems me more flexible, sometimes I have to do strange things.
But nevertheless, for some styles I do add a XAML stylesheet as resource into my WPF applications. Maybe I should publish a full featured WPF application as sample.
Wolfgang
that is my static settings class - I have copied this code from there.
Code: Select all
MVVMControlSettings.DataGridHeaderPadding := System.Windows.Thickness{ 5, 5, 5, 5 }
MVVMControlSettings.DataGridCellPadding := System.Windows.Thickness{ 6, 6, 6, 6 } // geht aktuell nicht
MVVMControlSettings.DataGridAlternatingRowBackground := System.Windows.Media.SolidColorBrush{ System.Windows.Media.Colors.Gainsboro }
MVVMControlSettings.DataGridVerticalGridLinesBrush := System.Windows.Media.SolidColorBrush{ System.Windows.Media.Color.FromRgb( 170,170,170 ) }
MVVMControlSettings.DataGridHeaderBackground := System.Windows.Media.SolidColorBrush{ System.Windows.Media.Color.FromRgb( 238, 238, 238 ) }
MVVMControlSettings.DataGridRowHeight := 20
Normally, you use stylesheets for this - that is easier.
But since I don't select always the easiest way, but the way that seems me more flexible, sometimes I have to do strange things.
But nevertheless, for some styles I do add a XAML stylesheet as resource into my WPF applications. Maybe I should publish a full featured WPF application as sample.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Beginners Example
Hi Wolfgang,
thx very much, now it works.
That surely would be helpfull - best including access to PG
thx very much, now it works.
Code: Select all
Maybe I should publish a full featured WPF application as sample
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Beginners Example
Hi Karl,
PostgreSQL access is standard in my newer applications whenever I have the choice: The main problem is that I have several different libraries in my framework, for different GUI choices (WPF, Windows Forms, Console) and for different database backends (DBF, ADS, Oracle, MS SQL Server, MySQL, PostgreSQL, SQLite), and therefore I have to combine a lot of code into the same application/lib to not to have to share my entire framework.
What you see is one WPF application with only PostgreSQL access, but I have also applications that are accessing 3 or 4 different database backends.
Wolfgang
PostgreSQL access is standard in my newer applications whenever I have the choice: The main problem is that I have several different libraries in my framework, for different GUI choices (WPF, Windows Forms, Console) and for different database backends (DBF, ADS, Oracle, MS SQL Server, MySQL, PostgreSQL, SQLite), and therefore I have to combine a lot of code into the same application/lib to not to have to share my entire framework.
What you see is one WPF application with only PostgreSQL access, but I have also applications that are accessing 3 or 4 different database backends.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it