Telerik Forums
UI for WPF Forum
3 answers
174 views

Hi All,

Any Idea to Notify in Drop(DragDropState state) of which Parent Class is ListBoxDragDropBehavior. I am Doing Drag and Drop operation in Rad:ListBox Control. Need to identify whether I am Dragging the ListBoxItem from top to down or down to top in Drop(DragDropState state  method of the behavior. I have attached a sample image(dragvisual.jpg) for reference.

Thanks in Advance!

Regards,

Kishore Kumar

Dinko | Tech Support Engineer
Telerik team
 answered on 12 Jan 2021
2 answers
201 views

Hi there, I am using a radgridview and want to allow users to select a format for data within columns, testing this for dates I noticed that it wasn't working for expression columns that contain a string representation of the data rather than a type such as DateTime, if I make one using Now() or Today() the format string does appear to work, is there a way to parse data in an expression column into a datatype?

Jack
Top achievements
Rank 1
 answered on 12 Jan 2021
9 answers
302 views

Hello. I used the sample provided by the SDK. (GridView - Group Selecction)

There was a problem with group sorting.

 

Please check the image for details.

 

 

In sdk Source (MyBehavior.cs) ======================================

private IEnumerable<object> GetSubGroupItems(IGroup gr)
{
if (!gr.HasSubgroups)   ★ <<<< This alert  (System.NullReferenceException: Object reference not set to an instance of an object.)
{
return gr.Items.OfType<object>();
}
else
{
List<object> items = new List<object>();
foreach (var subGr in gr.Subgroups)
{
items.AddRange(GetSubGroupItems(subGr));
}
return items;
}
}

========================================================================================

 

I want to sort by header group. Could you solve it?

Thanks.

 

Martin Ivanov
Telerik team
 answered on 11 Jan 2021
3 answers
265 views

Hi,

i have a RadComboBox where the ItemsSource is bound to a list of strings, the Text to a String and where IsEditable is true.

When setting the Text (in viewmodel) to a value, which is not included in the list of strings, it shows the "suggested" text (like when i enter it manually in the box), not the text which was set.This occurs when the viewmodel value is set delayed (not in ctor).

Here is a small sample code.

MainWindow.xaml

<Window x:Class="TelerikCombobox.MainWindow"
        xmlns:local="clr-namespace:TelerikCombobox"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
    <Grid>
        <StackPanel Margin="3">
            <telerik:RadComboBox Text="{Binding SelectedValue, Mode=TwoWay}" ItemsSource="{Binding SuggestedValues}" IsEditable="True"/>
            <TextBlock Text="{Binding SelectedValue, Mode=OneWay}"/>
        </StackPanel>
    </Grid>
</Window>

 

MainWindow.cs

public partial class MainWindow : Window
{
    public MainWindow()
    {
        InitializeComponent();
 
        this.DataContext = new ViewModel()
        {
            SuggestedValues = new String[] { "100", "200", "300" },
        };
 
        SetValueDelayed();
    }
 
    private async void SetValueDelayed()
    {
        await Task.Delay(2000);
        if (this.DataContext is ViewModel viewModel)
            viewModel.SelectedValue = "3";
    }
}

 

ViewModel.cs

public class ViewModel : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
 
        private String m_SelectedValue;
        public String SelectedValue
        {
            get
            {
                return m_SelectedValue;
            }
            set
            {
                m_SelectedValue = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SelectedValue)));
            }
        }
 
        private IEnumerable<String> m_SuggestedValues;
        public IEnumerable<String> SuggestedValues
        {
            get
            {
                return m_SuggestedValues;
            }
            set
            {
                m_SuggestedValues = value;
                PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(SuggestedValues)));
            }
        }
    }

 

After the value "3" is set, the combobox shows 300.

 

Thanks

 

Dilyan Traykov
Telerik team
 answered on 11 Jan 2021
6 answers
2.6K+ views

Hi,

I have this very simple style for my RadMaskedNumericInput control

<Style TargetType="telerik:RadMaskedNumericInput">
    <Setter Property="SelectionOnFocus" Value="SelectAll"/>
    <Style.Triggers>
        <Trigger Property="IsEnabled" Value="True">
            <Setter Property="Background" Value="Green"/>
        </Trigger>
        <Trigger Property="IsEnabled" Value="False">
            <Setter Property="Background" Value="Red"/>
        </Trigger>
        <Trigger Property="IsFocused" Value="True">
            <Setter Property="Background" Value="Yellow"/>
        </Trigger>
        <Trigger Property="IsReadOnly" Value="True">
            <Setter Property="Background" Value="Gray"/>
        </Trigger>
    </Style.Triggers>
