Telerik Forums
UI for WPF Forum
1 answer
540 views

Hello.

I want to load a desktop files in grid view using MVVM. Is there a way? (I'm not use MVVM Light kit.)

It is easy to add and remove files by using buttons, but Drag and Drop is difficult to implement because there are not many examples.

I want to add it using the file model using drag and drop and add it to the column by customizing it.

See the image for details.

 

<This is a simple .xaml>

<telerik:RadGridView ItemsSource  ="{Binding MultiFiles}"
                                     rad:GridViewSelectionUtilities.SelectedItems = "{Binding MultiFileItems}"
                                     GroupRenderMode ="Flat"
                                     HorizontalAlignment="Stretch"
                                     AutoGenerateColumns="False"
                                     ShowColumnHeaders="True"
                                     ShowGroupFooters="False"
                                     ShowGroupPanel="False"
                                     RowIndicatorVisibility="Collapsed"
                                     EnableColumnVirtualization="True"
                                     EnableRowVirtualization="True"
                                     VirtualizingPanel.IsVirtualizing="True"
                                     ScrollViewer.HorizontalScrollBarVisibility ="Auto"
                                     ScrollViewer.VerticalScrollBarVisibility ="Auto"
                                     FrozenColumnsSplitterVisibility="Collapsed"
                                     IsFilteringAllowed="False"
                                     AutoExpandGroups="False"
                                     ShowSearchPanel="False"
                                     SearchPanelCloseButtonVisibility="Collapsed"
                                     SelectionMode="Extended"
                                     SelectionUnit="FullRow"
                                     >
                    <telerik:RadGridView.Resources>
                        <Style x:Key="CheckboxCellStyle" TargetType="telerik:GridViewCell" BasedOn="{StaticResource GridViewCellStyle}">
                            <Setter Property="HorizontalContentAlignment" Value="Center"/>
                        </Style>
                    </telerik:RadGridView.Resources>
                     
                    <telerik:RadGridView.Columns>
                        <telerik:GridViewSelectColumn />
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}"
                                                    ToolTip="{Binding Name}"
                                                    IsReadOnly="True"
                                                    Width="300"
                                                    Header="File Name"/>
                        <telerik:GridViewComboBoxColumn ItemsSourceBinding ="{Binding WorkTypes}"
                                                        DataMemberBinding="{Binding WorkType}"
                                                        DisplayMemberPath="Name"
                                                        SelectedValueMemberPath="Name"
                                                        IsReadOnly="False"
                                                        Width="80"
                                                        Header="WorkType"
                                                        >
 
                        </telerik:GridViewComboBoxColumn>
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding Status}"
                                                    ToolTip="{Binding Status}"
                                                    IsReadOnly="True"
                                                    Width="60"
                                                    Header="Status"/>
                         
                        <telerik:GridViewDataColumn DataMemberBinding="{Binding EtcText}"
                                                    ToolTip="{Binding EtcText}"
                                                    IsReadOnly="True"
                                                    Width="auto"
                                                    Header="ETC"/>
                    </telerik:RadGridView.Columns>
                </telerik:RadGridView>

 

<Model>

public class MultiFileModel
{
    public string Name      { get; set; } = string.Empty;
    public string WorkTypes { get; set; } = string.Empty;
    public string Status    { get; set; } = $"X";
    public string EtcText   { get; set; } = string.Empty;
}

 

<ViewModel>

?

 

Thanks.

Martin Ivanov
Telerik team
 answered on 18 Jan 2021
3 answers
294 views

Is there a way to completely hide the Navigation area on a RadMap? I can hide the navigation buttons themselves but the background circle remains. I am using the fluent theme.

I have attached two images to help you see what I am describing. The first picture shows the window with the navigation visible. In the second image I have set NavigationVisibility to collapsed. This removed the arrow buttons but left the background circle. Is there a way to remove that background circle along with the navigation buttons?

Don
Top achievements
Rank 1
Veteran
 answered on 14 Jan 2021
17 answers
1.0K+ views

    Hello Telerik,

 

I am having a situation when using expandable rows.

When they have no children, the Expand Button keeps displaying.

Since it will come up empty, there is no reason for it to be there

so what I want is to hide it in case the row has no children.

I another ticket, I was guided to see this link

http://www.telerik.com/forums/show-and-hide-expand-button-dynamically

But in my case I will have no such "clean" button. I simply want to hide the expand buttons during the grid load time without losing performance (I have 1 mil rows and 4 mil children spread among them)

 

Please show me the best way to achieve this.

it has to do with

row.IsExpandable = false;

at some point, right? What's is it?

 

Thank you.

Ilya
Top achievements
Rank 1
 answered on 14 Jan 2021
3 answers
147 views
I am using the Windows8Touch theme with custom colors I generated via the Theme color generator application It works well.  Except for one thing.  In the File Open dialog, no matter what I do, I cannot get one of the text labels -- just the one -- to honor any of the colors I set. 

