Telerik Forums
UI for WPF Forum
3 answers
283 views
When I press a button to add a shape to my canvas I need it to be placed inside my current viewing area on the canvas.  Currently, I have it hard-coded.  Do you have some example code to do this?  I pass the position using my "GroupDD" object.

Thanks in advance for your help,
Joel

private void btnAddGroup_Click(
    object sender,
    RoutedEventArgs e)
{
    try
    {
        ((AppSettings)DataContext).Model.AddGroup(
            new GroupDD()
            {
                Name = "New Group",
                DynamicProperties = new NameValuePairList()
                {
                    new NameValuePair()
                    {
                        Name = "PositionLabel",
                        Value = GroupNode.GetPointLabel(
                            new Point(20, 20))
                    }
                }
            });



        
public void AddGroup(
            GroupDD group)
        {
            GroupNode node = GetGroupNode(group);
            GraphSource.AddNode(node);
        }
 
        public GroupNode GetGroupNode(
            GroupDD group)
        {
            GroupNode node = new GroupNode()
            {
                Position = GetPoint(group.DynamicProperties),
                Group = group
            };
 
            return node;
        }
 
public class GroupNode : NodeViewModelBase, INotifyPropertyChanged
{
...
}

Joel Palmer
Top achievements
Rank 2
 answered on 12 Aug 2014
2 answers
685 views
Hello,

I'd like to override the keyboard shortcuts for copy, cut and paste because there are some very specific things that I need to do to copy/paste my objects. I've tried overriding the OnKeyDown event, but the commands never hit that method, even though other ctrl commands (ex. ctrl+s) do. Is there a way to have this this control returned to me when I set AllowCopy, AllowCut and AllowPaste to False?

Thanks,
Zak
Zak
Top achievements
Rank 1
 answered on 12 Aug 2014
1 answer
151 views
hi, is the RadWrapPanel child can be stretch?
Yana
Telerik team
 answered on 12 Aug 2014
1 answer
326 views
In my RadDiagram, I currently have the following XAML:

<telerik:RadDiagram.ShapeStyle>
  <Style TargetType="telerik:RadDiagramShape">
    <Setter Property="Geometry" Value="{Binding Geometry, Mode=TwoWay}"></Setter>
  </Style>
</telerik:RadDiagram.ShapeStyle>

<telerik:RadDiagram.ShapeTemplate>
  <DataTemplate>
    <TextBlock Text="{Binding Header}" ></TextBlock>
  </DataTemplate>
</telerik:RadDiagram.ShapeTemplate>

Now I want something another shape, with the same style, but with a ShapeTemplate like:

<telerik:RadDiagram.ShapeTemplate>
  <DataTemplate>
    <TextBlock Text="{Binding Header}" ></TextBlock>
    <TextBlock Text="{Binding SomeValue}" ></TextBlock>
    <TextBlock Text="{Binding AnotherHeader}" ></TextBlock>
  </DataTemplate>
</telerik:RadDiagram.ShapeTemplate>

Which can also be edited (only SomeValue):
<telerik:RadDiagram.ShapeEditTemplate>
  <DataTemplate>
    <TextBlock Text="{Binding Header}" ></TextBlock>
    <TextBox Text="{Binding SomeValue, Mode=TwoWay}" />
    <TextBlock Text="{Binding AnotherHeader}" ></TextBlock>
  </DataTemplate>
</telerik:RadDiagram.ShapeEditTemplate>
 
How can I accomplish having both types of shapes in the same Diagram?
Can this be done in XAML, or do I have to do this in code-behind?
For both types of solutions: How can I accomplish this?

Thanks in advance!
Martin Ivanov
Telerik team
 answered on 12 Aug 2014
2 answers
77 views
Hi,
I’m using RadAutoCompleteBox in my application. I want to
set width property of popup window to auto and remove horizontal scroll.
Ghasem
Top achievements
Rank 1
 answered on 12 Aug 2014
2 answers
1.3K+ views
Hi.

I want to use toggle button.

Button design is attached in file.

I try to find, but I don't find that.

Is it apply that?
Lee
Top achievements
Rank 1
 answered on 11 Aug 2014
1 answer
80 views
Hi,
When setting the SelectedItem property, the background is gray (RowColor1.png). How do I set the background to yellow (RowColor2.png) when SelectedItem is set.

Thanks,
Brew
Brew Hutch
Top achievements
Rank 1
 answered on 11 Aug 2014
3 answers
364 views
Hi,

I would like to create a custom shape based on RadDiagramShape.

Lets say a rectangle and a small circle somewhere within it.

I want the rectangle and circle in different colors and fills.

What is the best way to achieve this ?

Zarko
Telerik team
 answered on 11 Aug 2014
3 answers
125 views
hi !
im having trouble with GridView.
my grid view contains about 100 columns and 100 rows and the first column has check box in it.
the check box can get checked or unchecked through  code and through UI,
if the check box is checked i change the border color and border thickness of the entire row.
if i scroll down to the end of the grid, check some of the check boxes and then scroll back up,
in addition to the checked check boxes, ill see different rows getting checked and their border color and thickness change as well
the rows that get checked are in the same pattern as the original checked rows, for example;

if i check the rows the following way-
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|


when i will scroll up ill see the same pattern over and over on different rows:

|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|
|_V_|___|___|___|___|
|___|___|___|___|___|
|_V_|___|___|___|___|



each row has a different data context but when the CheckedChanged event invokes for the check boxes in the random rows, their data context is null.
if i check them manually they will have the right datacontext tho.

please help!




Dimitrina
Telerik team
 answered on 11 Aug 2014
3 answers
210 views
When I try to select RadComboBox off mode Editable. Is it possible to solve this problem?
Example

CellEditTemplateSelector:

        <DataTemplate x:Key="EditDataTemplate" DataType="viewModels:ModelView">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <telerik:RadNumericUpDown NumberDecimalDigits="0"
                                          Minimum="0"
                                          Maximum="10080"
                                          BorderBrush="{x:Null}"
                                          BorderThickness="0"
                                          ShowButtons="False"
                                          IsInteger="True">
                    <telerik:RadNumericUpDown.Value>
                        <MultiBinding Converter="{StaticResource NotificationModelsTwoWayConverter}" Mode="TwoWay">
                            <Binding Path="DataContext.SelectedItem" Mode="OneWay"
                                     RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=UserControl}" />
                            <Binding Path="DataContext" Mode="OneWay" RelativeSource="{RelativeSource Self}" />
                            <Binding Path="Column.Name" Mode="OneWay"
                                     RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=telerik:GridViewCell}" />
                        </MultiBinding>
                    </telerik:RadNumericUpDown.Value>
                </telerik:RadNumericUpDown>
                <telerik:RadComboBox Grid.Column="1" SelectedIndex="0">
                    <telerik:RadComboBoxItem Content="min" Tag="min"/>
                    <telerik:RadComboBoxItem Content="hour" Tag="hour"/>
                    <telerik:RadComboBoxItem Content="day" Tag="day"/>
                </telerik:RadComboBox>
            </Grid>
        </DataTemplate>
Dimitrina
Telerik team
 answered on 11 Aug 2014
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
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
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?