Telerik Forums
UI for WPF Forum
0 answers
102 views

Is the a way to select a style by key from styles in app.xaml in the telerik:RadGridView.Resources section

e.g.

<telerik:RadGridView.Resources>
<!-- add xaml to select key GridViewCellType1 -->
</telerik:RadGridView.Resources>

 

<!-- style in app.xaml  -->

<Style x:Key="GridViewCellType1"
    TargetType="telerik:GridViewCell">
    <Setter Property="FontSize"
            Value="14" />
    <Setter Property="FontWeight"
            Value="Normal" />
    <Setter Property="CurrentBorderBrush"
            Value="Transparent" />
    <Setter Property="BorderBrush"
            Value="Transparent" />
</Style>

 

Paul
Top achievements
Rank 2
Iron
Iron
Iron
 asked on 20 Dec 2023
2 answers
76 views

The screenshot shows the application with the 2023.3.1009 build and on the right with the new 2023.3.1114 build.

As you can see on the bottom of the radpane the is now a blue strip in front of the control.
What do i need o check or change to get rid of that again and have the same result as before?

Stijn
Top achievements
Rank 1
Iron
 answered on 19 Dec 2023
1 answer
73 views

When using the RadGridView WPF component in conjunction with RadDataPager, how can I obtain the total number of grid elements ?

The MyRadGridView.Items method returns only the number of elements on the current page !

Thanks for your help

Stenly
Telerik team
 answered on 18 Dec 2023
1 answer
74 views

I have a RadBusyIndicator and inside it I have several other controls; the structure is bit complex and there are several DB operations are performed in that and while performing that DB operations we are setting IsBusy property of RadBusyIndicator as per progress to true and false. But after invoking this property keyboard focus is shifted to the main window which is not the correct behavior. 

I want my focus on the current control from where I am calling some commands, and it is doing some DB operations.

I have gone through the below solution, but it is not much helpful in my case because the structure of my code is bit complex and I don't want BusyIndication invoked every five seconds as mentioned in this link - "how to restore the focus"

Any help regarding this is much appreciated.

Dimitar
Telerik team
 answered on 15 Dec 2023
1 answer
61 views

We are using the RadCartesianChart component to plot datasets that contain digitized signals from a communications channel. The signals are periodic in nature, and we divide the stream into a series of single period datasets. We will then plot all the datasets on the same RadCartesianChart using a common time reference. The result will be a large number of datasets overlaid on the same Cartesian surface.

So far so good.

Now we want the visual image to use color to show density of the overlaid plots similar to a communications eye diagram as shown below. In that diagram there are 8 million overlaid signals, and the colors encode a density scale allowing visualization of the distribution of discrepancies in the overlaid signals. Is this possible using the RadCartesianChart component? If not directly supported are there mechanisms to customize the plotting to achieve something like this?

Martin Ivanov
Telerik team
 answered on 14 Dec 2023
0 answers
120 views

Hello,

I'm trying to add row details to my RadGridView based on my model class. I'd like to avoid adding a lot of XAML code if possible.

Could someone please take a look at the attached example?

Thierry
Top achievements
Rank 1
 asked on 12 Dec 2023
1 answer
87 views

Hi,

I have a problem, that I cannot solve. I have a Grid View (see attachment) based on a SQL Table. Now have replaced some colums with a comboBox.

The comboBoxes receive the data from the following table.

| ID  |  Country |  Plant  |  Area  |  Machine |
------------------------------------------------
|  1  |   DE     |   MUC   |  BA    |   A      |
|  2  |   DE     |   MUC   |  BA    |   A      |
|  3  |   AT     |   VIE     |  BE    |    1      |
|  4  |   AT     |   VIE     |  BE    |    2      |

F.e. The column "Country" in my GridView has as ItemSource a grouping of the column Country. Now I want to update the comboBox "Plant" depending on the value of the ComboBox "Country" meaning that when "DE" is chosen, it should only show "MUC" as a possible entry. How can I do that? Here is my code.