It is the label at the bottom of the dialog that says "File Name" (at least when English is the language).  It is next to an edit box that shows the file name.  No matter what I do, that little label always shows up as black.   I have attached an image showing what I mean.  The label that I cannot color is circled in red in the image

So I have two questions:

1. Is there some Palette color I can set in the Windows8Touch theme that will make this little label get colored correctly -- without forcing me to write a style or control template?
2. If not, and I am forced to restyle the control myself, then in what part of of what control template or style do I change something?   (Note that I have tried already - copying the DialogWindowTemplate et al and setting both Foreground and TextElement.Foreground in a few places but I cannot figure out where it would go)

If it matters, here are the custom colors I am using:

<Color x:Key="GsBackgroundDarkColor"            >#002B35</Color>
<Color x:Key="GsForegroundLightColor"           >#FFFFFFFF</Color>
<Color x:Key="GsMediumColor"                    >#FFC0C0C0</Color>
<Color x:Key="GsLowColor"                       >#758595</Color>
<Color x:Key="GsHighColor"                      >#FFBDBDC2</Color>
<Color x:Key="GsAccentColor"                    >#FF26A0DA</Color> <!-- This is the standard Windows8Touch accent color-->
<Color x:Key="GsEffectHighColor"                >#92376472</Color>
<Color x:Key="GsEffectLowColor"                 >#FF1E2D3A</Color>


And here is my initialization code where I set up the Windows8TouchPaele


var palette = Windows8TouchPalette.Palette;
 
 
palette.FontSizeXXL = UserSettings.FontSizeTitle;
palette.FontSizeXL  = UserSettings.FontSizeHeader;
palette.FontSizeL   = UserSettings.FontSize;
palette.FontSize    = UserSettings.FontSizeMedium;
palette.FontSizeS   = UserSettings.FontSizeSmall;
 
palette.FontFamily  = new FontFamily("Segoe UI");
 
 
if (Application.Current.TryFindResource("GsBackgroundDarkColor") is not Color backColor)
{
    Debug.Assert(false);
    Log.Error("Failed to find background color");
}
else
{
    palette.MainColor               = backColor;
    palette.InvertedForegroundColor = backColor;
}
 
if (Application.Current.TryFindResource("GsForegroundLightColor") is not Color foreColor)
{
    Debug.Assert(false);
    Log.Error("Failed to find foreground light color");
}
else
{
    palette.MainForegroundColor = foreColor;
    palette.InvertedColor       = foreColor;
}
 
if (Application.Current.TryFindResource("GsLowColor") is not Color lowColor)
{
    Debug.Assert(false);
    Log.Error("Failed to find GsLowColor");
}
else
{
    palette.LowColor = lowColor;
}
 
if (Application.Current.TryFindResource("GsMediumColor") is not Color medColor)
{
    Debug.Assert(false);
    Log.Error("Failed to find GsMediumColor");
}
else
{
    palette.MediumColor = medColor;
}
 
if (Application.Current.TryFindResource("GsHighColor") is not Color highColor)
{
    Debug.Assert(false);
    Log.Error("Failed to find GsHighColor");
}
else
{
    palette.HighColor = highColor;
}
 
if (Application.Current.TryFindResource("GsAccentColor") is not Color accentColor)
{
    Debug.Assert(false);
    Log.Error("Failed to find GsAccentColor");
}
else
{
    palette.AccentColor = accentColor;
}
 
 
if (Application.Current.TryFindResource("GsEffectLowColor") is not Color effectLowColor)
{
    Debug.Assert(false);
    Log.Error("Failed to find GsEffectLowColor");
}
else
{
    palette.EffectLowColor = effectLowColor;
}
 
if (Application.Current.TryFindResource("GsEffectHighColor") is not Color effectHighColor)
{
    Debug.Assert(false);
    Log.Error("Failed to find effectHighColor");
}
else
{
    palette.EffectLowColor = effectHighColor;
}
 
 
 
var theme = new Windows8TouchTheme();
StyleManager.ApplicationTheme = theme;






Vladimir Stoyanov
Telerik team
 answered on 14 Jan 2021
4 answers
166 views

I have added NoXaml assemblies in WPF .NET 5 application. I had added all necessary xaml theme files for Windows 8, Green, Fluent and Office 2019 theme.

 

I noticed that RadRichTextBox dialogs are not working on Office 2019 theme, Other themes are working fine. I verified all themes are importing same xaml file. 

Also I did not added custom styles to Radrichtextbox. 

 

for reference following are xaml files i added.

<ResourceDictionary.MergedDictionaries>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/System.Windows.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.Chart.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.Data.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.Navigation.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.Input.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.GridView.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.RibbonView.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Cloud.Controls.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.DataVisualization.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.RichTextBox.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.ImageEditor.xaml"/>
               <ResourceDictionary Source="/Telerik.Windows.Themes.Office2019;component/Themes/Telerik.Windows.Controls.Docking.xaml"/>              
               <ResourceDictionary Source="/Telerik.Windows.Controls;component/Themes/FontResources.xaml"/>            
           </ResourceDictionary.MergedDictionaries>

 

 

