Telerik Forums
UI for WPF Forum
1 answer
110 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
304 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
15 answers
808 views
Using a datafilter.filteredsource(datatable.defaultview) as grid itemsource and adding column.AggregateFunctions at runtime is it possible to make the CountFunction count only distinct items (strings or numbers) or do you have to create a custom EnumerableSelectorAggregateFunction inherited class?

If you do have to create the custom aggregate function, how would one go about that in my conditions?
Daniel B.
Top achievements
Rank 1
 answered on 07 Apr 2016
1 answer
151 views

I'm trying to load xlsx document about 15MB size - spreadsheet is hung. All documents larger than 1 MB is very slow loaded.

Please tell me how to speed up downloading large documents (more that 1MB)?

Thanks.

Boby
Telerik team
 answered on 06 Apr 2016
2 answers
229 views

Hi,

We are currently using Telerik () RadGridview for our WPF client application. The data is displayed in ScheduleView format for users as Weeks/Days where user can create a block (Tile) on a specific day and time. Once the block is created on the grid user can select the block and edit the contents. The data that is binded to the grid is coming from SQL Server database which is common to all the users who are using this client application and Schedule Grid.

Our business requirement is, when a particular user has open this schedule grid on his screen, he see all the blocks created by different users including his own blocks. User should be able to edit his block and at the same time all other blocks on the screen inside the grid should be auto refreshed (may be after 1 min) to reflect the changes saved in DB by other users that too without restricting the user to edit his own block and without locking the UI. User should be still allowed to continue his edit operation when auto refresh is happening for other changed blocks...

Is it possible in Telerik Radgrid (any version) to auto refresh (every after 1 min) entire contents except the the one user is editing without locking the UI?

Any help is appreciated...

amrish
Top achievements
Rank 1
 answered on 06 Apr 2016
0 answers
167 views

Hello,

In a project I use RadDateTimePicker (InputMode="DatePicker", DateTimeWatermarkContent="Custom watermark") as a separate control and as a part of DataTemplate for items in ListBox (ItemsControl). Initially I used version 2013.3, then I tried to use version 2015.2. Separate controls work fine. But RadDateTimePicker in DataTemplate began to display "EnterDate" for watermark content. The only thing I changed was Telerik dlls of another version.

<Window x:Class="RadDateTimePickerDemo.MainWindow"
        xmlns:local="clr-namespace:RadDateTimePickerDemo"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="500">
     
    <Grid Margin="10">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150"/>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="160"/>
        </Grid.ColumnDefinitions>
 
        <telerik:RadDateTimePicker VerticalAlignment="Top" Margin="0,2,0,0"
            InputMode="DatePicker"
            DateTimeWatermarkContent="Custom watermark"/>
 
        <ListBox x:Name="listBox" Grid.Column="2"
                 HorizontalContentAlignment="Stretch"
                 BorderThickness="0" Padding="0">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <telerik:RadDateTimePicker
                        InputMode="DatePicker"
                        DateTimeWatermarkContent="Custom watermark"/>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
    </Grid>
</Window>

I attached screenshots for different versions. Project's .net version - 4.6, Windows 10, 64bit.

Regards,
Andrey

Andrey
Top achievements
Rank 1
 asked on 06 Apr 2016
9 answers
208 views

Hey,

 I have a button that changes my appointment start and end times between UTC and Local to a slected Timezone. The button updates the appointments correctly but I cannot get the UI to update accordingly. I have noticed that a forum post from two years ago address' this problem but it did not look like a solution was found as I too am using MVVM. 

Any suggestions?

 Thanks,

Cameron

Andrey
Top achievements
Rank 1
 answered on 06 Apr 2016
1 answer
411 views

Hello

is it possible to display and edit numbers using a scientific notation in NumericUpDown? how can i do that?

Yana
Telerik team
 answered on 06 Apr 2016
1 answer
185 views

I created a some function inherited from the FunctionBase: 

public class MyFunc : FunctionBase

And i want to return result into two cells: 

return new ArrayExpression(new RadExpression[,] { { new StringExpression("123"), new StringExpression("321") } });

But when i use my function in spreadsheet, only one cell correctly filled. I expect that will be filled with a range of two cells "123" and "321".

How to correctly fill range of cells from MyFunc?

 

Thank you.

 

Deyan
Telerik team
 answered on 06 Apr 2016
3 answers
221 views
Found the issue: User settings was storing a layout with CanUserClose set to false

The XAML below does everything we want except the close button on a floating window is always disabled. We manage the IsHidden property from the menu but users still complain that the close button on a floating window does not do anything. I need to either hide it or make it do what they expect, which is hide the pane, or pin it.


<telerik:RadDocking x:Name="radAppointmentDocking" Grid.Row="0" Grid.Column="0">
            <telerik:RadDocking.DocumentHost>
                <telerik:RadSplitContainer>
                    <telerik:RadPaneGroup>
                        <telerik:RadPane x:Name="AppointmentsPane" Header="    Appointments    " 
                                         Title="Appointments" CanUserClose="True"
                                         telerik:RadDocking.SerializationTag="AppointmentsPane"
                                         telerik:RadDocking.FloatingSize="1200, 800">
                            <telerik:RadPane.Content>
                                <ContentControl regions:RegionManager.RegionName="{x:Static inf:RegionNames.AppointmentsRegion}"> </ContentControl>
                            </telerik:RadPane.Content>
                        </telerik:RadPane>
                        <telerik:RadPane x:Name="WorkInProgressPane" Header="    Work In Progress    " 
                                         Title="Work In Progress" CanUserClose="True" 
                                         telerik:RadDocking.SerializationTag="WIPPane"
                                         telerik:RadDocking.FloatingSize="1200, 800">
                            <telerik:RadPane.Content>
                                <ContentControl regions:RegionManager.RegionName="{x:Static inf:RegionNames.WorkInProgressRegion}"> </ContentControl>
                            </telerik:RadPane.Content>
                        </telerik:RadPane>
                    </telerik:RadPaneGroup>
                </telerik:RadSplitContainer>
            </telerik:RadDocking.DocumentHost>
        </telerik:RadDocking>
Kalin
Telerik team
 answered on 06 Apr 2016
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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?