Telerik Forums
UI for WPF Forum
2 answers
145 views
Hi.

I would like to have more than 1 row as a heading to my grid.
I would like to have a heading that is applicable to a couple of columns, with each underlying column still having its own heading.

It should be simular to the formatting that you can do in excel, when you merge a couple of columns into 1 column, and still have columns underneath it, example
------------------------------------
|            Data Group             |
------------------------------------
|Column1|Column2|Column3|
------------------------------------

I have a project where I need to add columns to my radgrid in code, so please help with a WPF C# example.

Thanks.
Eduan Marais
Top achievements
Rank 2
 answered on 19 May 2010
7 answers
414 views
How can I remove the expand icon where there is no data in the child
this is my code
<telerik:RadGridView  Margin="15,5,15,5" Name="gvRequest" Height="auto" Width="Auto" 
                                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"   
                                 telerik:StyleManager.Theme="Simple" AutoGenerateColumns="False"   
                                 IsFilteringAllowed="False" FlowDirection="RightToLeft" ShowGroupPanel="False">  
                    <telerik:RadGridView.Columns> 
                        <telerik:GridViewDataColumn UniqueName="ActivityName" Header="שם&#13;תת פעילות" Width="Auto" /> 
                        <telerik:GridViewDataColumn UniqueName="RequestID" Header="מספר&#13;דרישה" Width="Auto" /> 
                        <telerik:GridViewDataColumn UniqueName="RequestName" Header="שם&#13;דרישה" Width="Auto" /> 
                        <telerik:GridViewDataColumn UniqueName="RequestTotal" Header="סכום הדרישה &#13;(K ש''ח)" Width="Auto" /> 
                        <telerik:GridViewDataColumn UniqueName="RequestType" Header="סוג&#13;הדרישה" Width="Auto" />                         
                        <telerik:GridViewDataColumn UniqueName="Supplier" Header="ספק" Width="Auto" /> 
                        <telerik:GridViewDataColumn UniqueName="RequestBalance" Header="יתרה בדרישה &#13;(K ש''ח)" Width="Auto" /> 
                    </telerik:RadGridView.Columns> 
                        <telerik:RadGridView.HierarchyChildTemplate> 
                            <DataTemplate> 
                                <StackPanel DataContext="{x:Null}">  
                                    <telerik:RadGridView CanUserReorderColumns="False" Name="gvOrder" 
                                             CanUserFreezeColumns="False" ShowGroupPanel="False" ColumnsWidthMode="Auto" AutoGenerateColumns="False" ItemsSource="{Binding}" 
                                             Loaded="OnChildGridLoaded" FlowDirection="RightToLeft" IsFilteringAllowed="False" ShowColumnHeaders="True" ColumnBackground="AliceBlue" HorizontalContentAlignment="Right" ClipToBounds="True">  
                                        <telerik:RadGridView.Columns> 
                                            <telerik:GridViewDataColumn UniqueName="OrderID" Header="מספר&#13;הזמנה" Width="Auto" /> 
                                            <telerik:GridViewDataColumn UniqueName="OrderName" Header="שם&#13;הזמנה" Width="Auto" /> 
                                            <telerik:GridViewDataColumn UniqueName="OrderTotal" Header="סכום הזמנה &#13;(K ש''ח)" Width="Auto" /> 
                                                                                    </telerik:RadGridView.Columns> 
                                    </telerik:RadGridView> 
                                </StackPanel> 
                            </DataTemplate> 
                        </telerik:RadGridView.HierarchyChildTemplate> 
                    </telerik:RadGridView> 


private void BindDataMainGrid()  
        {  
            try  
            {  
                 
                DataSet dataSet = this.GetData();  
 
                // This is needed to make the grid use the HierarchyChildTemplate  
                GridViewTableDefinition detailDefinition = new GridViewTableDefinition();  
 
                // Tell the detailsDefinition to pull its data from the Details DataTable.  
                detailDefinition.DataSource = dataSet.Tables["Order"].DefaultView;  
 
                // Specify the relation between the two tables, similar to what is done in the DataSet.  
                TableRelation tr = new TableRelation();  
                tr.FieldNames.Add(new FieldDescriptorNamePair("RequestID", "RequestID"));  
                detailDefinition.Relation = tr;  
 
                // Add a GridViewTableDefinition to the grid to make it use the HierarchyChildTemplate  
                // defined in XAML.  
                if (this.gvRequest.TableDefinition.ChildTableDefinitions.Count < 1)  
                    this.gvRequest.TableDefinition.ChildTableDefinitions.Add(detailDefinition);  
 
                // Bind the grid to the "master" table.  
                this.gvRequest.ItemsSource = dataSet.Tables["Request"].DefaultView;  
            }  
            catch  
            {  
                this.gvRequest.ItemsSource = CommonValues.GetDataTabel().DefaultView;  
            }  
        }  
 
        private void OnChildGridLoaded(object sender, RoutedEventArgs e)  
        {  
            // Pull data from the detail table based on the relation.  
            var dataRowView = (DataRowView)((RadGridView)sender).ParentRow.DataContext;  
            var ds = dataRowView.DataView.Table.DataSet;  
            var childData = dataRowView.CreateChildView(ds.Relations["RequestID"]);  
 
            // Manually set the DataContext of the child grid.  
            // We have stopped a wrong DataContext propagating down to this child grid  
            // in the XAML file by wrapping the child grid in a StackPanel and setting  
            // the StackPanel's DataContext to null.  
            ((RadGridView)sender).DataContext = childData;  
 
       }  
 
        private DataSet GetData()  
        {  
            try  
            {  
                DataSet ds = new DataSet();  
                dsRequest dsr = ServiceData.GetRequestAndOrder(0,0,1,2009,0);  
                ds.Tables.Add(dsr.Tables["Request"].Copy());  
                ds.Tables.Add(dsr.Tables["Order"].Copy());  
                ds.Relations.Add("RequestID",  
                ds.Tables["Request"].Columns["RequestID"],  
                ds.Tables["Order"].Columns["RequestID"]);  
                return ds;  
            }  
            catch  
            {  
                return null;  
            }  
 
        } 

 

