Telerik Forums
UI for WPF Forum
1 answer
161 views
If we select more than one field then data is displaying with column headers without any problem. But if we select only one Field from the list the column header is showing Grand Total instead of showing the Field description of the selected item from the Rad Pivot Fields List.

Please help to solve this issue.
Polya
Telerik team
 answered on 24 Dec 2014
2 answers
280 views
Hi guys,
I have a dialog that adds an item to the RadGridView in code behind. I immediately refresh the gvproperties items and search for the newly added item, but it is not present. I want to set the current and selected item to the new item, but indexof() fails. It returns null. Can you see what I might be doing wrong?

 var addWell = new frmAddWellAssignment(_dataContext.SelectedUser.UserID.Trim(), false);

 var assignmentAdded = addWell.ShowDialog();

   if (assignmentAdded == true) {
                _dataContext.LoadAssignments();
            }

// RMH: Select the newly added item in the RadGridView

gvProperties.Items.Refresh();

var item = gvProperties.Items[gvProperties.Items.IndexOf(addWell.PropertyID)];

gvProperties.SelectedItem = item;
Dimitrina
Telerik team
 answered on 24 Dec 2014
6 answers
225 views
Hi Team,
Could you please help us on below issue :

1) I have typed the word "testing"

2) Deleted "ing" and the current text is "test"

3) When I see the "Undo", It shows all the operations, like shown in the attachment "Undo - Dropdown.png"

4) Please suggest us the way to disable this "Undo" Dropdown, We like to shown only the "Undo" button (without dropdown)

Thanks,
Obuliraj Ramalingam
Ramalingam
Top achievements
Rank 1
 answered on 24 Dec 2014
2 answers
252 views
Hi team,

I have following codes
<telerik:RadGridView x:Name="HistoryData" GroupRenderMode="Flat"
                             GridLinesVisibility="Vertical"
                             ColumnWidth="50"
                             CanUserFreezeColumns="False"
                             AutoGenerateColumns="False"
                             AutoExpandGroups="True"
                             IsFilteringAllowed="True"
                             ShowGroupPanel="False"
                             RowIndicatorVisibility="Collapsed"
                             d:DataContext="{d:DesignData Source=../SampleData/SampleData.xaml}"
                             >

The sample data and the corresponding types are all ready. 
But I see no data in the design time window of grid view. 
Anything I am missing?
Jackey
Top achievements
Rank 1
 answered on 24 Dec 2014
3 answers
397 views
Hi,

I have a problem when setting my DisplayMemberPath:

<t:RadAutoCompleteBox x:Name="AutoCompleteBox" Grid.Row="2" Grid.ColumnSpan="3"
                                         ItemsSource="{Binding Suggests}"
                                        SearchText="{Binding TextSearch, Mode=TwoWay}"
                                        SelectedItem="{Binding SelectedSuggest, Mode=TwoWay}"
                                    TextSearchPath="SearchPath" DisplayMemberPath="Name">
                <t:RadAutoCompleteBox.DropDownItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <TextBlock Text="{Binding Name}" />
                            <TextBlock Text=" - " />
                            <TextBlock Text="{Binding Code}" />
                        </StackPanel>
                    </DataTemplate>
                </t:RadAutoCompleteBox.DropDownItemTemplate>
            </t:RadAutoCompleteBox>


In the code above, all is working fine, except that when i have selected an item, the text displayed is the one in my SearchPath property, and not the one in my Name property.
What did i do wrong?
Polya
Telerik team
 answered on 23 Dec 2014
4 answers
405 views
I have a radgrid with sometimes 1000+ items, I want to be able to add new items like http://docs.telerik.com/devtools/wpf/controls/radgridview/managing-data/images/RadGridView_AddingNewItems_1.png but if possible, I would like "new" row to always be visible even though I am scrolling up and down

Also I am not writing anything in my codebehind so if possible it should be pure xaml/commands

Also not sure why CanUserInsertRows="True" do not show anything in the UI

