Telerik Forums
UI for WPF Forum
3 answers
198 views
I am not able to launch the WPF Demos, in my system, i have the SQL'14 express version. but when i start to install the WPF they said to install SQL'08 Express so that i cant install it. they are showing the  below error

component SQL Server 2008 express has failed to install with the following error message" An error occurred attempting to install SQL server 2008 express service pack.1"
The Following COmponenets failed to install
-SQL server 2008 Express/
Kalin
Telerik team
 answered on 17 Jan 2017
4 answers
224 views

Hi,

I'm new in WPF and I would like to know is possible to display in a RadGridView the headers with their details?

I have two DataTable which the first keep the header values and the second Datatable keeps the details values from a database. I'm able to display the header values in the RadGridview but I couldn't find how to display their details for each header.

For Example:

The RadGridView shows the Sales Number, Sales date and total then when the user clicks in the Sales number row it displays the Sales details with all the products and their descriptions.

I would appreciate your help or any suggestions.

Regards,

Oscar

Oscar
Top achievements
Rank 1
 answered on 16 Jan 2017
7 answers
279 views

Hello Telerik,

 

In my char, i'm using Cartesian & Bar Series. For the BarSeries, I'm using a "Custom Rectangle". My code :

BarSeries seriePluvio = new BarSeries();
 
//set attributs...
//....
//-------------
 
//Create a template for for custom bar
DataTemplate dt1 = new DataTemplate { DataType = typeof(System.Windows.Shapes.Rectangle) };
FrameworkElementFactory dt1Factory = new FrameworkElementFactory { Type = typeof(System.Windows.Shapes.Rectangle) };
 
//Set color for the bar --> IS OK
dt1Factory.SetValue(System.Windows.Shapes.Rectangle.FillProperty, new SolidColorBrush(param.CouleurMesuresValides));
 
//Set the width of the bar --> IS OK
double d = new double();
d = (Convert.ToDouble(param.EpaisseurTraitMesuresValides));
dt1Factory.SetValue(System.Windows.Shapes.Rectangle.WidthProperty, d);
 
//Set the line style of the bar --> IS NOK
dt1Factory.SetValue(System.Windows.Shapes.Rectangle.StrokeDashArrayProperty, new DoubleCollection { 2, 2, 2, 2 });
 
//The end of the code...
dt1.VisualTree = dt1Factory;
seriePluvio.PointTemplates.Add(dt1);
//...............

 

So, my problem is that the LineStyle is not applied. I tried with differents values/parameters for the DoubleCollection but this is always the same result. No visual changement.

 

I'm using StrokeDashArrayProperty because this is the used property for the CartesianSeries.

Can you help me ?

 

Thank you very much !

Tanya
Telerik team
 answered on 16 Jan 2017
4 answers
659 views

Hi,

I have all my code working great except for this one thing. When I add an item to the bound collection of the gridview my rowdetails template displays and all is well except that the + does not toggle to a -. How do I change this via code? I tried doing it in the OnCollectionChanged event (for the Add action) by setting the IsExpanded flag,  but when I try to do a GetRowForItem, it returns null. If I try to find the selected item via MyGrid.ChildrenOfType<GridViewRow>(), ALL the items are null.

Help!!!

Thanks ... Ed

Randy Hompesch
Top achievements
Rank 1
 answered on 16 Jan 2017
5 answers
215 views

I am evaluating radpdfviewer and seeing Telerik.Windows.Documents.Core.Shapes instances ( Line Segment,Path Segment) are not cleaned up when taking memory snapshot in profiling app which invokes garbage collector. I am wondering why?

I initialize pdfviewer to read file on demand and use while loop to cycle through pages

 

pdfViewer.GoToPage(page) in a loop

when rerach last page I make page=1 and cycle again

 

 

Thanks

 

Deyan
Telerik team
 answered on 16 Jan 2017
1 answer
376 views

Hello,

