Telerik Forums
UI for WinForms Forum
1 answer
52 views

public void WriteToWordDocumentContinued(){

    m_document = new RadFlowDocument();
    m_editor = new RadFlowDocumentEditor(m_document);
    Section section = new Section(m_document);
    section.HasDifferentFirstPageHeaderFooter = true;
    section.PageMargins = new Telerik.Windows.Documents.Primitives.Padding(56.69, 94.49, 47.24, 66.14);
    m_document.Sections.Add(section);
    m_document.StyleRepository.AddBuiltInStyle(BuiltInStyleNames.GetHeadingStyleIdByIndex(1));


    Style MainTitle = new Style("MainTitle", StyleType.Character) { };
    MainTitle.CharacterProperties.UnderlinePattern.LocalValue = UnderlinePattern.Single;
    MainTitle.CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
    MainTitle.CharacterProperties.FontSize.LocalValue = 32;
    MainTitle.CharacterProperties.FontWeight.LocalValue = System.Windows.FontWeights.Bold;
    m_document.StyleRepository.Add(MainTitle);

    Style HeaderParagraphStyle = new Style("HeaderParagraphStyle", StyleType.Paragraph) { };
    HeaderParagraphStyle.ParagraphProperties.LineSpacing.LocalValue = 16;
    HeaderParagraphStyle.ParagraphProperties.LineSpacingType.LocalValue = HeightType.Exact;
    HeaderParagraphStyle.ParagraphProperties.SpacingAfter.LocalValue = 0;
    HeaderParagraphStyle.ParagraphProperties.SpacingBefore.LocalValue = 0;

    Style HeaderTitleStyle = new Style("HeaderTitleStyle", StyleType.Paragraph) { };
    HeaderTitleStyle.ParagraphProperties.LineSpacing.LocalValue = 21.4;
    HeaderTitleStyle.ParagraphProperties.LineSpacingType.LocalValue = HeightType.Exact;
    HeaderTitleStyle.ParagraphProperties.SpacingAfter.LocalValue = 0;
    HeaderTitleStyle.ParagraphProperties.SpacingBefore.LocalValue = 0;
    HeaderTitleStyle.ParagraphProperties.TextAlignment.LocalValue = Alignment.Right;

    HeaderParagraphStyle.ParagraphProperties.TextAlignment.LocalValue = Alignment.Right;
    m_document.StyleRepository.Add(HeaderParagraphStyle);

    Style HeaderCharacterStyle = new Style("HeaderCharacterStyle", StyleType.Paragraph) { };
    HeaderCharacterStyle.CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
    HeaderCharacterStyle.CharacterProperties.FontSize.LocalValue = 16;
    m_document.StyleRepository.Add(HeaderCharacterStyle);

    Style SubTitle = new Style("SubTitle", StyleType.Character) { };
    SubTitle.CharacterProperties.UnderlinePattern.LocalValue = UnderlinePattern.Single;
    SubTitle.CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
    SubTitle.CharacterProperties.FontSize.LocalValue = 16;
    SubTitle.CharacterProperties.FontWeight.LocalValue = System.Windows.FontWeights.Bold;
    m_document.StyleRepository.Add(SubTitle);

    Style TopLines = new Style("TopLines", StyleType.Character) { };
    TopLines.CharacterProperties.FontFamily.LocalValue = new ThemableFontFamily("Arial");
    TopLines.CharacterProperties.FontSize.LocalValue = 16;
    TopLines.CharacterProperties.FontWeight.LocalValue = System.Windows.FontWeights.Bold;
    m_document.StyleRepository.Add(TopLines);

}

 

This is just minified version of the method where I am trying to instantiate my RadFlowDocument object. This method is being called in a parent class, even If I try to pass RadFlowDocument object from that class, it still causes the UI to break. 

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 26 Sep 2023
1 answer
66 views

Hello.

I am using RadRibbonBar (Main Form). I have multiple buttons in ribbon. Each button has different forms. I want dock them inside its Main Form on click. here is an example in below screenshot. I am unable to achieve the requirement.

Please note: The child form should dock exactly below the ribbon form. and also, the cross button (child form close button) should be present right after the tab (Child form name).

Please attach a zip file with a source code.

Thanks

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 25 Sep 2023
1 answer
54 views

Hi,