<radBusyIndicator:DmsRadBusyIndicator
    IsBusy="{Binding Path=WaterBucketIsBusy}"
    BusyContent="{Binding Path=WaterBucketIsBusyMessage}"
    Grid.Column="0"
    Grid.Row="0"
    Margin="9">
    <telerik:RadGridView
        AutoGenerateColumns="False"
        CanUserInsertRows="True"
        
        ItemsSource="{Binding Path=WaterBuckets}">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn
                DataMemberBinding="{Binding Path=Id}"
                IsReadOnly="True"
                Header="{x:Static localization:WaterBucketTexts.Bucket}">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate DataType="dom:PBucketModel">
                        <TextBlock
                            Text="{Binding Path=Id}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn
                DataMemberBinding="{Binding Path=BullId}"
                IsReadOnly="True"
                Header="{x:Static localization:WaterBucketTexts.BullId}">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate DataType="dom:PBucketModel">
                        <TextBlock
                            Text="{Binding Path=BullId}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn
                DataMemberBinding="{Binding Path=WaterType}"
                IsReadOnly="True"
                Header="{x:Static localization:WaterBucketTexts.WaterType}">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate DataType="dom:PBucketModel">
                        <TextBlock
                            Text="{Binding Path=WaterType.WaterName}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn
                DataMemberBinding="{Binding Path=Spent}"
                IsReadOnly="True"
                Header="{x:Static localization:WaterBucketTexts.Spent}">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate DataType="dom:PBucketModel">
                        <TextBlock
                            Text="{Binding Path=Spent}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
            <telerik:GridViewDataColumn
                DataMemberBinding="{Binding Path=Delivered}"
                IsReadOnly="True"
                Header="{x:Static localization:WaterBucketTexts.Delivered}">
                <telerik:GridViewDataColumn.CellTemplate>
                    <DataTemplate DataType="dom:PBucketModel">
                        <TextBlock
                            Text="{Binding Path=Delivered}" />
                    </DataTemplate>
                </telerik:GridViewDataColumn.CellTemplate>
            </telerik:GridViewDataColumn>
        </telerik:RadGridView.Columns>
    </telerik:RadGridView>
Dimitrina
Telerik team
 answered on 23 Dec 2014
1 answer
412 views
Hi,

i use a RadGridView and your "Header Context Menu" Example, where you can show or hide Columns. I have 10 Columns, 5 of them are
"IsVisible = False". On right click of GridViewHeader i can choose the other 5 columns. This works fine.

public class GridViewHeaderMenu
    {
        private readonly RadGridView grid = null;
 
        public GridViewHeaderMenu(RadGridView grid)
        {
            this.grid = grid;
        }
 
        public static readonly DependencyProperty IsEnabledProperty
           = DependencyProperty.RegisterAttached("IsEnabled", typeof(bool), typeof(GridViewHeaderMenu),
               new PropertyMetadata(new PropertyChangedCallback(OnIsEnabledPropertyChanged)));
 
        public static void SetIsEnabled(DependencyObject dependencyObject, bool enabled)
        {
            dependencyObject.SetValue(IsEnabledProperty, enabled);
        }
 
        public static bool GetIsEnabled(DependencyObject dependencyObject)
        {
            return (bool)dependencyObject.GetValue(IsEnabledProperty);
        }
 
        private static void OnIsEnabledPropertyChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
        {
            RadGridView grid = dependencyObject as RadGridView;
            if (grid != null)
            {
                if ((bool)e.NewValue)
                {
                    // Create new GridViewHeaderMenu and attach RowLoaded event.
                    GridViewHeaderMenu menu = new GridViewHeaderMenu(grid);
                    menu.Attach();
                }
            }
        }
 
        private void Attach()
        {
            if (grid != null)
            {
                // create menu
                RadContextMenu contextMenu = new RadContextMenu();
                // set menu Theme
                StyleManager.SetTheme(contextMenu, StyleManager.GetTheme(grid));
 
                contextMenu.Opened += OnMenuOpened;
                contextMenu.ItemClick += OnMenuItemClick;
 
                RadContextMenu.SetContextMenu(grid, contextMenu);
            }
        }
 
        void OnMenuOpened(object sender, RoutedEventArgs e)
        {
            RadContextMenu menu = (RadContextMenu)sender;
            GridViewHeaderCell cell = menu.GetClickedElement<GridViewHeaderCell>();
 
            if (cell != null)
            {
                menu.Items.Clear();
 
                RadMenuItem item = new RadMenuItem();
                item.Header = String.Format(@Klassen.Language.GetTextbyCode("SortAufsteigend") + cell.Column.Header);
                menu.Items.Add(item);
 
                item = new RadMenuItem();
                item.Header = String.Format(@Klassen.Language.GetTextbyCode("SortAbsteigend") + cell.Column.Header);
                menu.Items.Add(item);
 
                item = new RadMenuItem();
                item.Header = String.Format(@Klassen.Language.GetTextbyCode("SortClear") + cell.Column.Header);
                menu.Items.Add(item);
                 
                item = new RadMenuItem();
                item.Header = Klassen.Language.GetTextbyCode("ChooseColumns");
                menu.Items.Add(item);
 
                // create menu items
                foreach (GridViewColumn column in grid.Columns)
                {
                    RadMenuItem subMenu = new RadMenuItem();
                    subMenu.Header = column.Header;
                    subMenu.IsCheckable = true;
                    subMenu.IsChecked = true;
 
                    Binding isCheckedBinding = new Binding("IsVisible");
                    isCheckedBinding.Mode = BindingMode.TwoWay;
                    isCheckedBinding.Source = column;
 
                    // bind IsChecked menu item property to IsVisible column property
                    subMenu.SetBinding(RadMenuItem.IsCheckedProperty, isCheckedBinding);
 
                    item.Items.Add(subMenu);
                }
            }
            else
            {
                menu.IsOpen = false;
            }
        }
 
        void OnMenuItemClick(object sender, RoutedEventArgs e)
        {
            RadContextMenu menu = (RadContextMenu)sender;
 
            GridViewHeaderCell cell = menu.GetClickedElement<GridViewHeaderCell>();
            RadMenuItem clickedItem = ((RadRoutedEventArgs)e).OriginalSource as RadMenuItem;
            GridViewColumn column = cell.Column;
             
            if (clickedItem.Parent is RadMenuItem)
                return;
 
            string header = Convert.ToString(clickedItem.Header);
 
            using (grid.DeferRefresh())
            {
                ColumnSortDescriptor sd = (from d in grid.SortDescriptors.OfType<ColumnSortDescriptor>()
                                           where object.Equals(d.Column, column)
                                           select d).FirstOrDefault();
 
                if (header.Contains("Sort Ascending"))
                {
                    if (sd != null)
                    {
                        grid.SortDescriptors.Remove(sd);
                    }
 
                    ColumnSortDescriptor newDescriptor = new ColumnSortDescriptor();
                    newDescriptor.Column = column;
                    newDescriptor.SortDirection = ListSortDirection.Ascending;
 
                    grid.SortDescriptors.Add(newDescriptor);
                }
                else if (header.Contains("Sort Descending"))
                {
                    if (sd != null)
                    {
                        grid.SortDescriptors.Remove(sd);
                    }
 
                    ColumnSortDescriptor newDescriptor = new ColumnSortDescriptor();
                    newDescriptor.Column = column;
                    newDescriptor.SortDirection = ListSortDirection.Descending;
 
                    grid.SortDescriptors.Add(newDescriptor);
                }
                else if (header.Contains("Clear Sorting"))
                {
                    if (sd != null)
                    {
                        grid.SortDescriptors.Remove(sd);
                    }
                }
            }
        }
    }

