Telerik Forums
UI for WPF Forum
2 answers
198 views
Hello Telerik Team,

I am using RadContextMenu inside RadDropDown , here is the code sinnipet ,
<Controls1:RadDropDownButton Name="Report" Content="Report" Margin="5,0,0,0" >
                 <Controls1:RadDropDownButton.DropDownContent >
                     <Controls2:RadContextMenu Name="ReportMenu" StaysOpen="False" ItemsSource="{Binding ReportList}" KeyboardNavigation.IsTabStop="True" />
                </Controls1:RadDropDownButton.DropDownContent>
             </Controls1:RadDropDownButton>

When navigating through keyboard , using "Tab" key once reached to Report DropDownButton , after that when pressing Down Arrow key able to see the menuitems added . But not able to select the menuitems.

What neededs to do to allow MenuItems to ve selected with keybaord.
Petar Mladenov
Telerik team
 answered on 07 Jun 2011
7 answers
215 views
Hi,

I am using VS 2010,Blend 4, Rad gridview version:2011.1.516.40, I have a rad gridview with multiple checkboxes and the header of the check box coloumn is toggle button, toggle button does select all check box and unselect all check box.  My question is i want to save the tube type and corresponding check items with the header toggle button content name:

ex: sample tube 2  , Is Checked =true, header name = Standard-4
sample tube 3  , Is Checked =true, header name = Standard-1

Bascially i want to save for the given sample what are the header names selected. How can i do it using RAD Grid view

FYI please see the attached image to have a better idea.

Thanks
Sarag.
Maya
Telerik team
 answered on 07 Jun 2011
5 answers
171 views
Steps to reproduce:

1) Subclass RadSlider as pasted in the code below, and put that control in a window as illustrated below.
2) Set a trace point in "OnSelectionRangeChanged" and output newValue.SelectionStart
3) Once the app is loaded expand the range selection so you can click and drag the selection
4) Click and drag the selection from right to left and observer SelectionStart, the value is not consistently 0.0 when you drag the selection to the beginning of the range unless you change the range itself (expand it). 

Code:

Subclassed RadSlider

public class JSlider : RadSlider
    {
        public JSlider()
        {
            IsSelectionRangeEnabled = true;
        }
 
        /// <summary>
        /// Raises the <see cref="E:System.Windows.FrameworkElement.SizeChanged"/> event, using the specified information as part of the eventual event data.
        /// </summary>
        /// <param name="sizeInfo">Details of the old and new size involved in the change.</param>
        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
        {
            base.OnRenderSizeChanged(sizeInfo);
 
            // setup the slider with the correct maximum based on our current available width
            Minimum = 0;
            Maximum = ActualWidth;
        }
 
 
        protected override void OnSelectionRangeChanged(SelectionRangeChangedEventArgs oldValue, SelectionRangeChangedEventArgs newValue)
        {
            base.OnSelectionRangeChanged(oldValue, newValue);
 
 
        }
    }

XAML

<Grid>
        <DockPanel>
            <WpfApplication15:JSlider DockPanel.Dock="Bottom" Height="200"/>
        </DockPanel>
    </Grid>
Petar Mladenov
Telerik team
 answered on 07 Jun 2011
8 answers
252 views
I'm evaluating RadDocking control.

I'm trying to persist layout data in userprofle and then reloading the layout.
When I'm reloading layout I'm observing that "name" or "tag"  or even other internal property for properly identification
at loading time doesn't serialize properly (They have empty value). I need an id property to be serialized to be able to restore the layout properly at deserialize (matching panel content hosting of dockingPanel layout with the proper UIElemets)
Sample code:
//Saving:
using (MemoryStream stream = new MemoryStream())
            {
                foreach (RadPane pane in dockPanelMgr.Panes)
                {
                    //I'm trying set-up Tag property for serialization if
                    pane.Tag = pane.Name;
                }
                dockPanelMgr.SaveLayout(stream);

ServiceProvider.Get<Settings>()
                    .Layout.LayoutSerialization =
                    UTF8Encoding.UTF8.GetString(stream.GetBuffer());
}

ServiceProvider.Get<Settings>().Save();

//Loading:

string layout = ServiceProvider.Get<Settings>().Layout.LayoutSerialization;

                using (MemoryStream ms = new MemoryStream(UTF8Encoding.UTF8.GetBytes(layout)))
                {
                                           dockPanelMgr.LoadLayout(ms);
}
Miroslav Nedyalkov
Telerik team
 answered on 07 Jun 2011
1 answer
76 views
Hi,

can we have a Treeview in the dropdown or look like dropdown?

when user click on the down arrow (on the dropdown), it should display the treeview.

Please let me know any example code or how to make it possible.

thanks,
Suman
Petar Mladenov
Telerik team
 answered on 07 Jun 2011
4 answers
73 views
Hello,
I´m adding columns into the grid through behindcode. I want to show group title but i dont want to show footer title, I´m try to do this in behindcode:

<telerik:GridViewDataColumn.Footer>
    <GridView:AggregateResultsList ItemsSource="{Binding}" VerticalAlignment="Center" Grid.Column="4">
        <ItemsControl.ItemTemplate>
            <DataTemplate>
                <TextBlock VerticalAlignment="Center" Text="{Binding FormattedValue}" />
            </DataTemplate>
        </ItemsControl.ItemTemplate>                           
    </GridView:AggregateResultsList>
</telerik:GridViewDataColumn.Footer>



I do this but it doesn´t work:

