Telerik Forums
UI for WPF Forum
2 answers
350 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
955 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
177 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
261 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
214 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
252 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
468 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
222 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
295 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
0 answers
127 views
Hi, I'm trying to send an email while using the richtextbox as the body. I use a HtmlDataProvider and I've tried multiple imageexport options but the image still appears as an empty box. May I ask how do I properly export to html with inline images, MVVM.
Minh
Top achievements
Rank 1
 asked on 05 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
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?