Showing posts with label infragistics. Show all posts
Showing posts with label infragistics. Show all posts

Thursday, February 8, 2018

How to add layer to ultrachart for selection

Leave a Comment

I have ultrachart on infragistics which shows 1 hour real time data.

I want to select any time on x-axis using cursor like below;

enter image description here

Currently I can select the datapoints. no problem with that.

However i need to draw rectangle with my mouse and select the datapoints between rectangle borders.

I am kind of helpless because i searched a lot but didn't see similar things on the internet.

How can i make this happen ? I need your knowledge.

1 Answers

Answers 1

I do not know that much about c# but this website might answer your question. Website

That website explains ultracharts, and if that does not answer your question, this website talks about what you can put layers on.

I hope one of these websites help.

Read More

Thursday, May 18, 2017

Tiling Windows Offset using Infragistics Dialog Window

Leave a Comment

I am using the Infragistics XamDialogWindow to approximate an MDI window in WPF.

Basically I have a user control that I assign to the content of the window and then add the XamDialogWindow as a child of a Grid.

I then have two buttons which display the windows as either "Tile" or "Cascade".

The cascade works really well but I am having problems with the Tile method.

I get the available width and height using the "ActualWidth" and "ActualHeight" properties of the container.

I then calculate the number of rows and columns needed.

Next I iterate through the columns and I calculate how many rows there are in a column, (this means that if there are an odd number of windows such as 5 I will have two rows in column 0 and 3 in column 1).

The width of each window is worked out as "AvailableWidth / numColumns"

The height of each window is worked out as "AvailableHeight / WindowsForThisColumn"

I then iterate through the rows and calculate the top left coordinate of the window we are positioning as follows:

left = columnIndex * width

top = rowIndex * height

The Left, Top, Width and Height properties of the window are then set.

PROBLEM

The Left, Top, Width and Height properties seem to be calculated correctly so for example

  • AvailableWidth = 1000;
  • AvailableHeight = 1000;
  • Window1 = 0, 0, 500, 500
  • Window2 = 0, 500, 500, 500
  • Window3 = 500, 0,500, 500
  • Window4 = 500, 500, 500, 500

This should give a nice grid of 4 windows with no margins filling all available space, however this is not the result.

The windows seem to be offset when displayed (see image below).

If I look at the Left, Top, Width and Height properties they all appear to be correct.

The weird thing is, if I click "Tile" a second time they will all appear correctly.

If I move a window after clicking tile the second time, they will appear correctly.

I have tried using a Canvas and setting the Canvas.Left and Top properties, A grid, stackpanel and wrappanel with the same results every time.

Can anyone help me? I think it may be a problem with how WPF measures sizes and locations at Render Time

