Telerik Forums
UI for WPF Forum
1 answer
119 views
Hi,
         I am facing issue while working with Localization, my scenario is as follows:
=> I am having Rad DataGrid and we are binding the columns dynamically, while binding I am handling the localization in code behind from the resx file.
The scenario in which  I am facing issue is for certain columns I need to change color  of some rows depending on certain condition. To achieve this  I hardcode the column name and it was working fine by using a converter. But as I can't hardcode the column name I need to use localization and get the results which I am not able to achieve. here is the sample code how we I approached it when I hardcoded

<telerik:RadGridView.RowStyle>
                                       <Style TargetType="telerik:GridViewRow">
                                           <Setter Property="Background" Value="{Binding Status,Converter={StaticResource rowcolorConveter}}"></Setter>
                                           <Setter Property="Background" >
                                               <Setter.Value>
                                                   <MultiBinding Converter="{StaticResource ABCConveter}">
                                                       <Binding Path="abc"/>//Hardcode Column Name
                                                       <Binding Path="DataContext.SelectedView" RelativeSource="{RelativeSource AncestorType={x:Type UserControl}}"/>
                                                   </MultiBinding>
                                               </Setter.Value>
                                           </Setter>
                                           
                                       </Style>
                                   </telerik:RadGridView.RowStyle>


If u observe I hardcode the "abc" value while binding.I want to pull this hardcode colum name from from resx file and get the value of the column.



Maya
Telerik team
 answered on 17 Jun 2013
1 answer
135 views
Hello,

Started from how-to-bind-custom-observablecollection-to-radribbonsplitbutton, now I want to add a sub menu item.

I could still use a RadMenuItem-based object for the sub menu item? I will also know what the parent menu item should be.

However, I don't know which elements, properties, etc, to add the sub menu item to?

Thank you...

Regards,

Michael Powell
Travis
Top achievements
Rank 1
 answered on 16 Jun 2013
2 answers
158 views
Hello,

I've got a custom ObservableCollection I want to bind to using RadRibbonSplitButton.

Is there a simple example how to bind a collection to a RadRibbonSplitButton (or RadSplitButton?) DropDown data context?

Thanks!

Regards,

Michael Powell
Travis
Top achievements
Rank 1
 answered on 16 Jun 2013
1 answer
87 views
Is there a control like a split button (button+menu) for use with the RadRibbonView? I am using the RadRibbonButtons of course, but one of them I would like to use as a split button and drop down a menu. Thank you...
Travis
Top achievements
Rank 1
 answered on 15 Jun 2013
9 answers
306 views

I have a RadGridView bound to ObservableCollection. This collection is constantly updated and on first binding the grid represent the data correctly. But then I click on one of the headers to sort the data in the grid. After that behaviors on adding a new row become as following:
-  the grid adds the row to the end of the list only, it doesn't sort data dynamically according sorting column;
- sometimes (often) the grid creates duplicate rows while underlying collection contains correct data;

I couldn't find in documentation any info that I should programmatically sort underlying collection each time after adding row or rebind it every time so the grid shows it correctly. What should I do to fix it or it\s a norm for Telerik Grid?

Carolina
Top achievements
Rank 1
 answered on 14 Jun 2013
0 answers
53 views
Hi.

We have an implementation of Drag&Drop of items from outlook to a treeview using the telerik DragDropManager.

xaml code:
<telerik:RadTreeView ItemPrepared="OnItemPrepared" .../>

code-behind:
        protected void OnItemPrepared(object sender, RadTreeViewItemPreparedEventArgs e)
        {
            if (e.PreparedItem.AllowDrop)
            {
                e.PreparedItem.DragEnter += OnPreparedItemDragEnter;
                e.PreparedItem.Drop += OnPreparedItemDrop;
            }
        }


We then have a function : OnPreparedItemDrop(object sender, DragEventArgs args)
...Where I want to launch a new dialog and add some metadata to the files dragged in.

When using a dialog.ShowDialog() the calling thread here freezes. This causes the source application(outlook) to be completely unresponsible until my dialog has been closed and the function returns. It also leaves the mouse cursor in "drag-drop" mode when hovering stuff outside my application.

I am fond of this style of opening and handlign dialog outputs:

if(dialog.ShowDialog == true)
{
    DoSomething();
}
DoCleanup();



The alternative I see at the moment is to add logic to the view cancel/close events to do cleanup, or mess with the dispatcher and threading. What is the proper approach here?
Jan Terje
Top achievements
Rank 1
 asked on 14 Jun 2013
1 answer
112 views
Hello,