Thanks

Vlad
Telerik team
 answered on 19 May 2010
0 answers
88 views

We have noticed with your chart control that when we set it so that the point labels are showing it makes the opacity of the series definition read only. Is there a way to disable this behavior or work around it so that we can change the opacity in this case? Currently we turn the opacity to 50% for all other series when the user hover’s the mouse over one of the series items in the legend. If the point labels are on and the opacity locked we are unable to do this. Any help on this matter would be greatly appreciated.

 

Thanks in advance

MacKenzie

MacKenzie Mickelsen
Top achievements
Rank 1
 asked on 18 May 2010
2 answers
225 views
Hi;

How can i transition with multi userControl between ?

I did try long long time but ... :(

or how can i set binding transition content with UserControls ? Please give me a sample..

And sorry my poor English..


Leex Lee
Top achievements
Rank 1
 answered on 18 May 2010
2 answers
73 views
Hello,

Does the zoom/scroll work with Multiple YAxes?

If so, could you attach a zip file example?

Thanks in advance!
Matt
Matt Tonsager
Top achievements
Rank 1
 answered on 18 May 2010
3 answers
153 views
Hello,

It seems that if I set the ValidationMode and add a RowEditEnded handler on my grid either declaratively or programmatically, the grid does not leave edit mode when the Enter key is pressed.  The only way I can get it out of edit mode it to click on another row.  If I do not add a RowEditEnded event handler, then pressing Enter works as expected.

Am I doing something wrong?  Missing something?

Update: It seems to be related to setting ValidationMode="Row".  With this setting, even if I have no RowEditEnded event handler, the cell will stay in edit mode.

Thanks,
Mark

Hristo
Telerik team
 answered on 18 May 2010
1 answer
187 views
Hello ladies and gentleman.

I have stacked bar chart, and i'm not able to change their default background colors.
See attached image, please.
I used code from: http://demos.telerik.com/wpf/ -> Chart -> 2D charts -> Stacked bar series.

Could you please help me with this?
Thank you in advance,
    Nenad Djukic

Nenad Djukic
Top achievements
Rank 1
 answered on 18 May 2010
3 answers
150 views
Hi,

I'm currently evaluating the Telerik chart control and am so far very impressed, however, I have found one limitation which is presenting me with problems.

I would like to plot multiple series of data with a common x-axis on the same chart with each series having its own y-axis - at a basic level this works fine. However, when I now implement zooming and scrolling, I notice that each Y-axis is tied to the same range. i.e. If I change the zoom on one y-axis scroll-bar, all the others change too, whereas I'd like them to work independently. This seems a limitation on the implementation of zooming/scrolling since it's a property of the chart area and not a series or axis. Is there some convenient way around this so that each axis/series can be zoomed independently? Ideally, I'd like it so that if the user drags a box in the chart area then all axes/series are zoomed simultaneous, but if they use the scroll-bar on one axis, then only that axis/series is zoomed.

Many thanks in advance,
Mark
Ves
Telerik team
 answered on 18 May 2010
4 answers
150 views
I am having problem with getting the chart series to auto-update when data binding to nested collections is used. Following the example in the documentation, I created a list of ObservableCollections:

public List<ObservableCollection<ChartData>> _dataPointsCollection = new List<ObservableCollection<ChartData>>(); 

ChartData is just a simple class:

public class ChartData  
{  
        public DateTime XValue { getset; }  
 
        public double YValue { getset; }  
 
        public ChartData()  
        {  
            XValue = DateTime.Now;  
        }  
 
        public ChartData(DateTime pTime, double pValue)  
        {  
            XValue = pTime;  
            YValue = pValue;  
        }  

In the constructon of the class, after InitializeComponent() call, I am setting the itemSource as follows:

radChart1.ItemsSource = _dataPointsCollection; 

And finally here is the code snippet that adds a new series to the chart:

ObservableCollection<ChartData> DataPoints = new ObservableCollection<ChartData>();  
_dataPointsCollection.Add(DataPoints);  
 
int currentIndex = _dataPointsCollection.Count - 1;  
 
SeriesMapping seriesMapping = new SeriesMapping();  
seriesMapping.SeriesDefinition = new SplineSeriesDefinition();  
seriesMapping.CollectionIndex = currentIndex;  
seriesMapping.SeriesDefinition.ShowItemLabels = false;  
seriesMapping.LegendLabel = chartDataProvider.LegendLabel;  
seriesMapping.ItemMappings.Add(new ItemMapping("XValue", DataPointMember.XValue));  
seriesMapping.ItemMappings.Add(new ItemMapping("YValue", DataPointMember.YValue));  
radChart1.SeriesMappings.Add(seriesMapping); 

The problem I am having is that the chart control only shows data points that are already in the ObservableCollection at the time the window that has the chart is displayed; any data that gets added after the window is displayed do not get displayed in the chart at all.

What am I doing wrong? Any help would be greatly appreciated.
Thanks

-Ambar
Ambar Kulkarni
Top achievements
Rank 1
 answered on 18 May 2010
7 answers
153 views
Hello,

I Just upgraded to version 2010.1.422.35. Our screens are all contained inside of a ViewBox with Stretch="Fill". The Docking control works as expected but when the size changes the compass size doesn't change at all. I was wondering if you had any ideas on how i could change the compass size?

Thanks Much,
~Boots
Miroslav Nedyalkov
Telerik team
 answered on 18 May 2010
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?