I am doing a RadGridView, with data from a LiteDB with MVVM to refuel. This works so far quite well. Now you want to use a buttonbar to edit the data.

<Button Grid.Column = "0"
      Margin = "0,0,3,0"
      Command = "telerik:RadGridViewCommands.Delete"
      CommandTarget = "{Binding ElementName=GridShutdowns}">
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width = "Auto" />
      <ColumnDefinition Width = "10" />
      <ColumnDefinition Width = "*" />
    </Grid.ColumnDefinitions>
    <fa:FontAwesome Icon = "Trash" VerticalAlignment = "Center" HorizontalAlignment = "Center" />
    <TextBlock Grid.Column = "2" VerticalAlignment = "Center" HorizontalAlignment = "Center" Text = "Delete" />
  </Grid>
</Button>
<Button Grid.Column = "1"
      Margin = "0,0,3,0"
      Command = "telerik:RadGridViewCommands.BeginInsert"
      CommandTarget = "{Binding ElementName=GridShutdowns}">
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width = "Auto" />
      <ColumnDefinition Width = "10" />
      <ColumnDefinition Width = "*" />
    </Grid.ColumnDefinitions>
    <fa:FontAwesome Icon = "PlusCircle" VerticalAlignment = "Center" HorizontalAlignment = "Center" />
    <TextBlock Grid.Column = "2" VerticalAlignment = "Center" HorizontalAlignment = "Center" Text = "Insert" />
  </Grid>
 
</Button>
<Button Grid.Column = "2"
      Margin = "0,0,3,0"
      Command = "telerik:RadGridViewCommands.CommitEdit"
      CommandTarget = "{Binding ElementName=GridShutdowns}">
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width = "Auto" />
      <ColumnDefinition Width = "10" />
      <ColumnDefinition Width = "*" />
    </Grid.ColumnDefinitions>
    <fa:FontAwesome Icon = "Save" VerticalAlignment = "Center" HorizontalAlignment = "Center" />
    <TextBlock Grid.Column = "2" VerticalAlignment = "Center" HorizontalAlignment = "Center" Text = "Save" />
  </Grid>
 
</Button>
<Button Grid.Column = "3"
      Margin = "0,0,3,0"
      Command = "telerik:RadGridViewCommands.CancelRowEdit"
      CommandTarget = "{Binding ElementName=GridShutdowns}">
  <Grid>
    <Grid.ColumnDefinitions>
      <ColumnDefinition Width = "Auto" />
      <ColumnDefinition Width = "10" />
      <ColumnDefinition Width = "*" />
    </Grid.ColumnDefinitions>
    <fa:FontAwesome Icon = "Ban" VerticalAlignment = "Center" HorizontalAlignment = "Center" />
    <TextBlock Grid.Column = "2" VerticalAlignment = "Center" HorizontalAlignment = "Center" Text = "Cancel" />
  </Grid>
 
</Button>

 

I use how to see the Comands: RadGridViewCommands.CancelRowEdit, etc. (ShutdownViewModel.cs)

/// <summary>
/// Constructor
/// </summary>
public ShutdownViewModel()
{
  try
  {
    MakeSampleData();
    InitializeCommands();
  }
  catch (Exception exc)
  {
    Log.Error(exc);
  }
}
 
/// <summary>
/// </summary>
private void InitializeCommands()
{
  ICommand deleteCommand = RadGridViewCommands.Delete;
  ICommand saveCommand = RadGridViewCommands.CommitEdit;
 
  //todo: ???
}
 