var bindingFooter = new Binding { Path = new PropertyPath("FormattedValue") };
var frameworkElementFactoryFooter = new FrameworkElementFactory(typeof(TextBlock));
frameworkElementFactoryFooter.SetBinding(TextBlock.TextProperty, bindingFooter);
frameworkElementFactoryFooter.SetValue(FrameworkElement.HorizontalAlignmentProperty, HorizontalAlignment.Right);

var dataTemplateFooter = new DataTemplate { VisualTree = frameworkElementFactoryFooter };

dataTemplateFooter.Seal();

var itemControl = new ItemsControl() { ItemTemplate = dataTemplateFooter };

 

var listaAgregada = new AggregateResultsList();
listaAgregada.Items.Add(itemControl);
gridViewDataColumn.Footer = listaAgregada;



Thanks

 

 

 

 

 

 

Gerardo
Top achievements
Rank 1
 answered on 06 Jun 2011
3 answers
119 views
Hi
I have GRidview with this Column
<telerik:GridViewDataColumn Header="In"  DataMemberBinding="{Binding TimeIn}" >
                                    <telerik:GridViewDataColumn.CellEditTemplate>
                                        <DataTemplate>
                                            <telerik:RadDateTimePicker Culture="en-GB"  SelectedDate="{Binding TimeIn}" TimeInterval="0:30:00" IsTooltipEnabled="False"/>
                                        </DataTemplate>
                                    </telerik:GridViewDataColumn.CellEditTemplate>
                                </telerik:GridViewDataColumn>

Now this column doesnt set SelectedDate to bounded date and i thought to do other way around on BeginningEdit routine.

I want to know how to get DateTimePicker control while edit mode to setup manually databound value to Datetimepicker.

anyhelp please.


Kind Regards:
Pavel Pavlov
Telerik team
 answered on 06 Jun 2011
16 answers
385 views
Please help...

I am trying to figure out how to do a simple RadPanelBar with 2 related tables. We will use Northwind as an example, using Categories and Products and Linq.

I want each Header to be the Category and within each area, the Products for that Category.It seems that this should be straight forward.

I am able to do the Headers, but cannot figure out the items.

Below is my code:
------------ Window1.xaml.cs -----------
using System.Linq;
using System.Windows;

namespace RadPanelTest
{
    public partial class Window1 : Window
    {
        private IQueryable<Category> listCategory;
        private IQueryable<Product> listProduct;

        public Window1()
        {
            InitializeComponent();
            Setup();
        }

        public void Setup()
        {
            this.DataContext = this;
            LinqTestDataContext ltdc = new LinqTestDataContext();
            ListCategory = from c in ltdc.Categories select c;
            ListProduct = from p in ltdc.Products select p;
        }

        public IQueryable<Category> ListCategory
        {
            get { return listCategory; }
            set { listCategory = value;}
        }

        public IQueryable<Product> ListProduct
        {
            get { return listProduct; }
            set { listProduct = value; }
        }
    }
}
---------------------------------
----------- Window1.xaml --------------------
<Window x:Class="RadPanelTest.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
    Title="Window1" Height="350" Width="500"
    >
    <Grid>
        <telerik:RadPanelBar Margin="0" ItemsSource="{Binding Path=ListCategory}" >
            <telerik:RadPanelBar.ItemTemplate>
                <HierarchicalDataTemplate >
                    <HeaderedContentControl>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding CategoryName}" />
                        </StackPanel>
                    </HeaderedContentControl>
                </HierarchicalDataTemplate>
            </telerik:RadPanelBar.ItemTemplate>
        </telerik:RadPanelBar>
    </Grid>
</Window>

Petar Mladenov
Telerik team
 answered on 06 Jun 2011
0 answers
104 views
I have a generic CellStyleSelector that is applying styles based on the value the cell is bound to. Column and Row Virtualization is enabled on the grid. My style selector is reading the value of cell. When SelectStyle is called the value of the cell does not match the value of the underlying property on the object to which the column is bound. This is causing the wrong styles to be displayed after the user scrolls the grid.

Code below

public class GridViewCellStyleSelector : StyleSelector
{
    public override Style SelectStyle(object item, DependencyObject container)
    {
        if (container is Telerik.Windows.Controls.GridView.GridViewCell)
        {
            return SelectMyStyleForValue(((GridViewCell)container).Value);
        }
        else
        {
            return null;
        }
    }
}

The value of the ((GridViewCell)container).Value does not match the property on the item. This need this to be a generic method, hence this method does not know what property to evaluate on the item parameter. Is there a way to read the property on the item which the cell is bound to? Or should the value of the cell be updated before SelectStyle is called? I understand that virtualization is replacing the values of the cells and I do not want to disable this feature as my grid has a lot of data. 

I am using the latest internal build binaries 2011.1.530.40

Thanks


Mat
Top achievements
Rank 1
 asked on 06 Jun 2011
0 answers
405 views

I' have a Grid with various columns. For eg. Grid havng a column with status. I want to enable / disable the buttons(edit button, cancel button) as per the status (that particular row selected). their are other columns in grid as wel. 

<Button x:Name="btnEdit" Content="Edit" Style="{StaticResource GreyButtonStyle}" IsEnabled="{Binding EditEnable}" >
          <i:Interaction.Triggers>
            <i:EventTrigger EventName="Click">
              <cmd:EventToCommand Command="{Binding Path=EditCustomerOrdersCommand}" PassEventArgsToCommand="True" />
            </i:EventTrigger>
          </i:Interaction.Triggers>
        </Button>
<Telerik:GridViewDataColumn DataMemberBinding="{Binding Status}" Header="Status" TextWrapping="NoWrap" Width="*" />


I' using MVVM Pattern.
Nikhil Jain
Top achievements
Rank 1
 asked on 06 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?