I'm implementing a RadCartesianChart with dynamic ChartDataSource and data sampling.
Everything's fine but I'd like to sample via a sum function and not via the default average one.
So I created a new SumBarSeries which inherits from BarSeries as shown below :

public class SumBarSeries : BarSeries
{
    protected override ChartAggregateFunction GetValueAggregateFunction()
    {
        return new ChartSumFunction();
    }
}

There's a min, max, average, keepextremes,  first and last function but no sum function.
Is there a simple way to add such a function?
Furthermore is it possible to change dynamically the sampling function just like the old RadCharts without changing the BarSeries class (ie. SumBarSeries)?

Thanks,

Michel LACOMBE
Michel
Top achievements
Rank 1
 answered on 14 Jun 2013
3 answers
141 views
Hi,

I've been experimenting a little with the PersistenceFramework over the course of the day and I've found some, according to me,
mystic behaviour.

When the window containing my RadGridView closes I run this code:
var manager = new PersistenceManager();
var stream = manager.Save(dgOrderOverview);
 
using (var fileStream = File.Create(System.AppDomain.CurrentDomain.BaseDirectory + "\\objstore.hf"))
{
    stream.CopyTo(fileStream);
}

and when I open it up again the following code is run:
//Check if any persistence file exists, and if so, load the view
if (File.Exists(System.AppDomain.CurrentDomain.BaseDirectory + "\\objstore.hf"))
{
    var manager = new PersistenceManager();
 
    try
    {
        var fileStream = File.OpenRead(System.AppDomain.CurrentDomain.BaseDirectory + "\\objstore.hf");
        manager.Load(dgOrderOverview, fileStream);
        fileStream.Close();
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.WriteLine(ex.Message, "MYAPPNAME");
    }
}
 
//Load Context Menu
RadContextMenu ctxMenu = new RadContextMenu();
RadMenuItem item = new RadMenuItem();
 
foreach (Telerik.Windows.Controls.GridViewColumn column in dgOrderOverview.Columns)
{
    RadMenuItem sitem = new RadMenuItem() { Header = column.Header, IsCheckable = true, IsChecked = true };
    sitem.SetBinding(RadMenuItem.IsCheckedProperty, new Binding("IsVisible") { Mode = BindingMode.TwoWay, Source = column });
    ctxMenu.Items.Add(sitem);
}
 
RadContextMenu.SetContextMenu(dgOrderOverview, ctxMenu);

For the sake of things it should be noted that I have a RadContextMenu loading in order to be able to show/hide columns in the RadGridView.

Now, here's to the tricky bit, I have a RadContextMenu where the user can set the visibility of the columns, and IF the user ONLY uses this, everything is fine and dandy, visibility properties as set as they should upon reload. However IF the user decides to rearrange the columns, the next time he/she opens up the window, ALL columns are gone, there's NOTHING there at all.

So in short:
* Show / Hide columns using the RadContextMenu bound to the RadGridView works fine, persistence is kept and loads nicely.
* Rearrange columns and the persistence is broken and no columns as viewable upon opening the window.

As a little twist, the columns are all visible in the ContextMenu and their visibility are set as they should, but the GridView doesn't display them.

A little help, please?

P.S
I run the following version of the Telerik components:
RadControls_for_WPF_2013_1_0527_DEV_hotfix
D.S
Johannes
Top achievements
Rank 1
 answered on 14 Jun 2013
1 answer
51 views
Hi,

Demo 2013 Q2 Final Issue Style Changing Touch Demo to Default, This Issue does not exist Demo 2013 Q2 Beta, Please see screenshot.
OS : Windows 8 x64

Thanks.
Stanislav
Telerik team
 answered on 14 Jun 2013
2 answers
229 views
Hi,

I'm Synchronization RadListbox and RadDataForm SelectedItem 0 not highlight i'm trying MS ListBox not problem.

Thanks.
<telerik:RadDataForm x:Name="dataForm" ItemsSource="{Binding Items}"/>
<telerik:RadListBox x:Name="ListBox" ItemsSource="{Binding Items}" SelectedIndex="0" />
 
  
 
        private ICollectionView _items;
        public ICollectionView Items
        {
            get
            {
                if (_items== null)
                {                   
                   Items = new QueryableCollectionView(new ObservableCollection<Contact>(RepositoryBase.Context.Contacts));
                }
                return _items;
            }
            set
            {
                if (Equals(value, _items)) return;
                _items= value;
                NotifyOfPropertyChange(() => Items);
            }
        }
Steve
Top achievements
Rank 1
 answered on 14 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?