Telerik Forums
UI for WPF Forum
1 answer
95 views
Telerik,

I have a WPF RadGridView that allows filtering and grouping of columns.  After grouping a column, I no longer see the filter icon, nor can I access the filtering of that grouped column.  I would like to see the same auto-filtering icon/functionality on the grouped column as the non-grouped columns.  How can I accomplish this task?

I have included a picture of my scenario.  There is a column on my grid with the title "From Plant" that is filterable and groupable.  Before grouping, I placed a filter on the column.  After applying the filter, I grouped the column.  Problem:  I don't see the filter icon after grouping "From Plant", nor can I access the filter popup.

Thanks,
Yoan
Telerik team
 answered on 04 Jun 2013
2 answers
146 views
Hi everyone,

I'm using the RadGridview component to display some data.
This grid is using the self-reference feature, some lines have children displayed in rows détails.

I added a screenshot example in attachment to expose my problem :
- The ID line 5 have 2 children in diferent cities (Paris and Bordeaux) ;
- I want to display (automatically via XAML) in the cell of the parent all children values for the column City, like this : "Paris, Bordeaux".

Is it possible ? If yes, how to do ?

Thanks for your help !

Regards,
Guillaume
Yoan
Telerik team
 answered on 04 Jun 2013
8 answers
304 views
When selecting a node, a dashed border is painted around it. How can I customize this border?
Zarko
Telerik team
 answered on 04 Jun 2013
9 answers
608 views
Hi there

I've a usercontrol with a gridview that is part of a Radpane. Now I want to disable touch scrolling in a specific situation. 
Is it possible to disable scrolling with your finger on a touchdevice? I tried Scrollviewer.panningmode="None", but this did not work. I'm using the latest version of the WPF Trial.

My gridview XAML code:
<telerik:RadGridView Grid.Row="1"
HorizontalAlignment="Stretch"
ItemsSource="{Binding Articles}"
AutoGenerateColumns="False"
ShowGroupPanel="False"
RowIndicatorVisibility="Collapsed"
CanUserDeleteRows="False"
CanUserInsertRows="False"
CanUserReorderColumns="False"
GridLinesVisibility="None"
BorderBrush="{x:Null}"
AllowDrop="{Binding CanReOrderRows}"
IsReadOnly="True"
IsFilteringAllowed="False"
CanUserFreezeColumns="False"
SelectionMode="{Binding GridViewSelectionMode}"
SelectedItem="{Binding ArticleModel, Mode=TwoWay}"
b:RowReorderBehavior.IsEnabled="{Binding CanReOrderRows, Mode=TwoWay}"
telerik:ScrollingSettingsBehavior.IsEnabled="True"
telerik:ScrollingSettingsBehavior.ScrollAreaPadding="30"
telerik:ScrollingSettingsBehavior.ScrollStep="24"
telerik:ScrollingSettingsBehavior.ScrollStepTime="00:00:00.05">
                <i:Interaction.Behaviors>
                    <b:ScrollIntoViewBehavior />
                </i:Interaction.Behaviors>
                <telerik:RadGridView.Columns>
                    <telerik:GridViewColumn IsVisible="{Binding IsGridViewDragDropColumnVisible}">
                        <telerik:GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <StackPanel>
                                    <Image>
                                        <Image.Style>
                                            <Style TargetType="{x:Type Image}">
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding IsTotal}"
                                                                 Value="False">
                                                        <Setter Property="Source"
                                                                Value="../Images/draggable-icon.gif" />
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </Image.Style>
                                    </Image>
                                </StackPanel>
                            </DataTemplate>
                        </telerik:GridViewColumn.CellTemplate>
                    </telerik:GridViewColumn>
                    <telerik:GridViewSelectColumn IsVisible="{Binding IsGridViewCheckBoxColumnVisible}" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Article.Name}"
                                                Header="Article"
                                                IsSortable="False"
                                                Width="*" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Article.Price, Converter={StaticResource ZeroPriceConverter}}"
                                                Header="ArticlePrice"
                                                IsSortable="False" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding Count}"
                                                Header="Count"
                                                IsSortable="False" />
                    <telerik:GridViewDataColumn DataMemberBinding="{Binding TotalPrice}"
                                                Header="Total"
                                                IsSortable="False" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>


