or
Hi there,
We are facing a strange problem in RadGridView. Upon adding a new row in GridView and input some data, application crashes after changing the focus to another row using Mouse. Whereas, if we press tab button to move focus on next column there is no crashing.
Specified argument was out of the range of valid values.
Parameter name: index
This problem occurs only on one solution whereas same usercontrol is working perfectly fine when exported to other solution having same Telerik references.
Please help us to resolve this problem. Thanks
Stack Trace is attached
Regards,
Rehan
Let me know if further explanation is required.
Thanks
<
my:RadRichTextBox
x:Name
=
"txtChat"
>
<
my:RadRichTextBox.Resources
>
<
Style
TargetType
=
"my:RadRichTextBox"
>
<
Setter
Property
=
"FontSize"
Value
=
"32"
></
Setter
>
<
Setter
Property
=
"Height"
Value
=
"100"
></
Setter
>
</
Style
>
</
my:RadRichTextBox.Resources
>
</
my:RadRichTextBox
>
<
Grid
>
<
StackPanel
>
<
StackPanel
Orientation
=
"Horizontal"
Height
=
"50"
>
<
Label
Content
=
"Upper Thumb"
/>
<
TextBox
Width
=
"300"
Height
=
"35"
Text
=
"{Binding Path=SelectionEnd}"
/>
</
StackPanel
>
<
telerik:RadSlider
Name
=
"radSlider"
VerticalAlignment
=
"top"
Width
=
"25"
Height
=
"200"
Margin
=
"0 10 5 0"
IsSelectionRangeEnabled
=
"True"
TickPlacement
=
"None"
Minimum
=
"0.0"
Maximum
=
"1.0"
Orientation
=
"Vertical"
SelectionStart
=
"{Binding Path=SelectionStart, Mode=TwoWay, FallbackValue=0.25}"
SelectionEnd
=
"{Binding Path=SelectionEnd, Mode=TwoWay, FallbackValue=0.5}"
LargeChange
=
"0.05"
SmallChange
=
"0.05"
/>
<
StackPanel
Orientation
=
"Horizontal"
Height
=
"50"
>
<
Label
Content
=
"Lower Thumb"
/>
<
TextBox
Width
=
"300"
Height
=
"35"
Text
=
"{Binding Path=SelectionStart}"
/>
</
StackPanel
>
</
StackPanel
>
</
Grid
>
public
partial
class
MainWindow : Window
{
public
MainWindow()
{
InitializeComponent();
var vm =
new
SliderViewModel();
DataContext = vm;
}
}
public
class
SliderViewModel : INotifyPropertyChanged
{
public
SliderViewModel()
{
_selectionStart = 0.25;
_selectionEnd = 0.5;
}
private
double
_selectionStart;
public
double
SelectionStart
{
get
{
return
_selectionStart;
}
set
{
if
(_selectionStart != value)
{
_selectionStart = value;
OnPropertyChanged(
"SelectionStart"
);
}
}
}
private
double
_selectionEnd;
public
double
SelectionEnd
{
get
{
return
_selectionEnd;
}
set
{
if
(_selectionEnd != value)
{
_selectionEnd = value;
OnPropertyChanged(
"SelectionEnd"
);
}
}
}
public
event
PropertyChangedEventHandler PropertyChanged;
protected
virtual
void
OnPropertyChanged(String propertyName)
{
var handler = PropertyChanged;
if
(handler !=
null
)
{
handler(
this
,
new
PropertyChangedEventArgs(propertyName));
}
}
}
<
Window
x:Class
=
"Imagine.TelerickTest.RichTextBox.WithoutMVVM"
xmlns:my
=
"clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Documents"
xmlns:radDoc
=
"clr-namespace:Telerik.Windows.Documents.Model;assembly=Telerik.Windows.Documents"
Title
=
"WithoutMVVM"
Height
=
"500"
Width
=
"500"
>
<
DockPanel
>
<
StackPanel
DockPanel.Dock
=
"Top"
>
<
TextBlock
Text
=
"Input"
></
TextBlock
>
<
TextBox
x:Name
=
"txtInput"
></
TextBox
>
</
StackPanel
>
<
Button
x:Name
=
"btnClick"
Content
=
"Click"
Click
=
"btnClick_Click"
DockPanel.Dock
=
"Top"
></
Button
>
<
my:RadRichTextBox
x:Name
=
"txtMessage"
LayoutMode
=
"Flow"
></
my:RadRichTextBox
>
</
DockPanel
>
</
Window
>
public WithoutMVVM()
{
InitializeComponent();
}
private void btnClick_Click(object sender, RoutedEventArgs e)
{
var span = new Telerik.Windows.Documents.Model.Span(txtInput.Text);
var p = new Telerik.Windows.Documents.Model.Paragraph();
p.Inlines.Add(span);
var section = new Telerik.Windows.Documents.Model.Section();
section.Blocks.Add(p);
txtMessage.Document.Sections.Add(section);
}