Telerik Forums
UI for WPF Forum
7 answers
444 views

Hi, I have implemented two custom FilteringControl(s) using the help in the docs and forums, one of them even need a custom FilterDescriptor. Now I want to mimic the style, even clone the same close button of the default FilteringControl so that it seems to be another control from telerik. Unfortunately I've been searching through the installed .xaml and cannot find the ControlTemplate for the dialog.

 

I would appreciate much if somebody could tell me where to find it.

 

Thanks.

 

David.

David
Top achievements
Rank 1
 answered on 07 Apr 2016
1 answer
97 views
trying to override the default border when the cell is selected, but in blend i can't find the gridviewcell control to change. i have the references to the data and gridview dlls. any idea?
Stefan Nenchev
Telerik team
 answered on 07 Apr 2016
3 answers
102 views

Hello,

I am experiencing a strange issue when I want to jump to a specific page using the PdfViewer.

OnDocumentChanged event, I set the CurrentPageNumber or call GoToPage(), but the result will be the end of the (page-1), a tiny line of that page and the page that I am requesting.

Example.

I want to jump to page 5. On first jump it shows ok, on second jump it shows a tiny line from page 4 and the page 5, but on the page counter (CurrentPageNumber) it has 4.

This only occurs on second call onward.

 

Is this a PdfViewer bug or is there another way I can go to a specific page?

Deyan
Telerik team
 answered on 07 Apr 2016
3 answers
117 views
Hello,

Is there a way to override the MouseDown for the ConnectionTool so it doesn't add the action to the UndoRedoService?  I would like to connection created by the ConnectionTool removed or not in the UndoStack.

Thanks!
Petar Mladenov
Telerik team
 answered on 07 Apr 2016
1 answer
181 views

Hi,

I am having the following issue with my Custom KeyboadCommandProvider for RadGridView: If the user presses Ctrl+Down key, i want to select the third column of the next row. Therefore i move down once, check if Ctrl is pressed and if so, move to the first column and then twice to the Right. The problem is, that the Move-Commands also factor in the pressed shift key. Therefore the selection moves to the bottom of the list, then to the right and then twice to the end of the row. My code looks as follows:

