Telerik Forums
UI for WPF Forum
2 answers
177 views

Hi

 I am totally new to WPF and would appreciate some pointers. I have a window with a chart and a button the buttons click event has the code shown below, I want to display the Depot Name in the legend but this code is not working the chart loads the data and displays the chart but without the legend is it possible to bind the chart to a data table and use the field names as the legend also is this good practice or should I consider a different approach?

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click

        Try

            Dim seriesMapping As New SeriesMapping()

          

            Dim Table1 As DataTable

            Table1 = New DataTable("DepotSales")

 

            Dim Row1, Row2, Row3, Row4 As DataRow

 

 

            Dim Name As DataColumn = New DataColumn("DepotName")

 

            Name.DataType = System.Type.GetType("System.String")

 

            Table1.Columns.Add(Name)

 

            Dim Turnover As DataColumn = New DataColumn("Turnover")

            Turnover.DataType = System.Type.GetType("System.Int32")

            Table1.Columns.Add(Turnover)

 

            Dim DepotID As DataColumn = New DataColumn("DepotID")

            DepotID.DataType = System.Type.GetType("System.Int16")

            Table1.Columns.Add(DepotID)

 

            Row1 = Table1.NewRow()

 

            Row1.Item("Depot") = "North"

            Row1.Item("Turnover") = 69000

            Row1.Item("DepotID") = 1

            Table1.Rows.Add(Row1)

 

            Row2 = Table1.NewRow()

 

            Row2.Item("Depot") = "South"

            Row2.Item("Turnover") = 35000

            Row2.Item("DepotID") = 2

            Table1.Rows.Add(Row2)

 

            Row3 = Table1.NewRow()

 

            Row3.Item("Depot") = "East"

            Row3.Item("Turnover") = 28000

            Row1.Item("DepotID") = 3

            Table1.Rows.Add(Row3)

 

            Row4 = Table1.NewRow()

 

            Row4.Item("Depot") = "West"

            Row4.Item("Turnover") = 41000

            Row4.Item("DepotID") = 4

            Table1.Rows.Add(Row4)

 

            seriesMapping.LegendLabel = "Turnover"

            seriesMapping.SeriesDefinition = New Bar3DSeriesDefinition

 

            seriesMapping.ItemMappings.Add(New ItemMapping("DepotID", DataPointMember.XValue))

            seriesMapping.ItemMappings.Add(New ItemMapping("DepotName", DataPointMember.XCategory))

            seriesMapping.ItemMappings.Add(New ItemMapping("Turnover", DataPointMember.YValue))

 

            Radchart.SeriesMappings.Add(seriesMapping)

            Me.Radchart.ItemsSource = Table1

 

        Catch ex As Exception

 

        End Try

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Ves
Telerik team
 answered on 18 Nov 2009
1 answer
190 views
I have some questions about styling the 3d pie in wpf.
I didnt found this in the api. Maybe someone can show me some c# code on this:
I want to change the opacity of each pie - slice, change the corner radius, get access to the colors and if possible to seperate a slice of the pie chart.
Dwight
Telerik team
 answered on 18 Nov 2009
1 answer
273 views
Do you have any cool button samples. That show styles , highlighting, triggers etc.
I'm not a graphic artist.. ...
thanks
Ivan
Telerik team
 answered on 18 Nov 2009
6 answers
1.7K+ views
We are using MVVM and want to keep all the binding and logic in the view model. All of your examples are with code behind. So, is there a way to define the parent and child in xaml and then do the binding in the view model?

Forgot to add that we also use a collection of Business Objects to bind to and not data sets.

The code below displays the child detail and it has all the objects columns list, but no data?

Thanks

