Telerik Forums
UI for WPF Forum
7 answers
405 views
Hi all,

Now I want to create such a below window, see attached file. Basically, it has a different style of Min, Max and Close button. I want to know how do this.

Thanks,
Arthur
Polya
Telerik team
 answered on 24 Dec 2014
1 answer
211 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
337 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
303 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
289 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
460 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
502 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
496 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
142 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
268 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
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
DataPager
PersistenceFramework
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
InlineAIAssistant
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?