Telerik Forums
UI for WPF Forum
1 answer
893 views

Hello, please i need your help,

 

I have a RadGridView and the rows have different types, for example: Type A, Type B, .... and sometimes there is a relation between rows, and if a user try to delete a row (for example row A) I check if there is a relation between the row that the user want to delete (row A) and all the rows of the RadGridView, and if there is a relation I propose to the user if he want to delete the row (Row B for example) (or rows) who the row A have a relation.


I used the event RowsChanging to get the index of the rows that the user wants to delete, like this, and then I can delete the rows who have a relation with the row A.

 

private void radGridView_RowsChanging(object sender, GridViewCollectionChangingEventArgs e)
        {
            if (e.Action == NotifyCollectionChangedAction.Remove)  // The Action is to delet the row A
            {

              //  if(I check if row A have a relation with another row)

             {

             //i delet this rows

        radGridView .Rows.RemoveAt(indexoftherowiwanttodelet);

             }         

      }

}

 

My problem is:


If the index of the row A is smaller than the index of the row B, the code works very well.
But if the index of the row A is bigger than the row B, I have an exception: 

'System. ArgumentOutOfRangeException' occurred in mscorlib.dll

 

I need your help and thank you.

 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 30 Aug 2019
15 answers
1.2K+ views
We are getting System.ComponentModel.Win32Exception error while  converting XAML to PDF at WCF WebSevice. Interestingly WCF Service sometimes getting this error, sometimes not. Also this code working inside a Thread otherwise it gives a STA Thread Exception . 

Telerik dll version : 2013.1.527.45  AND .Net 4.5

Code and detailed error is shown below. Please immediate help.

byte[] XAMDataToBeConverted;

 var xamlProvider = new Telerik.Windows.Documents.FormatProviders.Xaml.XamlFormatProvider();
 radDocument = xamlProvider.Import(XAMDataToBeConverted); //Getting Error on this line
 xamlProvider = null;

The Error detail is 

'The invocation of the constructor on type 'Telerik.Windows.Documents.Model.RadDocument' that matches the specified binding constraints threw an exception.' Line number '1' and line position '569'. System.Windows.Markup.XamlParseException Seneka.Ebdys.Server.Services.HelperClasses.RadRichTextBoxHelperServer CreatePdfSimple "System.Windows.Markup.XamlParseException: 'The invocation of the constructor on type 'Telerik.Windows.Documents.Model.RadDocument' that matches the specified binding constraints threw an exception.' Line number '1' and line position '569'. ---> System.ComponentModel.Win32Exception: The operation completed successfully
   at MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
   at System.Windows.Threading.Dispatcher..ctor()
   at Telerik.Windows.Documents.Model.MailMergeDataSource..ctor()
   at Telerik.Windows.Documents.Model.RadDocument..ctor()
   at System.Xaml.Schema.XamlTypeInvoker.CreateInstance(Object[] arguments)
   at MS.Internal.Xaml.Runtime.ClrObjectRuntime.CreateInstance(XamlType xamlType, Object[] args)
   --- End of inner exception stack trace ---
   at System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
   at System.Windows.Markup.XamlReader.Load(XamlReader xamlReader, ParserContext parserContext)
   at System.Windows.Markup.XamlReader.Load(XmlReader reader, ParserContext parserContext, XamlParseMode parseMode)
   at Telerik.Windows.Documents.FormatProviders.Xaml.XamlFormatProvider.Import(Stream input)
   at Telerik.Windows.Documents.FormatProviders.DocumentFormatProviderBase.Import(Byte[] input)
   at Seneka.Ebdys.Server.Services.HelperClasses.RadRichTextBoxHelperServer.CreatePdfSimple()"







Boby
Telerik team
 answered on 30 Aug 2019
3 answers
153 views

Hi,

I want to save selections like shape border thickness as settings so when the user work with the tool again the last selected thickness should be selected instead of the default value.

How do I approach and solve this?

 

Best regards

Dilyan Traykov
Telerik team
 answered on 30 Aug 2019
1 answer
121 views

Hi,

is it possible to save the image editor settings I used last? I would like to have the same StrokeColor, Shape and StrokeThickness again if I open another picture with the imageeditor.

Best regards.

Dinko | Tech Support Engineer
Telerik team
 answered on 30 Aug 2019
7 answers
511 views
Is there any way to change the circle size of the expander control? Or could you provide an example for replacing the template of the expander control? I would like to increase the size of the circle to make it more touch friendly.

Regards,
Peter
Dilyan Traykov
Telerik team
 answered on 29 Aug 2019
5 answers
256 views

When I programatically add a radpane to docking. It is coming out only as tall as the header of a pane. (Picture attached of result.)

I have tried a few methods.

Here is what I am trying:

RadPane dockPaneCalc = new RadPane() {
     IsHidden = false,
     Content = new RadCalculator()
     {
         VerticalAlignment = VerticalAlignment.Stretch,
         HorizontalAlignment = HorizontalAlignment.Stretch
     }
 };
 
 RadPaneGroup paneGroup = new RadPaneGroup();
 RadSplitContainer splitContainer = new RadSplitContainer() {
     InitialPosition = Telerik.Windows.Controls.Docking.DockState.FloatingOnly,
     Height = 350,
     Width = 250
 };
 
 RadDocking.SetFloatingLocation(splitContainer, new Point(200, 200));
 RadDocking.SetFloatingSize(splitContainer, new Size(250, 350));
 
 paneGroup.Items.Add(dockPaneCalc);
 splitContainer.Items.Add(paneGroup);
 dockMain.Items.Add(splitContainer);