Thanks in advance!

Greetings
Lowie
Lowie
Top achievements
Rank 1
 answered on 04 Jun 2013
9 answers
168 views
Hi,

 Pleasr help me to add a custom button to navigate after 10 pages at a strech.

Thanks,
Henry
Shinu
Top achievements
Rank 2
 answered on 04 Jun 2013
1 answer
107 views
Steps to reproduce:
1. Add to project telerik controls v2011.3.1220.40
2. Create DataView and bind to grid:
           
DataTable dt = new DataTable("test");
for (int i = 0; i < 10; i++)
{
    dt.Columns.Add("column" + i);
}
for (int i = 0; i < 10; i++)
{
    var row = dt.NewRow();
    for (int j = 0; j < 10; j++)
    {
        row[j] = j + i;
    }
    dt.Rows.Add(row);
}
dt.AcceptChanges();
 
Items = dt.AsDataView();

<Grid>   
     <
Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition Height="253*" />
    </Grid.RowDefinitions>
    <Button Command="{Binding UndoAllChanges}" Content="Undo all changes" Margin="10" HorizontalAlignment="Left" Padding="5,2" />
    <telerik:RadGridView ItemsSource="{Binding Items}" CanUserInsertRows="True" ShowInsertRow="True" Grid.Row="1" />
</Grid>


3. Add Undo function:
private ICommand _undoAllChanges;
public ICommand UndoAllChanges
{
    get
    {
        if (_undoAllChanges == null)
        {
            _undoAllChanges = new DelegateCommand(obj =>
            {
                Items.Table.RejectChanges();
                OnPropertyChanged("Items");
            });
        }
        return _undoAllChanges;
    }
}
4. To reproduce bug need to run application, sort by column1, add new item, set cell [ newRow, column1 ] to "1", click enter and then undo button.

P.S. I can't upload zip file because it's not allowed.
Yordanka
Telerik team
 answered on 04 Jun 2013
2 answers
131 views
Hello,

I am facing issue with RadListBox control styling issue when using Windows8Touch theme. Following is the description

1- I want to use different styles for each RadListBoxItem so I am using StyleSelector , It is working fine for all other themes, but as soon as I switch my application to Windows8Touch,  StylesSelector stopped working. On some drilling down I came to know that in Windows8Touch "StyleSelector.SelectStyle" is not being called.

2- Following is the code for StyleSelector

public class LstStyleSelector:StyleSelector
    {
        
public Style Red { get; set; }
        
public Style Blue { get; set; }
        
public override Style SelectStyle(object item, DependencyObject container)
        {
            
if (item != null)
            {
                
if (((KeyValuePair<int, string>)item).Key % 2 == 0)
                    
return Red;
                
else
                    return Blue;
            }
            
else
                return Red;
        }
    }

3- Following is the XAML

<Grid>
        <Grid.Resources>
            <Style x:Key="reditem" TargetType="{x:Type telerik:RadListBoxItem}">
                <Setter Property="Background" Value="Red"/>
            </Style>
           
            <Style x:Key="bluitem" TargetType="{x:Type telerik:RadListBoxItem}">
                <Setter Property="Background" Value="Blue"/>
            </Style>
            <local:LstStyleSelector x:Key="itemContainerStyle" Blue="{StaticResource bluitem}" Red="{StaticResource reditem}"/>
           
        </Grid.Resources>
        <telerik:RadListBox x:Name="lstbx" VerticalAlignment="Center" DisplayMemberPath="Value" ItemContainerStyleSelector="{StaticResource itemContainerStyle}"/>
    </Grid>

4- Here I am setting theme in App.xaml.cs

