Telerik Forums
UI for WPF Forum
3 answers
333 views

Hello,

I am using VS Professional 2015, DevCraft Ultimate version 2016.2.613, UI for WPF RadListBox.  Using Office2013 Theme, I wish to override the color of a RadListBox's selected RadListBoxItem.  I also want to override this background color for mouseover.  Currently these are an orange color and I want to change that.  My understanding is that the RadListBoxItem control template has a border named "SelectedVisual" and I need to override its background color.  Maybe something similar for mouseover? (haven't got there yet).  My problem is that I can't figure out how to do any of this using Expression Blend 2015.  I'm on the Objects and Timeline pane and when I right click on my RadListBox I don't see an option for "Edit Additional Styles" which I think would get me to the RadListBoxItem's style.  I do see "Edit Additional Templates" but nothing I try around that option is getting me to the "SelectedVisual" border.  I would welcome any info on 1) how to do this in Blend or 2) any recommended alternative method to override RadListBoxItem's selected and mouseover background colors.  Please see attached imagesto better visualize what I'm trying to do.

 

Thanks,

Chris

Chris
Top achievements
Rank 1
 answered on 24 Aug 2016
1 answer
318 views

I am using WPF. I want to Export the selected Rows from the RadGridView to Excel. I have managed to export all the rows to Excel, but if the user makes a selection I want to export only the selected rows to Excel. Here is my code below, I just need ti implement the TODO section. Can someone help ?

 

 

 

01.public void Execute_OpenExportView(RadGridView gridViewExport)
02.   {
03.       if (gridViewExport==null)
04.       {
05.           return;
06.       }
07. 
08.       string extension = "xlsx";
09.       SaveFileDialog dialog = new SaveFileDialog()
10.       {
11.           DefaultExt = extension,
12.           Filter = String.Format("{1} files (*.{0})|*.{0}|All files(*.*)|*.*", extension, "Excel"),
13.           FilterIndex = 1,
14.           AddExtension = true,
15.           Title = "Export to Excel",
16.           //FileName =
17.       };
18. 
19. 
20.       //TODO export the selected rows from RadGRidView
21.       if (gridViewExport.SelectedItems.Count!=0)
22.       {
23. 
24. 
25.       }
26. 
27.       if (dialog.ShowDialog()==true)
28.       {
29.           using (Stream stream = dialog.OpenFile())
30.           {
31.               gridViewExport.ExportToXlsx(stream,
32.                   new GridViewDocumentExportOptions()
33.                   {
34.                       ShowColumnFooters = true,
35.                       ShowColumnHeaders = true,
36.                       ShowGroupFooters = true,
37.                       AutoFitColumnsWidth = true,
38.                   });
39.           }
40.       }
41. 
42.   }

Devid
Top achievements
Rank 1
 answered on 24 Aug 2016
1 answer
255 views

hi dear supporters,

i have used the connection content  and connection points to route the connection.

now, the connection content is positioned in the middle of the connection but i need to position it in other positions.

the image is attached.

my code is also here.

how can i get the needed position of the connection content.

        private void diagram1_ConnectionManipulationCompleted(object sender, ManipulationRoutedEventArgs e)
        {
            var image = new System.Windows.Controls.Image() { Source = new BitmapImage(new Uri("components/" + "conn"+ ".png",UriKind.Relative)) };
            System.Windows.Point startPoint= e.Connection.StartPoint;
            System.Windows.Point endPoint= e.Connection.EndPoint;
            double deltaX = Math.Abs(endPoint.X - startPoint.X);
            double deltaY = Math.Abs(endPoint.Y - startPoint.Y);
            image.Stretch=Stretch.Fill;
            image.Width = 0.8*Math.Max(deltaX,deltaY);
            image.Height = 5;
            TextBlock txt = new TextBlock();
            txt.Text = strSelectedComponent;
            StackPanel stpanel = new StackPanel();            
            stpanel.Children.Add(txt);
            stpanel.Children.Add(image);            
            Viewbox viewBox = new Viewbox() { Stretch = Stretch.None, Margin = new Thickness(-4) };
            viewBox.Child = stpanel;
            e.Connection.ConnectionPoints.Add(new System.Windows.Point(endPoint.X,startPoint.Y));
            e.Connection.Content = viewBox;
        }

Dinko | Tech Support Engineer
Telerik team
 answered on 24 Aug 2016
4 answers
559 views

Hi, I tried to follow the examples in this thead but I can't get it working. Can someone show me ho to set the backgroud of the rows where the columns Quantità and QtaPrelevata have the same value? 