public class ScheduleKeyboardCommandProvider : DefaultKeyboardCommandProvider
{
    private GridViewDataControl parentGrid;

public ScheduleKeyboardCommandProvider(GridViewDataControl grid)
: base(grid)
{
this.parentGrid = grid;
}

public override IEnumerable<ICommand> ProvideCommandsForKey(Key key)
{
List<ICommand> commandsToExecute = base.ProvideCommandsForKey(key).ToList();
commandsToExecute.Clear();
bool ctrlIsPressed = (Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control;

if (key == Key.Down)
{
commandsToExecute.Add(RadGridViewCommands.MoveDown);
if (ctrlIsPressed)
{
// move to first column and then move right twice
commandsToExecute.Add(RadGridViewCommands.MoveFirst);
commandsToExecute.Add(RadGridViewCommands.MoveRight);
commandsToExecute.Add(RadGridViewCommands.MoveRight);
}
}

return commandsToExecute;
}

}

 

I would appreciate some tips. Thanks in advance.

Yoan
Telerik team
 answered on 07 Apr 2016
7 answers
528 views

I'm implementing a paged datasource successfully using a GridView + DataPager consuming a IPagedCollectionView, which is filled every time a page is requested with data from a REST-ish API. But I'm having trouble implementing filtering using the GridView's filter row, as it seems the default behavior of the GridView is to filter the data of the current page. I wanted to be able to just send the filters to the API, do the filtering + paging there, and return the data already filtered. In a nutshell I'm trying to use wpf's GridView like asp.net mvc's Grid (http://demos.telerik.com/aspnet-mvc/grid/index) which sends queries to the server via AJAX with the filters and sorts.

 

I already tried to implement ICollectionView, but the GridView still does what it normally does.

 

Handling the Filtering event of the GridView doesn't look like the right way to go, I either set e.Handled = true and get the same behavior, or set e.Cancel = true and refresh the data and the filtering information is cleaned. Can someone point me to the right direction / resources?

Fabrice
Top achievements
Rank 1
 answered on 07 Apr 2016
3 answers
113 views

Hi,

for the same date/time, for the same resource, I would like to know if it's possible to have to spaces, 1 to display an appointement and another one to display a comment and if it's possible to have to control on the width of each spaces!!!

 

What I'm trying to do is, in some circumstances, I need to display as an example and appointement at a specific time but I also need to display a comment to between time A and time B

 

ie: Apppointment for M. Test at 10:00AM and a comment from 9:00AM to 11:30 AM that says "Brings reports to the secretary after exams"

 

Thank's

Alain

Yana
Telerik team
 answered on 07 Apr 2016
7 answers
116 views

I am trying to change the background colour in a GridView as the data is loaded.

I think that I should be using 

 

        private void manualGridView_CellLoaded(object sender, Telerik.Windows.Controls.GridView.CellEventArgs e)
        {

        }

 

but I uncertain how to access the background colour from here and where I might test which column I am in and the cells value.  Any help is much appreciated.

Stefan Nenchev
Telerik team
 answered on 07 Apr 2016
1 answer
104 views

When a cell has  multi-lined wrapped text, and both vertical and grid extends beyond window size (have both vertical and horizontal scroll):

Scrolling vertical scroll to the bottom, then horizontal to the right causes the vertical scrollbar to jump away from bottom.

XAML

<Window x:Class="GridScrollbarIssue.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
        xmlns:TelerikGridView="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView"
        DataContext="{Binding RelativeSource={RelativeSource Self}}"
        Title="MainWindow" Height="350" Width="400">   
    
    <Grid>
        <TelerikGridView:RadGridView ItemsSource="{Binding Collection}" AutoGenerateColumns="False">
            <TelerikGridView:RadGridView.Columns>
                <TelerikGridView:GridViewDataColumn Header="Column 1" DataMemberBinding="{Binding Col1}" Width="125" IsFilterable="True" >
                    
                </TelerikGridView:GridViewDataColumn>                    
            <TelerikGridView:GridViewDataColumn Header="Column 2"  DataMemberBinding="{Binding Col2}" Width="125" IsFilterable="True" >
                    
                </TelerikGridView:GridViewDataColumn>             
            <TelerikGridView:GridViewDataColumn Header="Column 3"  DataMemberBinding="{Binding Col3}" Width="125" IsFilterable="True" >
                    
                </TelerikGridView:GridViewDataColumn>             
            <TelerikGridView:GridViewDataColumn Header="Column 4"  DataMemberBinding="{Binding Col4}" Width="125" IsFilterable="True" >
                    
                </TelerikGridView:GridViewDataColumn>
                <TelerikGridView:GridViewDataColumn Header="Column 5" DataMemberBinding="{Binding Col5}" Width="125" IsFilterable="True" TextWrapping="Wrap">
                    
                </TelerikGridView:GridViewDataColumn>                    
            </TelerikGridView:RadGridView.Columns>
        </TelerikGridView:RadGridView>
    </Grid>
</Window>

 

C#:
using System.Collections.ObjectModel;
using System.Windows;

namespace GridScrollbarIssue
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public ObservableCollection<Model> Collection { get; set; }
        public MainWindow()
        {
            Collection = CreateCollection();

            InitializeComponent();            
        }

        private static ObservableCollection<Model> CreateCollection()
        {
            return new ObservableCollection<Model>
            {
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},               
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                new Model {Col1 = "", Col2 = "col2", Col3 = "col3", Col4 = "col4", Col5 = ""},
                 new Model
                {
                    Col1 = "",
                    Col2 = "col2",
                    Col3 = "col3",
                    Col4 = "col4",
                    Col5 =
                        "test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test "
                },
            };
        }
    }

    public class Model
    {
        public string Col1 { get; set; }
        public string Col2 { get; set; }
        public string Col3 { get; set; }
        public string Col4 { get; set; }
        public string Col5 { get; set; }
    }
}


Maya
Telerik team
 answered on 07 Apr 2016
2 answers
292 views

Hi,

I am getting this exception and need help badly.

Scenario:

I have a table Users. Binded this entity to GridView.

I have one more table Roles. Id of Roles is foreignKey RoleID in Users.

Binded this as a combo-box column in GridView

this.radGridView.Columns.Add(new GridViewComboBoxColumn()
                            {
                                ItemsSourceBinding = new System.Windows.Data.Binding("Roles") { Source = this.DataContext },
                                DataMemberBinding = new System.Windows.Data.Binding("Role") ,
                                DisplayMemberPath = "Role",
                                SelectedValueMemberPath = "RoleID",
                                Header = "User-Role",
                                FilterMemberPath="RoleReconUserRoles.Role",
                                IsReadOnly=false,
                                Name = "gridView"
                            });

It works fine. But, when I change the item in the combo-box, and try to commit, it changes back to the original value because I get this ForeignKeyReferenceAlreadyHasValueException exception in the entity.

/// <summary>
        /// Gets or sets the Role column value.
        /// </summary>
        [System.Data.Linq.Mapping.Column(Name = "Role", Storage = "_role", DbType = "int NOT NULL", IsPrimaryKey = true, CanBeNull = false, UpdateCheck = System.Data.Linq.Mapping.UpdateCheck.Never)]
        [System.Runtime.Serialization.DataMember(Order = 3)]
        [System.CodeDom.Compiler.GeneratedCode("CodeSmith", "6.0.0.0")]
        public int Role
        {
            get { return _role; }
            set
            {
                if (_role != value)
                {
                    if (_roleReconUserRoles.HasLoadedOrAssignedValue)
                    {
                        throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
                    }
                    OnRoleChanging(value);
                    SendPropertyChanging("Role");
                    _role = value;
                    SendPropertyChanged("Role");
                    OnRoleChanged();
                }
            }
        }

 

Any help is appreciated!

Thanks in advance,

Sindhu

Sindhupriya
Top achievements
Rank 1
 answered on 07 Apr 2016
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?