Xaml Code:

            <telerik:RadGridView.Columns> 
                <telerik:GridViewDataColumn  
                        HeaderText="Policy Number"  
                        UniqueName ="PolicyNumber" 
                    > 
                    <telerik:GridViewColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBox  
                                HorizontalContentAlignment="Stretch"     
                                Text="{Binding Path=PolicyNumber, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  
                                HorizontalAlignment="Left" VerticalAlignment="Top" /> 
                        </DataTemplate> 
                    </telerik:GridViewColumn.CellTemplate> 
                </telerik:GridViewDataColumn> 
                <telerik:GridViewDataColumn  
                        HeaderText="Insurance Name"  
                        UniqueName ="InsuranceName" 
                    > 
                    <telerik:GridViewColumn.CellTemplate> 
                        <DataTemplate> 
                            <TextBlock  
                                Text="{Binding Path=InsuranceName}"  
                                HorizontalAlignment="Left" VerticalAlignment="Top" /> 
                        </DataTemplate> 
                    </telerik:GridViewColumn.CellTemplate> 
                </telerik:GridViewDataColumn> 
            </telerik:RadGridView.Columns> 
            <telerik:GridViewDataControl.HierarchyChildTemplate> 
                <DataTemplate> 
                    <StackPanel> 
                        <telerik:RadGridView   
                            CanUserReorderColumns="False"  
                            CanUserFreezeColumns="False"   
                            ShowGroupPanel="False"  
                            ColumnsWidthMode="Auto"  
                            ItemsSource="{Binding Path=InsuranceProvider}" 
                        > 
                        </telerik:RadGridView> 
                    </StackPanel> 
                </DataTemplate> 
            </telerik:GridViewDataControl.HierarchyChildTemplate> 
        </telerik:RadGridView> 

Code Behind:
        Public Sub New() 
            InitializeComponent() 
 
            Dim InsProvDetailDefinition As New GridViewTableDefinition() 
            InsProvDetailDefinition.Relation = New PropertyRelation("InsuranceProvider") 
            Me.RadPatInsList.TableDefinition.ChildTableDefinitions.Add(InsProvDetailDefinition) 
 
 
        End Sub 

Milan
Telerik team
 answered on 17 Nov 2009
1 answer
159 views
How can I apply the reflection effect to the button control or other telerik controls.
thanks
Dimitrina
Telerik team
 answered on 17 Nov 2009
2 answers
120 views
Hi
I am trying to get a combobox inside the radgridview. Below code doesnt seem to work. Any help would be appreciated

   Dim farmer As New UI.GridViewComboBoxColumn()
            farmer.DataType = GetType(String)
            farmer.UniqueName = "UserID"

            farmer.HeaderText = "Farmer"
            farmer.DataSource = GetFarmerDataSource()
            farmer.DisplayMember = "UserID"
            farmer.ValueMember = "UserCode"
            farmer.FieldName = "UserID"
            farmer.Width = 150


            rgvBill.MasterGridViewTemplate.Columns.Add(farmer)


            Dim Bags As New UI.GridViewTextBoxColumn()
            Bags.DataType = GetType(Int32)
            Bags.UniqueName = "Bags"
            Bags.FieldName = "Bags"
            Bags.HeaderText = "Bags"
            Bags.Width = 50
            rgvBill.MasterGridViewTemplate.Columns.Add(Bags)


My radgrid at design time has no columns defined
Feroz
Top achievements
Rank 1
 answered on 17 Nov 2009
3 answers
254 views
Hi

Are we able to programmatically apply a style to a dynamically created RadTileViewItem? Specifically I would like to change the background colours of the headers. What is the template/parameters for the style?

Regards

Rav
Tihomir Petkov
Telerik team
 answered on 17 Nov 2009
8 answers
149 views
Hi,

I tried the Q3 2009 binaries on an application I'm developing with the Q2 release and discovered that some parts of the application don't
function anymore. E.g. the GridViewDataControl like you use in your first look example. So I was wondering if it's wise at this moment
to switch over to the beta release, because I'm still in an early phase of development.
Can you please give me some advise?

Thanks
Thomas


Thomas
Top achievements
Rank 1
 answered on 17 Nov 2009
3 answers
285 views
Hi..
Where can I find an example of conditional formatting a row?
thanks
Vlad
Telerik team
 answered on 17 Nov 2009
3 answers
370 views
Dear Sir,

Now i m having problem with RadTreeView as i have binded dynamically with class TreeViewFolder but at debug time i m getting parent node only even though i drag and drop from RadGridView to child node . Also i m trying to load image along with dragcue but i m not getting the same. image is only building with color of arrow. I want to have different image valid image when user drag items to valid treeview node or else invalid image for invalid treeview node. Also please let me know how to retrieve the selected item name from the path.

TreeView Looks Like

Personal Folder {Parent Item}
     Inbox    {Child item}
     Outbox {Child item}
     Sent Items {Child item}
     Deleted Items {Child item}

Thanks in advance..


Miral Shah
Miroslav
Telerik team
 answered on 17 Nov 2009
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
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
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?