But how do i save the condition, which column is visible and which one not?

Thanks
Best Regards
Rene
Dimitrina
Telerik team
 answered on 23 Dec 2014
4 answers
104 views
I am using telerik uı for wpf in my application.I can run my application properly.But ı cant  see my pages in design mode. İnvalid markup error because of telerik features.

Best regards
Erhan
Top achievements
Rank 1
 answered on 23 Dec 2014
5 answers
190 views
Hello,
My company is attempting to implement an experience with the RadGridView that I'm struggling with. Currently on all of our grids we define a set of 'data' columns that are simple columns that display values; after the data columns we then define a column that contains several buttons (ex. edit, delete, etc.) that are only visible when the given row is selected. This experience is unacceptable since in scenarios where many 'data' columns exist the user has to scroll all the way to the right of the grid in order to see the 'action' column.

The desired experience is that when a row is selected the 'action' column appears at the right edge of the grid regardless of any scrolling that can take place on the 'data' column set.

I've been spinning my wheels for quite a while now and am out of ideas to make this work. The block I keep running in to is that the GridViewRow has no idea of the size of the ScrollViewer so it cannot place the column in the correct place on the screen, and the
GridViewScrollViewer has no idea what row is selected so it cannot place the buttons correctly. I might be able to make a seperate GridViewVirtualizingPanel to hold the 'action' column set but I don't think I would be to communicate which row is selected between the two Panels simply.

If a 'frozen' column could be placed at the right of the grid I think I could get the experience we want but that doesn't appear to be supported.

Is there a simple way to implement this experience that I haven't thought of? Thanks,Jason
Vanya Pavlova
Telerik team
 answered on 23 Dec 2014
3 answers
90 views
hi to everybody
i tried to use indicators to my project with get help demo telerik
i createing some class .for instance FinancialIndicatorSwitch  and FinancialSeriesTypeSwitch and etc
but when i start i get this error
Error    2    A 'Binding' cannot be used within a 'RadCartesianChart' collection. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.    C:\Users\masoud\Documents\Visual Studio 2013\Projects\exercise_telerik\testchart\testchart\View\indacator.xaml    36    36    testchart

it say problem is in dependencyproperty that define in class and use in view
where this dp use in view in define here
<chart:RadCartesianChart x:Name="RadChart1" Palette="Windows8" Margin="20,0,8,0"
                                   example:FinancialIndicatorSwitch.MainIndicator="{Binding MainIndicator, Mode=TwoWay}"
                                   example:FinancialSeriesTypeSwitch.SeriesType="{Binding SeriesType}"
 
 
and
 
        <chart:RadCartesianChart x:Name="RadChart2" Palette="Windows8" Grid.Row="1" Margin="20,10,8,0"
                                   example:FinancialIndicatorSwitch.SecondaryIndicator="{Binding SecondaryIndicator, Mode=TwoWay}">

i tried to solution this  error but i was unsuccessful 
please help me
Petar Marchev
Telerik team
 answered on 23 Dec 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?