Thanks.


 public partial class MainWindow : Window
 {
     private SqlConnection connection;
     private string dbName = string.Empty;
     
     public MainWindow()
     {
         InitializeComponent();
         LoadData();
     }

     private void LoadData()
     {

         try
         {
             string connectionString = "Data Source=localhost;Initial Catalog=Test_DB;Integrated Security=True";
             using (SqlConnection connection = new SqlConnection(connectionString))
             {
                 connection.Open();
                 string query = "SELECT * FROM dbo.MachineAreas";
                 SqlDataAdapter adapter = new SqlDataAdapter(query, connection);
                 DataTable dataTable = new DataTable();
                 adapter.Fill(dataTable);

                 gridMachineAreas.ItemsSource = dataTable.DefaultView;
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error: " + ex.Message);
         }
     }

     private void GridMachineAreas_AutoGeneratingColumn(object sender, GridViewAutoGeneratingColumnEventArgs e)
     {            

         switch ((e.Column as GridViewDataColumn).DataMemberBinding.Path.Path)
         {
             case "ID":
                 var newColumn1 = new GridViewDataColumn();
                 newColumn1.CopyPropertiesFrom(e.Column);
                 newColumn1.Header = "ID";
                 newColumn1.Width = 60;
                 e.Column = newColumn1;
                 break;

             case "Country":
                 var newColumn2 = new GridViewComboBoxColumn();
                 newColumn2.CopyPropertiesFrom(e.Column);
                 newColumn2.Header = "Country";
                 newColumn2.Width = 60;
                 newColumn2.UniqueName = "Country";
                 newColumn2.IsComboBoxEditable = false;
                 newColumn2.ItemsSource = MakeCountryCollection();                    
                 
                 e.Column = newColumn2;
                 break;
             case "Plant":
                 var newColumn3 = new GridViewComboBoxColumn();
                 newColumn3.CopyPropertiesFrom(e.Column);
                 newColumn3.Header = "Plant";
                 newColumn3.Width = 60;                    
                 e.Column = newColumn3;
                 break;
             case "Area":
                 var newColumn4 = new GridViewComboBoxColumn();
                 newColumn4.CopyPropertiesFrom(e.Column);
                 newColumn4.Header = "Area";
                 newColumn4.Width = 60;
                 e.Column = newColumn4;
                 break;
             case "Machine":
                 var newColumn5 = new GridViewComboBoxColumn();
                 newColumn5.CopyPropertiesFrom(e.Column);
                 newColumn5.Header = "Machine";
                 newColumn5.Width = 60;
                 e.Column = newColumn5;
                 break;
         }

     }

     private List<string> MakeCountryCollection()
     {
         List<string> countryCollection = new List<string>();
         string query = "SELECT Country FROM dbo.MachineAreas Group By Country";
         
         try
         {
             string connectionString = "Data Source=localhost;Initial Catalog=Test_DB;Integrated Security=True";
             using (SqlConnection connection = new SqlConnection(connectionString))
             {
                 connection.Open();


                 using (SqlCommand command = new SqlCommand(query, connection))
                 {
                     using (SqlDataReader reader = command.ExecuteReader())
                     {


                         while (reader.Read())
                         {
                             string value = reader.GetString(0);
                             countryCollection.Add(value);
                         }
                         
                     }
                 }
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error: " + ex.Message);
         }
         return countryCollection;
     }
 }


Dimitar
Telerik team
 answered on 12 Dec 2023
1 answer
76 views

Hey im using the telerik PercentComboBox and i want to change language of the FitToPage and FitToWidthto be displayed in german.

 

  <telerik:PercentComboBox DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:DialogControl}}}"
                           Value="{Binding ScaleFactor,ElementName=pdfViewer, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                           RadPdfViewer="{Binding ElementName=pdfViewer}" ShowFitToWidth="True" ShowFitToPage="True"
                           telerik:Windows11ThemeSizeHelper.EnableDynamicAnimation="True" Language="de-DE">
      <telerik:PercentComboBox.PercentValues>
          <telerik:Percent Value="200"/>
          <telerik:Percent Value="150"/>
          <telerik:Percent Value="125"/>
          <telerik:Percent Value="110"/>
          <telerik:Percent Value="100"/>
          <telerik:Percent Value="90"/>
          <telerik:Percent Value="75"/>
          <telerik:Percent Value="50"/>
          <telerik:Percent Value="30"/>
      </telerik:PercentComboBox.PercentValues>
  </telerik:PercentComboBox>

 

Hope there is a way. Thanks

Dominik

Stenly
Telerik team
 answered on 12 Dec 2023
1 answer
106 views

I just started WPF trial. I need help though. I am going to have large grids (10Ks rows x 100 columns) with frequent update of certain cells (100s upd/sec).

I am not sure I can use your virtual grid - need more time to understand what are the drawbacks.

So I use RadGridView (see below - this is not final version - just a first try - what I quickly read in your article on making grid more performant).

Columns are made in C# and bound to dictionaries using string key like: `Binding("f[NAME].Value")` where `Value` is of type object (this is best I can do - dont ask - a requirement i cannot circumvent)

Now, what is my question here - when I load grid with data initially - most of the values in cells arent available yet. I am asked to display something to highlight that state. Also sometime some rows might get unavailable in the middle of use. But bottom line - these "unavailable" cues are going to live may be 0.5% of the grid life-time..

I dont want to write cell templates that will lengthen the visual tree and  make grid slow for something that i need for very short period of time.. 

Is there a way to optimise it?

One theory - add something to the visual tree in the beginning and then take it away.. (like walking visual tree manually and inserting a semi-transparent red border or something like that? or changing template of rows, that have became available, into lightweight ones). Concern here - binding might get broken after manipulation with visual tree..

Or I can set all the values to a string like "N/A". However concern here is that what happens with the columns types in this case? Wont this screw the grid ability to sort/filter - because columns will pick up initial "string" type and later, when I change it to real data, (can be date/number/etc) - they break down completely.

Can I set columns type explicitely after N/A disappeared (however not clear - N/A might stay in some rows longer than in others and few could be N/A for lot longer)...

Any trick you can recommend?

NOTE: the same question applies on tree view (even more so)

 

<telerik:RadGridView x:Name="dg" ItemsSource="{Binding data}" ValidatesOnDataErrors="InEditMode" IsPropertyChangedAggregationEnabled="False" GroupRenderMode="Flat" ShowGroupPanel="False"AutoGenerateColumns="False"CanUserFreezeColumns="False"RowIndicatorVisibility="Collapsed"CanUserResizeColumns="False">

Martin Ivanov
Telerik team
 answered on 08 Dec 2023
0 answers
63 views
Hello,

I am occasionally receiving an ArgumentOutOfRangeException with the message 'The added or subtracted value results in an un-representable DateTime.' while scrolling on mouse.


Stack Trace:

   at System.DateTime.Subtract(TimeSpan value)
   at Telerik.Windows.Controls.TimeBarBase.ZoomOut(Double centerOffsetPercentage)
   at Telerik.Windows.Controls.TimeBarBase.OnMouseWheel(MouseWheelEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at -.dje_zAQG4QXAUTAXTGKYLAMESW_ejd.Main()

Thanks in advance.
bilge
Top achievements
Rank 1
 asked on 08 Dec 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Anislav
Top achievements
Rank 6
Silver
Bronze
Bronze
Jianxian
Top achievements
Rank 1
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Jim
Top achievements
Rank 2
Iron
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?