VB.net please. 

 

<telerik:RadDataPager x:Name="rDataPager" PageSize="10" Source="{Binding Items, ElementName=gridOrdini}" ></telerik:RadDataPager>
            <telerik:RadGridView x:Name="gridOrdini" SelectionUnit="FullRow"  AutoGenerateColumns="False" CanUserInsertRows="False" CanUserDeleteRows="False" RowIndicatorVisibility="Collapsed"
        ShowGroupPanel="False" IsReadOnly="False" Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" SelectionMode="Single" CanUserReorderColumns="False" 
            FontFamily="Source Sans Pro Semibold" FontSize="14" GridLinesVisibility="Horizontal" IsFilteringAllowed="False">
                <telerik:RadGridView.Columns>
                    <telerik:GridViewDataColumn x:Name="Vettore1" UniqueName="Vettore1" Header="Vettore" IsReadOnly="True" IsVisible="False" Width="60" DataMemberBinding="{Binding Vettore1}"/>
                    <telerik:GridViewDataColumn x:Name="Articolo" Header="Articolo" IsReadOnly="True" DataMemberBinding="{Binding Articolo}" Width="100"/>
                    <telerik:GridViewDataColumn x:Name="Descri" Header="Descri" IsReadOnly="True" DataMemberBinding="{Binding Descri}" Width="*"/>
                    <telerik:GridViewDataColumn x:Name="Quantita" Header="Quantità" IsReadOnly="True" DataMemberBinding="{Binding Quantita}" Width="80"/>
                    <telerik:GridViewDataColumn x:Name="QtaPrelevata" Header="Qta Prelevata" IsReadOnly="True" DataMemberBinding="{Binding QtaPrelevata}" Width="80"/>
                    <telerik:GridViewDataColumn x:Name="Reparto" Header="Reparto" IsReadOnly="True" DataMemberBinding="{Binding Reparto}" Width="80"/>
                    <telerik:GridViewDataColumn x:Name="UnMis" Header="UnMis" IsReadOnly="True" DataMemberBinding="{Binding UnMis}" Width="60"/>
                    <telerik:GridViewDataColumn x:Name="Cella" Header="Cella" IsReadOnly="True" DataMemberBinding="{Binding Cella}" Width="60"/>
                    <telerik:GridViewDataColumn x:Name="GruppoCella" Header="GruppoCella" IsReadOnly="True" DataMemberBinding="{Binding GruppoCella}" Width="80"/>
                    <telerik:GridViewDataColumn x:Name="CatMerc" Header="CatMerc" IsReadOnly="True" DataMemberBinding="{Binding CatMerc}" Width="80"/>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>

 

Thank you very mutch

Start Informatica
Top achievements
Rank 1
 answered on 24 Aug 2016
3 answers
181 views

Hi all,

I am working on a WPF application using Telerik and coded in C# .NET.
My following question is over a WPF page using the “Code behind” model to implement the logic of the page.

Currently, I have a <telerik:RadGridView> for which the source is the DefaultView of a DataTable containing 365 columns (or 366, it depends on the number of days in a year).

But I am facing an issue :

The source of the RadGridView is a 365/6 columns DataTable (DefaultView).

It does not seem that all the columns are loaded at the begining.
I mean that I have to scroll 3 times to the end of the scrollbar to make all the 365/6 columns appear . => This could be another issue, but it is my opinion.
I would like to know how to load all that columns at once ?

Any help or tip will be much appreciated :)

Stefan Nenchev
Telerik team
 answered on 24 Aug 2016
3 answers
201 views

I have a fairly complicated application that includes a RadDataForm that contains a TextBox that is supposed to allow a user to type multiple lines. The TextBox has TextWrapping="Wrap" and AcceptsReturn="True", but it doesn't work, of course, because RadDataForm binds the return key, and commits the form, regardless of what type of field has the focus.

So I wrote a simple DataFormCommandProvider:

public class ClearReturnKeyActionCommandProvider : DataFormCommandProvider
{
    public ClearReturnKeyActionCommandProvider()
        : base(null)
    {
    }
 
    public ClearReturnKeyActionCommandProvider(RadDataForm dataForm)
        : base(dataForm)
    {
        this.DataForm = dataForm;
    }
 
    public override List<DelegateCommandWrapper> ProvideCommandsForKey(KeyEventArgs args)
    {
        var actionsToExecute = base.ProvideCommandsForKey(args);
        if (args.Key == Key.Return)
        {
            actionsToExecute.Clear();
        }
 
        return actionsToExecute;
    }
}