private void Application_Startup(object sender, StartupEventArgs e)
{
    
//StyleManager.ApplicationTheme = new Windows8TouchTheme(); //StyleSelector not working.
    StyleManager.ApplicationTheme = new Office_BlackTheme(); //StyleSelector working fine!
}

Please help me out on this issue. I am using Q1 2013.

Regards.
Muhammad Ummar
Top achievements
Rank 1
 answered on 04 Jun 2013
5 answers
1.4K+ views
I am having a terrible time expanding grid details.  I've looked through the documentation, and message boards (this seems to be a common theme), but nothing has worked so far.  Here's exactly what I want:

gridView.ItemsSource = orgList;
gridView.SelectedItem = orgList[0];
////  gridView.rows[0].Expand(); // <-- Yes, I know this doesn't exist, but pretty please add it.


Forget that last line; my issue here is that setting SelectedItem doesn't do anything.  Eventually I decided that something inside Telerik's code was still processing something and I split it up into a new threaded delegate:

gridView.ItemsSource = orgList;
Action a = delegate {
   gridView.SelectedItem = orgList[0];
};
Thread.Sleep(100);
App.Current.Dispatcher.Invoke(a, null);


This is a terrible solution because it uses a sleep, but it does FINALLY set the row.  Then I began working on expanding the row details:

gridView.RowDetailsVisibilityMode = GridViewRowDetailsVisibilityMode.Visible;
gridView.ItemsSource = orgList;
Action a = delegate {
   gridView.SelectedItem = orgList[0];
   gridView.UpdateLayout();
   var row = gridView.ItemContainerGenerator.ContainerFromItem(gridView.SelectedItem) as GridViewRow;
   if (row != null) {
      row.DetailsVisibility = Visibility.Visible;
      row.IsExpanded = true;
   }
};
Thread.Sleep(100);
App.Current.Dispatcher.Invoke(a, null);


Finally this worked and the grid row gets expanded.  Inside this grid row's details is another RadGridView.  I need to select a specific item here, and scroll it into view.  Here's what I am trying:

var row2 = row.ChildrenOfType<DetailsPresenter>().FirstOrDefault() as DetailsPresenter;
if (row2 != null) {
   var details = row2.Content as RadGridView;
   if (details != null) {
      details.SelectedItem = obj2;
      details.ScrollIntoView(obj2);
   }
}


The issue above is that "details" is always null.  The inner content of the grid has not yet rendered.  

Can't I make Telerik render it's grid synchronously in my method so that setting the item source sets up the grid before execution in my method continues?  Or so that expanding the row sets up the detail template contents before that execution continues?  If not, how can I ensure that it updates the details grid before I attempt to set that row?
Yoan
Telerik team
 answered on 04 Jun 2013
1 answer
149 views
Hello
I am a newbie in WPF RadChart. Currently I am doing a project where data will be displayed in stacked bar chart. I bound SeriesMappingCollection ViewModel property to SeriesMapping xaml property but it seems works only once (when viewmodel is instantiated)
I am unable to force chart to redraw itself when SeriesMappingCollection is feed with new portion of data.

XAML:
<telerik:RadChart
                        x:Name="DefectChart"
                        Grid.Row="1"
                        SeriesMappings="{Binding DiagramMappings}">
</telerik:RadChart>

ViewModel:
SeriesMappingCollection _mappings;
public SeriesMappingCollection DiagramMappings
{
    get
    {
        if (_mappings == null)
        {
            _mappings = new SeriesMappingCollection();
            var temp = new SeriesMappingCollection();
 
            var sm = new SeriesMapping();
            sm.SeriesDefinition = new StackedBarSeriesDefinition();
            sm.ItemMappings.Add(new ItemMapping("Category", DataPointMember.XCategory));
            sm.ItemMappings.Add(new ItemMapping("Data", DataPointMember.YValue));
            sm.ItemsSource = new List<ChartData>()
    {
        new ChartData("C1", 1),
        new ChartData("C2", 5),
        new ChartData("C3", 7)
    };
 
            temp.Add(sm);
 
            var sm2 = new SeriesMapping();
            sm2.SeriesDefinition = new StackedBarSeriesDefinition();
            sm2.ItemMappings.Add(new ItemMapping("Category", DataPointMember.XCategory));
            sm2.ItemMappings.Add(new ItemMapping("Data", DataPointMember.YValue));
            sm2.ItemsSource = new List<ChartData>()
    {
        new ChartData("C1", 10),
        new ChartData("C2", 7),
        new ChartData("C3", 18)
    };
            temp.Add(sm2);
            this._mappings = temp;
        }
        return _mappings;
    }
    set
    {
        _mappings = value;
        NotifyOfPropertyChange(() => DiagramMappings);
    }
}