Zack
Top achievements
Rank 1
Veteran
 answered on 28 Aug 2019
3 answers
312 views

The InlineUiContainer is allowed to be inserted into RadRichTextBox officially by Telerik.

But there're some problems:

When I insert  a <Textbox> in to  RadRichTextBox 

                        <telerik:InlineUIContainer>
                            <TextBox Width="100" Height="50"/>
                        </telerik:InlineUIContainer>

       The TextBox can be shown in the RadRichTextBox correctly, and input charactors in inner TextBox correctly. But when I press "Backspace", the cursor will jump to to outer RadRichTextBox instead of delete the last character in inner TextBox !

       I used to think it's caused by the Microsoft WPF and Telerik WPF these 2 mechanisms (incompatible).Then I tried to use a RadTextBox, but no this control (with the acceptable reason: no color can be set on this control, so theme is unnecessary). 

       Fortunately, I found a Telerik control called telerik:RadMaskedTextInput, then I tried it as 

                        <telerik:InlineUIContainer>
                            <telerik:RadMaskedTextInput Width="100" Height="50" TextMode="PlainText"/>
                        </telerik:InlineUIContainer>

       But the problem is still !!!!  Press "backspace" in the inner RadMaskedTextInput will make the cursor jump into the outer RadRichTextBox .............

       On the other hand, if you insert a RadRichTextB​ox into a RadRichTextBox ,  the cursor is Okay both in inner and outer RadRichTextBox .

       I'm using ver 2014Q3.

       Then Whether this problem has been fixed now ? If yes , could you please tell me the ver?

       

Tanya
Telerik team
 answered on 28 Aug 2019
6 answers
602 views
Hello everyone,

We are having issues with vertical scroll when collapse/expand items in the TreeListView. Scroll starts to jump if we change style for GridViewCell:

<Style x:Key="CellStyle" TargetType="telerik:GridViewCell">
    <Setter Property="MinHeight" Value="50"/>
</Style>

XAML for TreeListView:
<telerik:RadTreeListView x:Name="radTreeListView2"
            AutoGenerateColumns="False"
            Height="450"
            Width="400"
            BorderBrush="Black"
            BorderThickness="5"
            AutoExpandItems="True"
            ScrollViewer.HorizontalScrollBarVisibility="Visible"
            ScrollViewer.VerticalScrollBarVisibility="Visible">
    <telerik:RadTreeListView.ChildTableDefinitions>
        <telerik:TreeListViewTableDefinition ItemsSource="{Binding Items}" />
    </telerik:RadTreeListView.ChildTableDefinitions>
  
    <telerik:RadTreeListView.Columns>
        <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/>
        <telerik:GridViewDataColumn Header="Count" DataMemberBinding="{Binding Count}"/>
    </telerik:RadTreeListView.Columns>
</telerik:RadTreeListView>


Steps to reproduce:
 1. TreeListView should contain enough items, so scroll showed up
 2. Scroll down to the middle or to the end
 3.Collapse/Expand any item
    AR: Scroll jumps to top (or to the middle)
    ER: Scroll stays on the same place, so we can see collapsed/expanded item

Scroll is jumping even if we just put some content in CellTemplate:

<telerik:RadTreeListView.Columns>
    <telerik:GridViewDataColumn Header="Name" DataMemberBinding="{Binding Name}"/>
    <telerik:GridViewDataColumn Header="Count" DataMemberBinding="{Binding Count}">
        <telerik:GridViewDataColumn.CellTemplate>
            <DataTemplate>
                <Border Height="50" Width="200" Background="LightGreen"/>
            </DataTemplate>
        </telerik:GridViewDataColumn.CellTemplate>
    </telerik:GridViewDataColumn>
</telerik:RadTreeListView.Columns>


Please advice.
Dilyan Traykov
Telerik team
 answered on 27 Aug 2019
6 answers
701 views
I need to create a graph that has multiple line series defined by pairs of x-y coordinates ( one start point and one end point). On the same graph I need to have several scatter points with no connecting lines. Also if there's a way to specify a straight line between some of the points and a curved line between others that'd be great. I'm currently researching WPF graphs so I don't have any code to show yet.
Vladimir Stoyanov
Telerik team
 answered on 26 Aug 2019
3 answers
125 views

Hi,

I can successfully provide an initial sort order for my VirtualGrid using this code in the code behind file, as prescribed by your documentation:

var sortDescriptor = this.VirtualGrid.GetSortDescriptorForColumn(0);
sortDescriptor.SortDirection = System.ComponentModel.ListSortDirection.Ascending;

sortDescriptor.IsActive = true;

However, for reasons beyond the scope of this issue, my source data (an observable collection) and my custom data provider are created in my view model. My custom data provider is bound to the VirtualGrid via XAML.

Therefore, any attempt to apply your sorting code in the constructor of the code behind file fails because both the DataContext and DataProvider properties are not yet assigned in that instant (they are null), i.e. they are not populated until the View Model constructor files.

I can achieve what I want by placing the aforementioned code in the VirtualGrid's Loaded event in the code-behind file, but as a Newbie, I am concerned whether this is the correct solution.

Wayne

Dilyan Traykov
Telerik team
 answered on 26 Aug 2019
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
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
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
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?