ImagesOffset

 var childrenToArrange = Children.Where(a => a.WindowState != Infragistics.Controls.Interactions.WindowState.Minimized).ToList();          var availableWidth = Panel.ActualWidth;         var availableHeight = Panel.ActualHeight;          if (Layout == MDILayout.TILE)         {             //get the number of rows and columns             int rows = (int)Math.Sqrt(childrenToArrange.Count);             int columns = childrenToArrange.Count / rows;              var index = 0;             var width = availableWidth / columns;              //iterate through the columns             for (int x = 0; x < columns; x++)             {                 //get the number of windows for this column                 var windowsForThisColumn = rows;                 if (childrenToArrange.Count % columns > (columns - x - 1))                     windowsForThisColumn++;                  var height = availableHeight / windowsForThisColumn;                  //iterate through the rows                 for (int y = 0; y < windowsForThisColumn; y++)                 {                     //get the X and Y coordinates                     var left = x * width;                     var top = y * height;                      //get the window                     var mdiChild = childrenToArrange[index] as XamDialogWindow;                      mdiChild.Margin = new Thickness(0);                     mdiChild.Left = left;                     mdiChild.Top = top;                     mdiChild.Width = width;                     mdiChild.Height = height;                     index++;                 }             }         } 

1 Answers

Answers 1

I've reproduced the issue with your snippet. Please click the following hyperlink to the following forum post at Infragistics for further instructions.

  • Michael DiFilippo
Read More

Monday, April 11, 2016

Visual Studio Automated UI Test Hangs

Leave a Comment

Firstly I am using VS2013 Winforms .net 4.0.

After excluding all other possibilities (from my set of possibilities) the culprit appears to be Me.close() in one specific form. After the me.close() method executes the coded-ui-test application seems to freeze and does not give any feedback about the buttons i am pressing or text i am entering. When I ask it to generate the code it goes as long as 1 hour before I decide to give up and kill the process. When I try the same test without the me.close it works as expected. Does anyone have any idea how to fix this bug in the automated ui testing? If not can you suggest any alternatives please?

Edit: This does not happen when I simply press the forms 'X' button in the top right. This is very strange.

Edit2: I have tried this in a fresh project. It is indeed me.close that causes the coded ui test application to 'freeze' such that I cannot generate the automated code and I will end up stuck at the 'please wait' loading bar.

Edit3: It appears to be specific to calling me.close in an infragistics click handler of a ultrabutton. Wow, here is example.

Designer

<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Partial Class closemepls Inherits System.Windows.Forms.Form  'Form overrides dispose to clean up the component list. <System.Diagnostics.DebuggerNonUserCode()> _ Protected Overrides Sub Dispose(ByVal disposing As Boolean)     Try         If disposing AndAlso components IsNot Nothing Then             components.Dispose()         End If     Finally         MyBase.Dispose(disposing)     End Try End Sub  'Required by the Windows Form Designer Private components As System.ComponentModel.IContainer  'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer.   'Do not modify it using the code editor. <System.Diagnostics.DebuggerStepThrough()> _ Private Sub InitializeComponent()     Me.UltraButton1 = New Infragistics.Win.Misc.UltraButton()     Me.SuspendLayout()     '     'UltraButton1     '     Me.UltraButton1.Location = New System.Drawing.Point(45, 47)     Me.UltraButton1.Name = "UltraButton1"     Me.UltraButton1.Size = New System.Drawing.Size(232, 157)     Me.UltraButton1.TabIndex = 0     Me.UltraButton1.Text = "UltraButton1"     '     'closemepls     '     Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)     Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font     Me.ClientSize = New System.Drawing.Size(284, 262)     Me.Controls.Add(Me.UltraButton1)     Me.Name = "closemepls"     Me.Text = "closemepls"     Me.ResumeLayout(False)  End Sub Friend WithEvents UltraButton1 As Infragistics.Win.Misc.UltraButton End Class 

Code

Public Class closemepls  Private Sub UltraButton1_Click(sender As Object, e As EventArgs) Handles UltraButton1.Click     Me.Close() End Sub End Class 

If I call closemepls.showdialog() and click the button the coded ui test application freezes! Infragistics FTW.

This is the result, it does not complete even after 1 hour.

This is the hanging application I am talking about

3 Answers

Answers 1

I had problems like that in WPF before.

Here's how I found it: Comment everything out then find the code that causes the problem by adding blocks back one by one.

It's something that is binded (anything though, not data and more than likely a control) not being released.

Answers 2

I haven't tried mixing CodedUI and VB much, but I was hoping this question may help you:

Me.Close does not work

Alone, that doesn't mean much, right? But in conjunction with how CodedUI works it may provide a clue. Remember that when you're running a test you're technically initiating a UITesting.Playback, which is a process. You may want to add something to your TestCleanup method that makes sure all the processes are terminated, like so (Keep in mind that this is for a browser test):

/// <summary> /// Closes the test browser and ends test playback /// </summary> [TestCleanup]//The decorator is what makes this a method a test cleanup public void CleanTest() {             if (Playback.IsInitialized) //This is the important part.     {         Playback.Cleanup();     }     if (browserWindow.Exists)     {         browserWindow.Close();     } } 

This is just a shot in the dark and I may even be misunderstanding what you need, really but I'm assuming that in both your real and example areas you're closing the entire application? This may be a question for Infragistics at the end of the day. Good luck!

Answers 3

This might be the same issue I've experienced when using MTM, on a few machines if they were running any form of capture for the resulting test. They where trying to save it to a illegal path(Found in Event Viewer). After performing a repair on VS thus MTM to was repaired and it worked for some machines. Others only seamed to be fixed when going to update 4.

But code wise I would suggest trying to click the close button on the form itself to see if you get a different behavior.

Dim closeButton = New WinButton(YourWindow); closeButton.SearchProperties(UITestControl.PropertyNames.Name) = "Close"; Mouse.Click(closeButton); 
Read More