Telerik Forums
UI for WPF Forum
3 answers
116 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.
Yavor Georgiev
Telerik team
 answered on 19 May 2010
7 answers
704 views
Hello,

I'm a beginner in WPF and I need your help to do something.

I want to add a system to close tabs for users. But I can't do it !
I found a video here : http://tv.telerik.com/wpf/prism/introduction-prism-with-radcontrols-wpf and I use the same thing for RadTabControl. So I'm using MS Composite Application Guidance and the RegionManager.

So I have this code id my main project :
<telerik:RadTabControl Name="tabControlClient" DockPanel.Dock="Right" cal:RegionManager.RegionName="MainRegion" Margin="10 0 10 10" ScrollMode="Viewport" DropDownDisplayMode="Visible" DisplayMemberPath="Content"
            <telerik:RadTabControl.ItemContainerStyle> 
               <Style TargetType="{x:Type telerik:RadTabItem}"
                    <Setter Property="Header" Value="{Binding DataContext.HeaderInfo}" /> 
                    <Setter Property="Height" Value="25" /> 
                    <Setter Property="IsSelected" Value="True" /> 
                </Style> 
            </telerik:RadTabControl.ItemContainerStyle> 
</telerik:RadTabControl> 

In my Module Project I copy the code on the video :
public String HeaderInfo 
     get { return "Labs Module"; } 

#region INotifyPropertyChanged Membres 
 
public event PropertyChangedEventHandler PropertyChanged; 
 
protected void OnPropertyChanged(String propertyName) 
     if (this.PropertyChanged != null
     { 
          this.PropertyChanged(thisnew PropertyChangedEventArgs(propertyName)); 
     } 

It work ! But now I want to add a close system. So I search the solution in this forum and I found this : How to Add Close Button to the Tab Headers
So I complete my code in my main project like this :
<telerik:RadTabControl Name="tabControlClient" DockPanel.Dock="Right" cal:RegionManager.RegionName="MainRegion" Margin="10 0 10 10" ScrollMode="Viewport" DropDownDisplayMode="Visible" DisplayMemberPath="Content"
            <telerik:RadTabControl.ItemContainerStyle> 
               <Style TargetType="{x:Type telerik:RadTabItem}"
 
                    <Setter Property="Header" Value="{Binding DataContext.HeaderInfo}" /> 
                    <Setter Property="HeaderTemplate"
                        <Setter.Value> 
                            <DataTemplate> 
                                <Grid> 
                                    <TextBlock Text="{Binding Header}"></TextBlock> 
                                    <Button Grid.Column="1" Margin="3 0 0 0" Content="x" Width="16" 
                                       Height="16" HorizontalAlignment="right"/> 
                                </Grid> 
                            </DataTemplate> 
                        </Setter.Value> 
                    </Setter> 
                    <Setter Property="Height" Value="25" /> 
                    <Setter Property="IsSelected" Value="True" /> 
                </Style> 
            </telerik:RadTabControl.ItemContainerStyle> 
        </telerik:RadTabControl> 

But only close button appear and not the header text.
So how I can use this two solution to have "Header text + close button" please ?

If you need more informations or others, tell me.

Thank you in advance.
Best Regards





Tina Stancheva
Telerik team
 answered on 19 May 2010
2 answers
138 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
408 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
82 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
215 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
68 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
144 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
178 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
142 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?