private void MakeSampleData()
{
  using (var db = new LiteDatabase(FileAndPath.DataBaseFile))
  {
    var ShutdownSources = db.GetCollection<Shutdown>("Shutdowns");
    IEnumerable<Shutdown> shutdownSources = ShutdownSources.FindAll().OrderBy(x => x.Weekday).ThenBy(x => x.ShutdownTime.TimeOfDay);
    if (shutdownSources != null && shutdownSources.Any())
    {
      _shutdowns = new ObservableCollection<Shutdown>(shutdownSources);
    }
    else
    {
      _shutdowns = new ObservableCollection<Shutdown>()
      {
        new Shutdown() {ShutdownId = Guid.NewGuid(), Weekday = 0},
        new Shutdown() {ShutdownId = Guid.NewGuid(), Weekday = 1},
        new Shutdown() {ShutdownId = Guid.NewGuid(), Weekday = 2},
        new Shutdown() {ShutdownId = Guid.NewGuid(), Weekday = 3},
        new Shutdown() {ShutdownId = Guid.NewGuid(), Weekday = 4},
        new Shutdown() {ShutdownId = Guid.NewGuid(), Weekday = 5},
        new Shutdown() {ShutdownId = Guid.NewGuid(), Weekday = 6},
      };
 
      var col = db.GetCollection<Shutdown>("Shutdowns");
      foreach (Shutdown shutdown in _shutdowns)
      {
        col.Insert(shutdown);
        IndexObject(col);
      }
    }
  }
}

 

After InitializeCommands I ask myself the question where I process now actually "saveCommand" and how?

Is that correct?

/// <summary>
/// SelectedItem
/// </summary>
public Shutdown SelectedShutdown
{
  get { return _selectedShutdown; }
  set
  {
    if (_selectedShutdown != value)
    {
      _selectedShutdown = value;
      OnPropertyChanged(nameof(SelectedShutdown));
    }
  }
}
 
/// <summary>
/// </summary>
private void InitializeCommands()
{
  ICommand deleteCommand = RadGridViewCommands.Delete;
  ICommand saveCommand = RadGridViewCommands.CommitEdit;
 
  //todo: ???
 
  saveCommand.Execute(SaveShutdown());
}
 
private object SaveShutdown()
{
  try
  {
    if (SelectedShutdown != null)
    {
      using (var db = new LiteDatabase(FileAndPath.DataBaseFile))
      {
        //todo: save/update Shutdown for DB
      }
    }
  }
  catch (Exception exc)
  {
    Log.Error(exc);
  }
  return null;
}

 

How do I use the RadGridViewCommands to edit data in the DB?

Thanks for your help

 

 

 

 

 

 

Dilyan Traykov
Telerik team
 answered on 16 Jan 2017
1 answer
111 views

 

I have two controls in a GridViewDataColumn (LinkButton and Texblock) and only one control is visible at a time.

 

<Controls:GridViewDataColumn DataMemberBinding="{Binding Id, Mode=OneWay}"
                                  Header="{x:Static lr:TransactionHistoryRes.Id_Header_Text}"
                                  UniqueName="TransactionHistoryModelId" Width="130">
                         <Controls:GridViewDataColumn.CellTemplate>
                           <DataTemplate>
                             <Grid>
                               <max:LinkButton HorizontalAlignment="Right"
                                       Command="{Binding DataContext.OpenDocumentCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=Views:TransactionHistoryView}}"
                                       CommandParameter="{Binding Path=.}"
                                       Content="{Binding Path=Id}"
                                       Visibility="{Binding Path=CanCreateOrViewDocument, Converter={StaticResource BooleanToVisibilityCollapsedConverter}}">
                               </max:LinkButton>
 
                               <TextBlock HorizontalAlignment="Right"
                                          Text="{Binding Path=Id}"
                                          ToolTip="{Binding Path=Information}"
                                          Visibility="{Binding Path=CanCreateOrViewDocument, Converter={StaticResource ReverseBooleanToVisibilityCollapsedConverter}}"/>
                             </Grid>
                           </DataTemplate>
                         </Controls:GridViewDataColumn.CellTemplate>
                       </Controls:GridViewDataColumn>

 

When the grid initially load, it works fine. 

However, there's a wierd behavior that if you SORT the column, initially - the LinkButtons wont show even if it's visibility = true