Stick this in a resource, and set the form's CommandProvider, and suddenly I can enter multiple lines in the TextBox:

<telerik:RadDataForm Grid.Row="1" Grid.Column="0"
    ItemsSource="{Binding Path=viewModel.contacts, RelativeSource={RelativeSource AncestorType=KtWpf:ContactsControl}}"
    AutoGenerateFields="False"
    EditTemplate="{StaticResource contactsEditTemplate}"
    NewItemTemplate="{StaticResource contactsEditTemplate}"
    ReadOnlyTemplate="{StaticResource contactsEditTemplate}"
    AutoEdit="False"
    CommandButtonsVisibility="None"
    CommandProvider="{StaticResource clearReturnKeyActionCommandProvider}"
    InitializingNewItem="radDataForm_InitializingNewItem"
    EditEnding="radDataForm_EditEnding"
    />

And, of course, something else breaks.

I have a pair of save and cancel buttons, outside the form, that set RadDataFormCommands.CommitEdit and RadDataFormCommands.CancelEdit.

<telerik:RadButton Style="{StaticResource actionButton}"
    Content="Save"
    Command="telerik:RadDataFormCommands.CommitEdit"
    CommandTarget="{Binding ElementName=radDataForm}"
/>
 
<telerik:RadButton Style="{StaticResource actionButton}"
    Content="Cancel"
    Command="telerik:RadDataFormCommands.CancelEdit"
    CommandTarget="{Binding ElementName=radDataForm}"
    />

When I do not have the CommandProvider set, these work fine. But when I do, they're disabled. Both of them are disabled, even the Cancel button, which isn't ever supposed to be disabled.

This should be simple. What am I doing wrong?

Dilyan Traykov
Telerik team
 answered on 24 Aug 2016
1 answer
187 views
Hello, I trying to achieve a vertical line below the minor ticks to show up in the timeline of the RadGanttView. Can you extend a thin line below the minor ticks (or major ticks) to help the user see which time it is in the timeline as a visual cue?
Nasko
Telerik team
 answered on 24 Aug 2016
3 answers
147 views

I have a RadDataForm, and need to be informed when the form's validation status changes.

What I thought I could do was to listen to RadDataForm.ValidationSummary.Errors.CollectionChanged, but unfortunately, even as late as RadDataForm.Loaded, RadDataForm.ValidationSummary is null.

Is there some event that RadDataForm fires when its validation status changes?

Or some event that RadDataForm fires after its ValidationSummary has been created?

Stefan Nenchev
Telerik team
 answered on 24 Aug 2016
1 answer
128 views

Hello,

I'm using a GridView with data bound via VirtualQueryableCollectionView (like in this example: http://docs.telerik.com/devtools/wpf/consuming-data/using-data-virtualization).

 

When a user double clicks a row, I show a detail form and after the user is done editing and closes the form, I reload the data to reflect the changes made by this and other users.

 

After loading the data, I would like to highlight the row the user just edited.

 

When the GridView is bound do a normal list of data, I can easily do that by querying for the object in the loaded data and then setting

gridView.SelectedItem = x

but since switching to the VirtualQueryableCollectionView, this doesn't work any more.

 

Is there any way to select a data item / row in a GridView that uses VirtualQueryableCollectionView as DataContext?

 

Martin
Telerik team
 answered on 23 Aug 2016
1 answer
219 views

Hi all,

I am working on a WPF application using Telerik and coded in C# .NET.
My following question goes over an ASP .NET page using the model “Code behind” to implement the logic of the page.

Presently, I have a <telerik:RadGridView> for which the scrollbar moves at the same time as the RadGanttView chart scrollbar.

But I am facing to an issue : 

I would like to get the MinorTick actual width and apply it to the RadGridView columns.

I edited a copy of the template of the GanttView in order to find (I hoped) the width value of the MinorTick. I did not find it.

I accessed the MinorTick's Interval and I tried to apply it to the RadGridView columns, but I cannot.

How could I do to have RadGridView columns with the same width as the one from the RadGanttView chart columns ?


Any help or tip will be much appreciated :)

Yana
Telerik team
 answered on 23 Aug 2016
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
NavigationView (Hamburger Menu)
Wizard
ExpressionEditor
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
Callout
PasswordBox
SplashScreen
Localization
Rating
Accessibility
CollectionNavigator
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?