I would like to know how we get the clicked bar AxisLabelElement?

What I mean, is when I click on the chart View certain bar I would like to read its Axis label.

Many thanks in advance

Omar

Dinko | Tech Support Engineer
Telerik team
 answered on 25 Sep 2023
2 answers
76 views

Hi,

I'm using my custom template and I would like to adjust the hyperlink color in RadLabel.

Is there a way to change the color of the hyperlink? The hyperlink is set using an HTML tag. For example: "lblMessageText.Text = "<html>New software version: <a href=www.xyzcom/update>www.xyz.com/update</a>."?

Best regards

Pawel

Nadya | Tech Support Engineer
Telerik team
 answered on 25 Sep 2023
2 answers
131 views

I would like to know how to access the values that are typed in all the "Value Filter" and "Label Filter" options, which appear in the PivotGrid filters in the RowGroupDescriptions and ColumnGroupDescriptions parts, since I require those values to perform additional calculations.

I have tried to reach the values but I only reach the Type of condition and the value, I provide the code that I use for what I mention:

foreach (PropertyGroupDescriptionBase gd in this.radPivotGrid1.RowGroupDescriptions)
{
ValueGroupFilter Filtroporvalor = gd.GroupFilter as ValueGroupFilter;                    

if (Filtroporvalor.Condition != null)
{
ComparisonCondition condition = Filtroporvalor.Condition as ComparisonCondition;

var condicionaux = condition.Condition;
var valorthan = condition.Than;

switch (condicionaux.ToString())
{
case "Equals":
//Code that performs additional calculations
break;
case "IsGreaterThan":
//Code that performs additional calculations
break;
case "IsDoesNotEqual":
//Code that performs additional calculations
break;
}
}
}

But I cannot reach the other values, for example if I use "Equals", I would also like to obtain the name of the field that is used to perform that condition and so on for the other options of "Value Filter", that field is the one that is you can select in the window that is displayed when the filter is applied:


Thank you for your support.

Dinko | Tech Support Engineer
Telerik team
 answered on 22 Sep 2023
2 answers
102 views

Hello,

I have question about diagram zooming behavior. I would expect standard behavior, when zooming by mouse wheel, diagram should zoom with keeping point behind mouse cursor on the same position, zooming by toolbar buttons (programatically by ZoomIn / ZoomOut methods) should do the same, but keeping center point on the same position. It's almost working like this, but the first zoom (either by mouse or by buttons) do some strange first "move", and then it works like expected.