in getter I am using the mocked data, and this is drawn on chart, but after update of the SeriesMappingCollection next time chart doesn't reflect any changes.


Mocked chart data (btw taken from on of your examples)

public class ChartData
    {
        public ChartData(string c, double d)
        {
            this.Category = c;
            this.Data = d;
        }
 
        public string Category { get; set; }
        public double Data { get; set; }
    }


Thanks in advance for help.
Regards
Petar Marchev
Telerik team
 answered on 04 Jun 2013
1 answer
255 views
Hello, I am trying to get byte code of QR but I faced issue.
It's standard sample from telerik

var qRCode = new RadBarcodeQR();
qRCode.ErrorCorrectionLevel = QRClassLibrary.Modes.ErrorCorrectionLevel.H;
qRCode.Mode = QRClassLibrary.Modes.CodeMode.Byte;
qRCode.Version = 2;
 
qRCode.Text = "TestText";
 
const string extension = "png";
var dialog = new SaveFileDialog()
{
    DefaultExt = extension,
    FileName = "QRBarCode",
    Filter = "Png (*.png)|*.png"
};
 
if (dialog.ShowDialog() == true)
{
    using (var stream = dialog.OpenFile())
    {
        ExportExtensions.ExportToImage(qRCode, stream, new PngBitmapEncoder());
    }
}

But I have got the next Exception 

The parameter value must be greater than zero.
Parameter name: pixelWidth

   at System.Windows.Media.Imaging.RenderTargetBitmap..ctor(Int32 pixelWidth, Int32 pixelHeight, Double dpiX, Double dpiY, PixelFormat pixelFormat)
   at Telerik.Windows.Media.Imaging.ExportHelper.GetBitmapSource(FrameworkElement element, Double dpiX, Double dpiY) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\ExportExtensions\ExportHelper.cs:line 97
   at Telerik.Windows.Media.Imaging.ExportHelper.GetElementImage(FrameworkElement element) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\ExportExtensions\ExportHelper.cs:line 70
   at Telerik.Windows.Media.Imaging.ImageExporter.Export(FrameworkElement element, Stream stream, BitmapEncoder encoder) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\ExportExtensions\ImageExporter.cs:line 12
   at Telerik.Windows.Media.Imaging.ExportExtensions.ExportToImage(FrameworkElement element, Stream stream, BitmapEncoder encoder) in c:\TB\221\WPF_Scrum\Release_WPF\Sources\Development\Core\Controls\ExportExtensions\ExportExtensions.cs:line 100
   at WpfApplication1.MainWindow.ButtonBase_OnClick(Object sender, RoutedEventArgs e) in c:\Users\smile\Documents\Visual Studio 2012\Projects\WpfApplication1\WpfApplication1\MainWindow.xaml.cs:line 352
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
   at System.Windows.Controls.Primitives.ButtonBase.OnClick()
   at System.Windows.Controls.Button.OnClick()
   at System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.Run()
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   at WpfApplication1.App.Main() in c:\Users\smile\Documents\Visual Studio 2012\Projects\WpfApplication1\WpfApplication1\obj\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()



What am I doing wrong?
I need to get the byte[] of image source (QR, BaCode and so on), could you give me sample of code what I need to do, please? (NOT LINK, I want to see a working example)
Thank You
Yavor
Telerik team
 answered on 04 Jun 2013
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
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?