Hi,
I have a screen in which i am required to place both RadChart and RadScheduleView . RadChart has some data associated with it, and RadScheduleView has no data. When I add the reference for RadScheduleView , which is "Telerik.Windows.Controls.ScheduleView", the data which is associated with the charts are no longer visible and in place of that data, random data like " Chart axis label, ChartChartTitle" etc appears. Why is this happening, and how can this be solved? Please refer attached images of the Radcharts showing the random data. Also, Please refer the following link for sample code regarding the mentioned error.
http://www.filedropper.com/radchartbug
-Sangeetha
Hello
I'm trying to set default values for a DataRow when it is newly inserted into a RadGridView. See the cut down sample below.
If I use AddingNewDataItem to create the row, then I get an error.
If instead I let the grid create the row, and then use BeginningEdit to set the values, then the values don't show.
What's the best way to set default values with a new DataRow?
Many Thanks
public partial class MainWindow : Window
{
private RadGridView _grid;
private DataTable _table;
public MainWindow()
{
InitializeComponent();
_grid = new RadGridView { AutoGenerateColumns = false, CanUserInsertRows = true, ShowInsertRow = true };
Content = _grid;
_grid.AddingNewDataItem += new EventHandler<GridViewAddingNewEventArgs>( _grid_AddingNewDataItem );
_grid.BeginningEdit += new EventHandler<GridViewBeginningEditRoutedEventArgs>( _grid_BeginningEdit );
_grid.Columns.Add( new GridViewDataColumn { DataMemberBinding = new Binding { Path = new PropertyPath( "Column1" ), Mode = BindingMode.TwoWay } } );
_grid.Columns.Add( new GridViewDataColumn { DataMemberBinding = new Binding { Path = new PropertyPath( "Column2" ), Mode = BindingMode.TwoWay } } );
_table = new DataTable();
_table.Columns.Add( "Column1", typeof( string ) );
_table.Columns.Add( "Column2", typeof( string ) );
_table.Rows.Add( "row1-col1", "row1-col2" );
_grid.ItemsSource = _table.DefaultView;
}
private void _grid_BeginningEdit( object sender, GridViewBeginningEditRoutedEventArgs e )
{
// This won't show "INIT" until Column2 is focused
//DataRowView dataRowView = e.Row.Item as DataRowView;
//if( dataRowView.Row.RowState == DataRowState.Detached )
//{
// dataRowView[ "Column2" ] = "INIT";
//}
}
private void _grid_AddingNewDataItem( object sender, GridViewAddingNewEventArgs e )
{
// This will cause an error: Cannot add external objects to this list
//e.NewObject = _table.DefaultView.AddNew();
}
}
Grid newGrid =
new
Grid();
RadGauge newRG =
new
RadGauge();
LinearGauge newLG =
new
LinearGauge();
LinearScale newLS =
new
LinearScale();
IndicatorList newIL =
new
IndicatorList();
Marker newMarker =
new
Marker();
newIL.Items.Add(newMarker);
newLS.Indicators.Add(newIL
);
newLG.Items.Add(newLS);
newRG.Content = newLG;
newGrid.Children.Add(newRG);
GaugesWrapPanle.Children.Add(newGrid);
Hi, I'm new to telerik and I would like to ask a question here in the forum.
Basically, I would like to make "Property Editor" using Dictionary and RadGridView.
I'm using Dictionary because all I have is bunch of key/value pairs and entries/definition can frequently change. I thought Dictionary was perfect for this.
The below source code works to bind Dictionary in RadGridView but editing value would not work. Any changes made in RadGridView will not change the values in the Dictionary.If Dictionary inheritantely does not allow two-way/one-way binding, could you please give a suggestion how I can emulate Dictionary like functionality?
Thank you very much.
-Chris
publicvoid ShowEntityProperties(OrderedDictionary propertyDict) { PropertyGridView.ItemsSource = null; PropertyGridView.Items.Clear(); PropertyGridView.ItemsSource = propertyDict; }
<UserControl>
<StackPanel>
<Grid_1>
<label>
<myUserControl_1>
</Grid>
<Grid_2>
<label>
<myUserControl_2>
</Grid>
<Grid_3>
<label>
<myUserControl_3>
</Grid>
</Grid>
</StackPanel>
<
ControlTemplate
x:Key
=
"RadComboBoxControlTemplate1"
TargetType
=
"{x:Type telerik:RadComboBox}"
>
<
Grid
x:Name
=
"VisualRoot"
>
<
Border
Background
=
"{TemplateBinding Background}"
CornerRadius
=
"1"
IsHitTestVisible
=
"False"
/>
<
telerik:RadToggleButton
x:Name
=
"PART_DropDownButton"
ClickMode
=
"Press"
IsTabStop
=
"False"
Margin
=
"0"
Padding
=
"0"
>
<
telerik:RadToggleButton.Template
>
<
ControlTemplate
TargetType
=
"{x:Type telerik:RadToggleButton}"
>
<
ContentPresenter
ContentTemplate
=
"{TemplateBinding ContentTemplate}"
Content
=
"{TemplateBinding Content}"
ContentStringFormat
=
"{TemplateBinding ContentStringFormat}"
/>
</
ControlTemplate
>
</
telerik:RadToggleButton.Template
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"*"
/>
<
ColumnDefinition
Width
=
"Auto"
/>
</
Grid.ColumnDefinitions
>
<
Telerik_Windows_Controls_Chromes:ButtonChrome
x:Name
=
"ButtonChrome"
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Grid.ColumnSpan
=
"2"
CornerRadius
=
"1"
RenderMouseOver
=
"{TemplateBinding IsMouseOver}"
RenderPressed
=
"{TemplateBinding IsDropDownOpen}"
RenderFocused
=
"{TemplateBinding IsFocused}"
RenderEnabled
=
"{TemplateBinding IsEnabled}"
>
<
telerik:StyleManager.Theme
>
<
telerik:Office_BlackTheme
/>
</
telerik:StyleManager.Theme
>
</
Telerik_Windows_Controls_Chromes:ButtonChrome
>
<
ContentControl
x:Name
=
"DropDownIcon"
Background
=
"White"
Grid.Column
=
"1"
Foreground
=
"Black"
IsTabStop
=
"False"
>
<
ContentControl.Template
>
<
ControlTemplate
TargetType
=
"{x:Type ContentControl}"
>
<
Grid
Margin
=
"5,0"
>
<
Path
x:Name
=
"BackgroundIcon"
Data
=
"M0,0L2,0 1,1z"
Fill
=
"{TemplateBinding Background}"
Height
=
"3"
Margin
=
"0,2,0,0"
Stretch
=
"Fill"
Width
=
"5"
/>
<
Path
x:Name
=
"ForegroundIcon"
Data
=
"M0,0L2,0 1,1z"
Fill
=
"{TemplateBinding Foreground}"
Height
=
"3"
Margin
=
"0,1"
Stretch
=
"Fill"
Width
=
"5"
/>
</
Grid
>
</
ControlTemplate
>
</
ContentControl.Template
>
</
ContentControl
>
<
ContentPresenter
x:Name
=
"Content"
ContentTemplate
=
"{TemplateBinding SelectionBoxItemTemplate}"
Content
=
"{TemplateBinding SelectionBoxItem}"
Grid.Column
=
"0"
HorizontalAlignment
=
"{TemplateBinding HorizontalContentAlignment}"
IsHitTestVisible
=
"False"
Margin
=
"{TemplateBinding Padding}"
VerticalAlignment
=
"{TemplateBinding VerticalContentAlignment}"
/>
</
Grid
>
</
telerik:RadToggleButton
>
<
Popup
x:Name
=
"PART_Popup"
AllowsTransparency
=
"True"
PopupAnimation
=
"{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}"
>
<
Border
BorderBrush
=
"{TemplateBinding BorderBrush}"
BorderThickness
=
"{TemplateBinding BorderThickness}"
Background
=
"White"
CornerRadius
=
"1"
MaxHeight
=
"{TemplateBinding MaxDropDownHeight}"
MinWidth
=
"{TemplateBinding MinDropDownWidth}"
>
<
Grid
>
<
Grid.RowDefinitions
>
<
RowDefinition
Height
=
"Auto"
/>
<
RowDefinition
Height
=
"*"
/>
</
Grid.RowDefinitions
>
<
telerik:RadButton
x:Name
=
"PART_ClearButton"
Content
=
"{TemplateBinding ClearSelectionButtonContent}"
Margin
=
"-1,-1,-1,0"
Grid.Row
=
"0"
Visibility
=
"{TemplateBinding ClearSelectionButtonVisibility}"
>
<
telerik:StyleManager.Theme
>
<
telerik:Office_BlackTheme
/>
</
telerik:StyleManager.Theme
>
</
telerik:RadButton
>
<
ScrollViewer
x:Name
=
"PART_ScrollViewer"
BorderThickness
=
"0"
CanContentScroll
=
"True"
Padding
=
"1,1,1,0"
Grid.Row
=
"1"
VerticalScrollBarVisibility
=
"Auto"
>
<
telerik:StyleManager.Theme
>
<
telerik:Office_BlackTheme
/>
</
telerik:StyleManager.Theme
>
<
ItemsPresenter
/>
</
ScrollViewer
>
</
Grid
>
</
Border
>
</
Popup
>
</
Grid
>
<
ControlTemplate.Triggers
>
<
Trigger
Property
=
"IsEnabled"
Value
=
"False"
>
<
Setter
Property
=
"Opacity"
TargetName
=
"Content"
Value
=
"0.5"
/>
<
Setter
Property
=
"Foreground"
TargetName
=
"DropDownIcon"
Value
=
"#FF8D8D8D"
/>
<
Setter
Property
=
"Background"
TargetName
=
"DropDownIcon"
Value
=
"White"
/>
</
Trigger
>
<
MultiTrigger
>
<
MultiTrigger.Conditions
>
<
Condition
Property
=
"IsEnabled"
Value
=
"True"
/>
<
Condition
Property
=
"IsMouseOver"
Value
=
"True"
/>
</
MultiTrigger.Conditions
>
<
Setter
Property
=
"Foreground"
TargetName
=
"DropDownIcon"
Value
=
"Black"
/>
<
Setter
Property
=
"Background"
TargetName
=
"DropDownIcon"
Value
=
"White"
/>
</
MultiTrigger
>
<
MultiTrigger
>
<
MultiTrigger.Conditions
>
<
Condition
Property
=
"IsEnabled"
Value
=
"True"
/>
<
Condition
Property
=
"IsDropDownOpen"
Value
=
"True"
/>
</
MultiTrigger.Conditions
>
<
Setter
Property
=
"Foreground"
TargetName
=
"DropDownIcon"
Value
=
"Black"
/>
<
Setter
Property
=
"Background"
TargetName
=
"DropDownIcon"
Value
=
"White"
/>
</
MultiTrigger
>
</
ControlTemplate.Triggers
>
</
ControlTemplate
>