Kamran
Top achievements
Rank 3
Iron
Iron
Veteran
 answered on 14 Jan 2021
2 answers
160 views

     Hi,

I've added a DataPager to a DataGrid, and now the DataGrid.IsSynchronizedWithCurrentItem property is not working.  How can I resolve this?  Below is my code...

<DockPanel LastChildFill="True">
    <telerik:RadDataPager x:Name="radDataPager"
    DockPanel.Dock="Bottom"
                          Source="{Binding GridData}"
                          PageSize="100"
                          DisplayMode="All"
                          AutoEllipsisMode="After"
                          NumericButtonCount="5"/>
    <telerik:RadGridView x:Name="radGridView"
                         Margin="0"
                         Width="{Binding ElementName=GridViewGrid, Path=ActualWidth}"
                         EnableColumnVirtualization="True"
                         EnableRowVirtualization="True"
                         AlternateRowBackground="AliceBlue"
                         ItemsSource="{Binding PagedSource, ElementName=radDataPager}"
                         SelectionUnit="FullRow"
                         RowIndicatorVisibility="Collapsed"
                         GridLinesVisibility="None"
                         ScrollMode="Deferred"
                         FilteringMode="Popup"
                         CanUserFreezeColumns="False"
                         AutoGenerateColumns="True"
                         ColumnWidth="Auto"
                         IsSynchronizedWithCurrentItem="True"
                         IsReadOnly="True"
                         IsTabStop="False"
                         ValidatesOnDataErrors="InEditMode"
                         amUI:GridViewEventManager.IsEnabled="True"
                         amUI:LookupTextBoxFilterBehavior.LookupTextBox="{Binding ElementName=LookupTextBox}">
    </telerik:RadGridView>
</DockPanel>

 

Vladimir Stoyanov
Telerik team
 answered on 14 Jan 2021
1 answer
140 views

Hello,

We are currently looking for a way to extend the RadGridView with the ability to search using boolean and comparison operators. Our gridview is bound to a list that is filled with data from our database according to the search text (e.g. for a number field "<100 & >50"). In principle, this works without any problems.

However, the GridView then performs another search in the code, corresponding to a column for the same search text. This logically leads to an empty list, as the search text does not apply to a number field, but we have not yet found a way to bypass the code-based search without also deactivating the search headers etc.

Our question is accordingly at this point:
Is there a way to deactivate the search in the code?
If not, is it possible to bypass it in another way - for example by removing the binding of the search text box and manually searching through a "KeyDown Event"?

Many thanks in advance!

Dilyan Traykov
Telerik team
 answered on 14 Jan 2021
2 answers
149 views
Hello there !
Happy new year all !

I'm trying to do a little change on the standard ScrollBars linked to a RadDiagram.
What I'd like to accomplish is to reduce the move made on the diagram when we click on the two RepeatButton of the ScrollBar.

To manage this modification on the ScrollBar, we usually modify the property SmallChange to adapt to the behaviour we want.

So I tried to add the property in the ScrollBar style used in our telerik:RadDiagram:Resources, but it doesn't change anything apparently.
Then I read that this property is bypassed by the framework when the ScrollBars are in a ScrollViewer (https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Controls/ScrollViewer.cs,b3cec2f89df004cd).

My second try was to add a new ControlTemplate for the ScrollViewer of the RadDiagram, and link it to my ScrollBar Style with the property updated.

However I just read on a topic here that it's not really a ScrollViewer that is added when we set the ScrollViewer.HorizontalScrollBarVisibility/ScrollViewer.VerticalScrollBarVisibility of the RadDiagram to Visible, but only ScrollBars.

I'm a little bt stuck on this issue.

Did I did/understand something wrong about this or is there any way to change the standard move effect on the RepeatButton of the RadDiagram ScrollBars ? 

Thanx a lot for reading this, and maybe help me :D


Adrien
Top achievements
Rank 1
 answered on 13 Jan 2021
6 answers
358 views

I want to change some controls to fluent.light style in the default fluent.dark style.

Load the Fluent.Dark when the program start.

 

MainWindow.xaml.cs

public MainWindow()
{
    FluentPalette.LoadPreset(FluentPalette.ColorVariation.Dark);
    InitializeComponent();
}

 

However, some of the screens are bright, I would like to apply the Fluent.Light style to specific control.
(ex, Telerik controls and default controls(buttons etc))

Different styles have theme xaml. so I can overwrite them, but Fluent seems different.

When the entire style is defined, is there a way to change the control from Fluent.Dark to Fluent.Light in some UI groups (such as Grid)?

 

 

 

 

Carlton
Top achievements
Rank 1
 answered on 13 Jan 2021
3 answers
162 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?