I set zoom/position on startup to fit main shape to all control space, also I added button "Zoom Fit" that makes the same. And I think that control "remembers" some other zoom center and it does the first zoom by this point. Next zooms work like expected. I have attached my test project. I have also attached animations of behavior as attachments (I tried to add it to question as images, but I couldn't submit question with them, it have always ended with error).

Dess | Tech Support Engineer, Principal
Telerik team
 answered on 21 Sep 2023
1 answer
167 views

When a user attempts to resize a column (yea, the columns are set to be resizeable) and the grid's horizontal scroll bar is visible, the column will not resize. We get the re-size icon, but nothing happens.  As soon as the scroll bars are gone, the columns will then resize as excepted.  

 

Anyone have a work around for this.  It's driving our customers crazy....

Dinko | Tech Support Engineer
Telerik team
 answered on 21 Sep 2023
1 answer
57 views

Hello,

I am trying to get the ClearButton of the RadTextBox next to the TextBoxElement to work but when I place it next to it (via Margin and a bit of Padding) the ClearButton does not react to any mouse events anymore. All the mouse releated hover properties of the ClearButton are false, as well (ContainsMouse, IsHovered, IsMouseOver).

Most interesting here is that the tbxWithMargin.TextBoxElement.MouseMove event is triggered but it does not recognize that the mouse is over the ClearButton. I've also tried to check here if the cursor is over its BoundingRectangle without success.

You can see this behaviour in the attached project.

If this would be possible (without a general mouse move check event of the whole form!), I'd also would like to use this ClearButton placement for a RadTextBoxControl.

Nadya | Tech Support Engineer
Telerik team
 answered on 19 Sep 2023
2 answers
87 views

Not able to identify Automation ID inside Radlistview each cell.

Please bellow snapshot.

 

Nadya | Tech Support Engineer
Telerik team
 answered on 19 Sep 2023
5 answers
1.1K+ views
Hey guys,
I'm trying to bind a GridView to a DataTable which contains DataColumns of Type Boolean, String, Int32 and an Enumeration. When I bind it using AutoGenerateColumns = true the column containing the enum-values shows their int representation. I expected it to show as a dropdown like the standard DataGridView does.

Afterwards I tried to create the GridViewColumns myself but I can't figure out how to use the Enum as a DataSource for the GridViewComboBoxColumn. Here is my code:
GridViewComboBoxColumn col5 = new GridViewComboBoxColumn("ResultType"); 
col5.DataSource = Enum.GetValues(typeof(EnumResultType)); 
col5.ValueMember = "???"
col5.DisplayMember = "???"
dgvDisciplines.MasterGridViewTemplate.Columns.Add(col5); 

Is this the right way to specify the DataSource? How do I need to specify the ValueMember and Displaymember?

The DropDown in the ComboBoxEditor shows the right (string) Values but the int-values of the rows aren't converted to that String-Representation.

If needed, here is the code of the enumeration:
public enum EnumResultType 
    { 
        Maximum, 
        Minimum, 
        Summe, 
        Durchschnitt 
    } 

Any hints?

Kind regards,
Nils


Bilbo
Top achievements
Rank 1
Iron
 answered on 16 Sep 2023
Narrow your results
Selected tags
Tags
GridView
General Discussions
Scheduler and Reminder
Treeview
Dock
RibbonBar
Themes and Visual Style Builder
ChartView
Calendar, DateTimePicker, TimePicker and Clock
DropDownList
Buttons, RadioButton, CheckBox, etc
ComboBox and ListBox (obsolete as of Q2 2010)
ListView
Chart (obsolete as of Q1 2013)
Form
PageView
MultiColumn ComboBox
TextBox
RichTextEditor
Menu
PropertyGrid
RichTextBox (obsolete as of Q3 2014 SP1)
Panelbar (obsolete as of Q2 2010)
PivotGrid and PivotFieldList
Tabstrip (obsolete as of Q2 2010)
MaskedEditBox
CommandBar
PdfViewer and PdfViewerNavigator
ListControl
Carousel
Diagram, DiagramRibbonBar, DiagramToolBox
GanttView
Panorama
New Product Suggestions
Toolstrip (obsolete as of Q3 2010)
VirtualGrid
AutoCompleteBox
Label
Spreadsheet
ContextMenu
Panel
Visual Studio Extensions
TitleBar
Documentation
SplitContainer
Map
DesktopAlert
ProgressBar
CheckedDropDownList
Rotator
TrackBar
MessageBox
SpinEditor
StatusStrip
CheckedListBox
Wizard
ShapedForm
SyntaxEditor
TextBoxControl
LayoutControl
CollapsiblePanel
Conversational UI, Chat
DateTimePicker
TabbedForm
CAB Enabling Kit
DataEntry
GroupBox
ScrollablePanel
WaitingBar
ScrollBar
ImageEditor
Tools - VSB, Control Spy, Shape Editor
BrowseEditor
DataFilter
ColorDialog
FileDialogs
Gauges (RadialGauge, LinearGauge, BulletGraph)
ApplicationMenu
RangeSelector
CardView
WebCam
BindingNavigator
PopupEditor
RibbonForm
Styling
TaskBoard
Barcode
ColorBox
Callout
FilterView
PictureBox
VirtualKeyboard
NavigationView
Accessibility
DataLayout
ToastNotificationManager
ValidationProvider
CalculatorDropDown
Localization
TimePicker
ButtonTextBox
FontDropDownList
Licensing
BreadCrumb
Security
LocalizationProvider
Dictionary
Overlay
Separator
SparkLine
TreeMap
StepProgressBar
SplashScreen
Flyout
ToolbarForm
NotifyIcon
Rating
TimeSpanPicker
BarcodeView
Calculator
OfficeNavigationBar
TaskbarButton
HeatMap
SlideView
PipsPager
AIPrompt
TaskDialog
+? more
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Henri
Top achievements
Rank 2
Iron
Iron
Iron
SUNIL
Top achievements
Rank 2
Iron
Iron
Iron
David
Top achievements
Rank 1
Jackson
Top achievements
Rank 1
Iron
Iron
Tim
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?