When you try to sort the column again, the LinkButtons are shown "gradually". (see video link below)

https://youtu.be/GI5G-WaPy-k

When I tried to remove the <Texblock> and just retain the LinkButton, its not behaving like this so I think its something about putting two controls in the cell template. I tried separating the two controls by stackpanel but sill the same behaviour.

 

Thanks,
Karlo

 

Stefan Nenchev
Telerik team
 answered on 13 Jan 2017
1 answer
113 views

hi

I wanna to use  RadTileView with pdfviewer  in each content that display employee salary slips

Lance | Senior Manager Technical Support
Telerik team
 answered on 12 Jan 2017
5 answers
274 views
Hi,

I'm searching for a solution to filter the source immediately when the user types in the filter criteria. This is my declaration in my xaml:

<telerik:RadGridView Name="grvKanten" AutoGenerateColumns="False" IsReadOnly="True" CanUserReorderColumns="True" FilteringMode="FilterRow"
                     FilterOperatorsLoading="grvKanten_FilterOperatorsLoading" >
    <telerik:RadGridView.Columns>
        <telerik:GridViewDataColumn Name="colKantenname" DataMemberBinding="{Binding Kantenname}" Header="Kantenname" MinWidth="150"/>
        <telerik:GridViewDataColumn Name="colKantenbreitenname" DataMemberBinding="{Binding Kantenbreitenname}" Header="Kantenbreiten-Name" MinWidth="150"/>
        <telerik:GridViewDataColumn Name="colLagerplatz" DataMemberBinding="{Binding Lagerplatzname}" Header="Lagerplatz" MinWidth="150"/>
        <telerik:GridViewDataColumn Name="colLaenge" DataMemberBinding="{Binding Laenge}" Header="Länge" MinWidth="100"/>
        <telerik:GridViewDataColumn Name="colDekor" DataMemberBinding="{Binding Dekor}" Header="Dekor" MinWidth="100"/>
        <telerik:GridViewDataColumn Name="colBreie" DataMemberBinding="{Binding Breite}" Header="Kantenbreite" MinWidth="100"/>
    </telerik:RadGridView.Columns>
</telerik:RadGridView>

In my codebehind I delete some filter operators and set a default operator for each column when the FilterOperatorsLoading event is fired:
Private Sub grvKanten_FilterOperatorsLoading(sender As System.Object, e As Telerik.Windows.Controls.GridView.FilterOperatorsLoadingEventArgs)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.EndsWith)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsContainedIn)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsEmpty)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsEqualTo)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsGreaterThanOrEqualTo)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsLessThanOrEqualTo)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsNotEmpty)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsNotEqualTo)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsNotNull)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsNull)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.StartsWith)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsLessThan)
      e.AvailableOperators.Remove(Telerik.Windows.Data.FilterOperator.IsGreaterThan)
      e.DefaultOperator1 = Telerik.Windows.Data.FilterOperator.Contains
End Sub

So, if the user types in some filter criterias, I want the underlying source to be immediately refreshed every time the criteria changes without pressing the return button.

I tryed to set IsFilteringDeferred to false and true for some columns, but that doesn't seem to make a difference. The behavior is always the same: I have to press return to refresh the source.

Kind regards
Risa
Top achievements
Rank 1
 answered on 12 Jan 2017
0 answers
144 views

Hello!

      I'm using a "RadGridView" in my application. The grid is in a border with HorizontalAlignment="Stretch". I'm having 8 columns with only 2 of them given fixed widths. Since I want my grid to fill the horizontal space I'm setting the columns width in form of "*" values (e.g. 50* or 100*). Every thing works fine if the amount of data bound is small up-till around 50-70 max. When I bind a collection with more data like around 100-200 the UI starts to distort. The columns do not resize to take the whole space (Se the attached image). I need help asap on this.

 

Regards

Tushar Gupta

 

tushar
Top achievements
Rank 1
 asked on 12 Jan 2017
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
Slider
Expander
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?