</Style>

 

Everything works fine except when the control receives focus, the background color does not change (remains green).  How come ?

Kind Regards,
Hans

Hans
Top achievements
Rank 1
Veteran
 answered on 11 Jan 2021
5 answers
1.4K+ views
Hi,

When I have dynamically added a new column to RadGridView which type is GridViewCheckBoxColumn

radGridView1.Columns.Add(new GridViewCheckBoxColumn() { DataMemberBinding = new Binding("HasOrders"), UniqueName = "HasOrders3", Header = "Has Orders3"
    , AutoSelectOnEdit = true
    , EditTriggers = GridViewEditTriggers.Default | GridViewEditTriggers.CellClick
});

I will get the cheched status from CellEditEnded - event

private void radGridView1_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
{
    if (e.Cell.Column.UniqueName == "HasOrders3")
    {
        textBox3.Text = ((CheckBox)e.EditingElement).IsChecked.ToString();
    }
}

But this CellEditEnded - event triggers only when I leave the cell or press enter/tab key.

If I stay on that cell and click the checkbox I cannot catch the cheched change event? How can I do that in?

Regards,
Auvo

Martin Ivanov
Telerik team
 answered on 11 Jan 2021
3 answers
888 views

How do I have to configure the RadMaskedNumericInput Control so that:

1. the user can enter any decimal number with any precision, with or without a decimal separator, positive or negative 

2. no mask placeholders or literals are visible (no _ and a the decimal separator only visible when the user actually entered one)

 

 

Dinko | Tech Support Engineer
Telerik team
 answered on 08 Jan 2021
2 answers
100 views

The style for my RadWindows is not being overriden from the default theme. I don't have the same issue with other telerik controls like RadButton, the style gets set fine for them. Why is this happening? How can I set a RadWindow style?

MyWindow.xaml

<telerik:RadWindow
    x:Class="MyWindow"
    Header="My Window"
    <Grid>
     // window content
            <telerik:RadButton
                Content="OK" />
            <telerik:RadButton
                Content="Cancel" />
        </StackPanel>   
    </Grid>
</telerik:RadWindow>

 

 

My App.Xaml file contains MergedDictionaries

<ResourceDictionary>
    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="pack://application:,,,/Telerik/RadButton.xaml" />
        <ResourceDictionary Source="pack://application:,,,/Telerik/RadWindow.xaml" />
    </ResourceDictionary.MergedDictionaries>
</ResourceDictionary>

 

Here are the individual xaml files

RadWindow.xaml

<ResourceDictionary
 
    <Style TargetType="{x:Type telerik:RadWindow}">
        <Setter Property="Background"
                Value="Green" />
    </Style>
</ResourceDictionary>


RadButton.xaml

<ResourceDictionary
     
    <Style TargetType="{x:Type telerik:RadButton}">
        <Setter Property="Background"
                Value="Blue" />
 
    </Style>
</ResourceDictionary>

 

 

YBOT
Top achievements
Rank 1
Veteran
 answered on 07 Jan 2021
4 answers
162 views

 Hello,

In my application I need to update the ItemsSource every few seconds, I would like to know what would be the best way to perform this.

I might have up to 600 items divides

I have an ObervableCollection object, every time I receive new data I clear the ObervableCollection object and then I add the new data, something like this:
 

ObservableCollection<myData> myCollection = new ObservableCollection<myData>();
  
// Format the data the way I need it
  
myCollection.Clear();
  
foreach (myObject item in DataObject)
{
  myCollection.Add(new myData()
    {
        property1 = item.property1,
        property2 = item.property2,
        property3 = item.property3
        // Operations for other properties
 
    });
}

I wonder if it would be better to update my ObervableCollection object (update existing items, add the new ones, and delete those that no longer exist) than clear and add all again.

What I want to achieve is to reduce the rendering time.

I hope you can give me some advice.

Thanks in advance,

Alberto

 

 

 

Martin Ivanov
Telerik team
 answered on 07 Jan 2021
1 answer
110 views

Hi,

I have populated the MultiColumnComboBox DropDown Items using a DataTable

I would like to preselect the SelectedItems onload, so that they are hilited in the DropDown Box, and the corresponding Display-values are shown in the select textbox.

Adding DataRows to the SelectedItems property seams to do the trick for the DropDown List, but the values are not shown in the select textbox.

How do I trigger the select textbox to be filled (with multible values)? 

/Brian

 

 

 

 

Vladimir Stoyanov
Telerik team
 answered on 07 Jan 2021
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
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?