I am working on a WPF application using Telerik and coded in C# .NET.
My following question goes over a XAML page using the model “Code behind” to implement the logic of the page.
I would like to get the position of the GanttPresenterSplitter in a telerik:RadGanttView.
This information would allow me to set the position of another element in another part of the same screen.
I would also know if it is possible to add an event handler on that GanttPresenterSplitter in order to get its position each time that line moves.
The ASP .NET page is split into 3 parts (please find in attachment draft_screen) :
Red square : telerik:RadGanttView
Green square : telerik:RadGridView
Blue square : telerik:RadScheduleView
As you can see, there is a dividing line between telerik:RadGridView and telerik:RadScheduleView.
I would like that line moves at the same time and same position as the GanttPresenterSplitter in the RadGanttView.
Using a more explicit picture based on an example (please find in attachment explicit_screen) :
Orange line : GanttPresenterSpliter
Purple line : GridSplitter
My point is to coordinate the orange and the purple lines in order they have the same position all the time.
Any help will be much appreciated :)
There is no straightforward way to get the position of the GanttPresenterSplitter, however, you could, for example, get the Width of the Grid area of the GanttView, and more specifically the width of the visible area. It is presented by a ScrollBar element, so you could subscribe to its SizeChanged event to handle when the Grid area is resized.
I have prepared a sample example to demonstrate the approach, please download the attachment and give it a try.
Related
So, I have some simple figure (circle, ellipse, rectangle of closed polygon) and I need to fill only part of it.
I mean, I have GraphicsPath or similar object (set of points) and now I can simply fill the whole figure with, for example, orange color.
What I need: user enters 25% and I fill only 25% of the figure, starting from some side (top/bottom).
Maybe, it will be nessesary to find some sub-figure or (bad idea, I know) check all the points in on the field and fill them (only those which inside figure) one by one untill their amount will be 1/4 from the area of the figure. But it won't be so fast especially when image is about 5-6000 pixels from one side.
Here's sample what I have now and what I need for 25%. Important: instead of 25% can be any value.
Project: C# .net 3.5 WinForms
UPD:
Basic usecase.
User draws a figure (circle, ellipse, rectangle, polygon)
User enters value from 0 to 100 (percents)
I fill figure from bottom to the top until I filled amount of area (!), which is equal to user's value
I'm open for any ideas even without code.
I'm implementing an hex editor in the console. I have 2 "Windows" displayed, one for the hex numbers and one for the text. In between i want to visualize a scrollbar.
Here a photo for better understanding.
Now my question:
I'm, not quite sure how to calculate the number of segments of the scrollbar and on which segment I'm currently. I'm using a file stream holding the bytes. I'm always displaying the number of bytes the left window can show. If the user presses arrow up or down, I'm reading the next or previous line of the stream.
Do you have any ideas how to solve that well?
EDIT:
My Scrollbar class is very minimalistic at the moment: It holds:
int numberOfSegments
int currentSegment
Point position
The renderer knows then how to draw the scrollbar. Do you think that's enough for the Scrollbar class?
I am new to Unity.
I am converting my Sudoku game written in WPF to Unity2D. I converted everything. However I cant achieve 9*9 grid with Buttons as I did in WPF.
In WPF I created 81 buttons with same event. So when it is called I jsut got their position displayed keyboard with only numbers that cell allowed.
Here is what I needed
Here is what I did.
1: I inserted canvas then tried vertical layout(for adding 3 rows) without success
2: Then I tried grid layout with canvas with fixable count column no success
3: grid layout with flexible option still no result.
I also tried via coding using GUI.BOX, and all still the result is not good.
How can I do it?
Do not use GridLayout, it is only for fixed size "icons" - irrelevant here, do not use.
First use VerticalLayoutGroup
include ..
Don't forget you must put a LayoutElement on each of your three items.
Get that working first.
Then, for your MIDDLE item, add a horizontal group and make that work.
I am using the Scintilla .NET text editor control (ScintillaNet.dll) to display SQL. I am using the following command to position the caret cursor at a given line number. In the example below, I am positioning the caret cursor at line 102 (0 based. The grid displays 1-based line numbers.)
scintilla1.GoTo.Line(102); //0 based
I'd like text in the viewport to be displayed at the top of the screen as shown below, as the first visible line
How can I identify how to do this?
Update
This looked promising:
scintilla1.Lines.FirstVisible.Number = targetLineNumber;
but after executing, scintilla1.Lines.FirstVisible.Number wasn't always equal to targetLineNumber and I don't know what is interfering with it.There are hundreds of lines following the targetLineNumber line.
Get/Set first visible line works for me https://www.scintilla.org/ScintillaDoc.html#SCI_SETFIRSTVISIBLELINE
You can keep the cursor position first (SCI_GOTOPOS) and then set the first visible line
I have generated a chart in asp.net c#, which gets user data from the database and display it. Now I want to add a line to it which can indicate the baseline set by the user. I think it might be a new series which will be drawn from start to end. It will be ideal if the user is able to change it and on changing the line is redrawn. I have dates on x-axis and activity time on y axis. In the following picture I want line like Goal. Any suggestions?
There are two ways I know which can be used to achieve this line.
One is by adding the tag but the line will appear under the bars.
If you want the line to appear above the bars then you need to add another series of type line chart. Make its x axis secondary and specify the values so that it appears as a straight line. Hide the lengends and labels etc for line chart.