Telerik Forums
UI for WPF Forum
1 answer
187 views

Implementing a custom tagger for SyntaxEditor control for DAX code and want to implement the MultilineTags for comments /* */.

Below is my custom tagger, how would I implement MultilineTags for this?


    public class DAXTagger : WordTaggerBase    
    {
        private static readonly string[] Keywords = new string[]
        {
            "APPROXIMATEDISTINCTCOUNT","AVERAGE","AVERAGEA","AVERAGEX","COUNT","COUNTA","COUNTAX","COUNTBLANK","COUNTROWS",
            "COUNTX","DISTINCTCOUNT","DISTINCTCOUNTNOBLANK","MAX","MAXA","MAXX","MIN","MINA","MINX","PRODUCT","PRODUCTX","SUM","SUMX",
            "CALENDAR","CALENDARAUTO","DATE","DATEDIFF","DATEVALUE","DAY","EDATE","EOMONTH","HOUR","MINUTE","MONTH","NOW","QUARTER",
            "SECOND","TIME","TIMEVALUE","TODAY","UTCNOW","UTCTODAY","WEEKDAY","WEEKNUM","YEAR","YEARFRAC",
            "ALL","ALLCROSSFILTERED","ALLEXCEPT","ALLNOBLANKROW","ALLSELECTED","CALCULATE","CALCULATETABLE","EARLIER","EARLIEST",
            "FILTER","KEEPFILTERS","LOOKUPVALUE","REMOVEFILTERS","SELECTEDVALUE","ACCRINT","ACCRINTM","AMORDEGRC","AMORLINC","COUPDAYBS",
            "COUPDAYS","COUPDAYSNC","COUPNCD","COUPNUM","COUPPCD","CUMIPMT","CUMPRINC","DB","DDB","DISC","DOLLARDE","DOLLARFR",
            "DURATION","EFFECT","FV","INTRATE","IPMT","ISPMT","MDURATION","NOMINAL","NPER","ODDFPRICE","ODDFYIELD","ODDLPRICE",
            "ODDLYIELD","PDURATION","PMT","PPMT","PRICE","PRICEDISC","PRICEMAT","PV","RATE","RECEIVED","RRI","SLN","SYD","TBILLEQ",
            "TBILLPRICE","TBILLYIELD","VDB","XIRR","XNPV","YIELD","YIELDDISC","YIELDMAT","CONTAINS","CONTAINSROW","CONTAINSSTRING",
            "CONTAINSSTRINGEXACT","CUSTOMDATA","HASONEFILTER","HASONEVALUE","ISAFTER","ISBLANK","ISCROSSFILTERED","ISEMPTY","ISERROR",
            "ISEVEN","ISFILTERED","ISINSCOPE","ISLOGICAL","ISNONTEXT","ISNUMBER","ISODD","ISONORAFTER","ISSELECTEDMEASURE","ISSUBTOTAL",
            "ISTEXT","NONVISUAL","SELECTEDMEASURE","SELECTEDMEASUREFORMATSTRING","SELECTEDMEASURENAME","USERNAME","USEROBJECTID",
            "USERPRINCIPALNAME","AND","BITAND","BITLSHIFT","BITOR","BITRSHIFT","BITXOR","COALESCE","FALSE","IF","IF.EAGER","IFERROR",
            "NOT","OR","SWITCH","TRUE","ABS","ACOS","ACOSH","ACOT","ACOTH","ASIN","ASINH","ATAN","ATANH","CEILING","CONVERT","COS",
            "COSH","COT","COTH","DEGREES","DIVIDE","EVEN","EXP","FACT","FLOOR","GCD","INT","ISO.CEILING","LCM","LN","LOG",
            "LOG10","MROUND","ODD","PI","POWER","QUOTIENT","RADIANS","RAND","RANDBETWEEN","ROUND","ROUNDDOWN","ROUNDUP","SIGN","SIN",
            "SINH","SQRT","SQRTPI","TAN","TANH","TRUNC","BLANK","ERROR","PATH","PATHCONTAINS","PATHITEM","PATHITEMREVERSE","PATHLENGTH",
            "CROSSFILTER","RELATED","RELATEDTABLE","USERELATIONSHIP","BETA.DIST","BETA.INV","CHISQ.DIST","CHISQ.DIST.RT","CHISQ.INV",
            "CHISQ.INV.RT","COMBIN","COMBINA","CONFIDENCE.NORM","CONFIDENCE.T","EXPON.DIST","GEOMEAN","GEOMEANX","MEDIAN","MEDIANX",
            "NORM.DIST","NORM.INV","NORM.S.DIST","NORM.S.INV","PERCENTILE.EXC","PERCENTILE.INC","PERCENTILEX.EXC","PERCENTILEX.INC",
            "PERMUT","POISSON.DIST","RANK.EQ","RANKX","SAMPLE","STDEV.P","STDEV.S","STDEVX.P","STDEVX.S","T.DIST","T.DIST.2T",
            "T.DIST.RT","T.INV","T.INV.2t","VAR.P","VAR.S","VARX.P","VARX.S","ADDCOLUMNS","ADDMISSINGITEMS","CROSSJOIN","CURRENTGROUP",
            "DETAILROWS","DISTINCT column","DISTINCT table","EXCEPT","FILTERS","GENERATE","GENERATEALL","GENERATESERIES",
            "GROUPBY","IGNORE","INTERSECT","NATURALINNERJOIN","NATURALLEFTOUTERJOIN","ROLLUP","ROLLUPADDISSUBTOTAL","ROLLUPISSUBTOTAL",
            "ROLLUPGROUP","ROW","SELECTCOLUMNS","SUBSTITUTEWITHINDEX","SUMMARIZE","SUMMARIZECOLUMNS","Table Constructor","TOPN",
            "TREATAS","UNION","VALUES","COMBINEVALUES","CONCATENATE","CONCATENATEX","EXACT","FIND","FIXED","FORMAT","LEFT","LEN",
            "LOWER","MID","REPLACE","REPT","RIGHT","SEARCH","SUBSTITUTE","TRIM","UNICHAR","UNICODE","UPPER","VALUE",
            "CLOSINGBALANCEMONTH","CLOSINGBALANCEQUARTER","CLOSINGBALANCEYEAR","DATEADD","DATESBETWEEN","DATESINPERIOD","DATESMTD",
            "DATESQTD","DATESYTD","ENDOFMONTH","ENDOFQUARTER","ENDOFYEAR","FIRSTDATE","FIRSTNONBLANK","LASTDATE","LASTNONBLANK",
            "NEXTDAY","NEXTMONTH","NEXTQUARTER","NEXTYEAR","OPENINGBALANCEMONTH","OPENINGBALANCEQUARTER","OPENINGBALANCEYEAR",
            "PARALLELPERIOD","PREVIOUSDAY","PREVIOUSMONTH","PREVIOUSQUARTER","PREVIOUSYEAR","SAMEPERIODLASTYEAR","STARTOFMONTH",
            "STARTOFQUARTER","STARTOFYEAR","TOTALMTD","TOTALQTD","TOTALYTD",
            "BOOLEAN","CURRENCY","DATETIME","DOUBLE","INTEGER","STRING"
        };

        private static readonly string[] Comments = new string[]
        {
        "//", "--", "/*", "*/"
        };

        private static readonly string[] Operators = new string[]
        {
        "+", "-",  "*", "/", "^", "&", "|", "&&", "||"
        };

        public static readonly ClassificationType Keywords1ClassificationType = new ClassificationType("Keywords1");

        private static readonly string[] Keywords1 = new string[]
        {
        "VAR", "RETURN", "DATATABLE"
        };

        private static readonly Dictionary<string, ClassificationType> WordsToClassificationType = new Dictionary<string, ClassificationType>();

        static DAXTagger()
        {
            WordsToClassificationType = new Dictionary<string, ClassificationType>();

            foreach (var keyword in Keywords)
            {
                WordsToClassificationType.Add(keyword, ClassificationTypes.Keyword);
            }

            foreach (var preprocessor in Operators)
            {
                WordsToClassificationType.Add(preprocessor, ClassificationTypes.Operator);
            }

            foreach (var comment in Comments)
            {
                WordsToClassificationType.Add(comment, ClassificationTypes.Comment);
            }

            foreach (var comment in Keywords1)
            {
                WordsToClassificationType.Add(comment, Keywords1ClassificationType);
            }
        }

        public DAXTagger(Telerik.Windows.Controls.RadSyntaxEditor editor)
          : base(editor)
        {
        }

        protected override Dictionary<string, ClassificationType> GetWordsToClassificationTypes()
        {
            return DAXTagger.WordsToClassificationType;
        }

        protected override bool TryGetClassificationType(string word, out ClassificationType classificationType)
        {
            int number;

            if (int.TryParse(word, out number))
            {
                classificationType = ClassificationTypes.NumberLiteral;
                return true;
            }

            return base.TryGetClassificationType(word, out classificationType);
        }

        protected override IList<string> SplitIntoWords(string value)
        {
            List<string> words = new List<string>();
            string word;
            int lastCharType = -1;
            int startIndex = 0;

            for (int i = 0; i < value.Length; i++)
            {
                int charType = GetCharType(value[i]);
                if (charType != lastCharType)
                {
                    word = value.Substring(startIndex, i - startIndex);
                    words.Add(word);
                    startIndex = i;
                    lastCharType = charType;
                }
                else if (value[i] == '#' && value[i - 1] == '#')
                {
                    word = value.Substring(startIndex, i - startIndex);
                    words.Add(word);
                    startIndex = i;
                    lastCharType = charType;
                }
            }

            word = value.Substring(startIndex, value.Length - startIndex);
            words.Add(word);

            return words;
        }

        internal static int GetCharType(char c)
        {
            if (c == '#' || c == '_')
            {
                return 3;
            }

            if (char.IsWhiteSpace(c))
            {
                return 1;
            }

            if (char.IsPunctuation(c) || char.IsSymbol(c))
            {
                return 2;
            }

            return 0;
        }
    }
}

Petar Mladenov
Telerik team
 answered on 08 Apr 2022
0 answers
181 views

I was using  telerik controls with version 2020.2.617.45 and everything works fine, but when I updated Telerik.Windows.Data, Telerik.Windows.Controls and Telerik.Windows.controls.Data  dll`s to version 2022.1.222.45 I got error in my custom behaviour at this row:

private void AssociatedObject_GotFocus(object sender, RoutedEventArgs e)
        {
            RadGridView gridView = sender as RadGridView;

            if (gridView != null && gridView.CurrentCell != null && !gridView.CurrentCell.IsInEditMode && !gridView.CurrentCell.Column.IsReadOnly)
                gridView.CurrentCell.BeginEdit();
        }

when I call gridView.CurrentCell.BeginEdit(); and I got error :System.MissingFieldException: 'Field not found: 'Telerik.Windows.Controls.ThemeManager.DefaultThemeName'.'

The problem occured after update.

Vivian
Top achievements
Rank 1
 asked on 06 Apr 2022
1 answer
182 views
I've got a RadSplitButton.  I want the dropdown's content frame to be aligned on the left, along with the left edge of the main button .  On my machine it is like this (see the first attachment, "splitbuttongood.jpg"). 

But on my colleague's machine, the dropdown content frame is aligned to the right, along with the button that makes it appear. (see the second attachment, "splitbuttonbad.jpg")>


Is there a property I can set to control this?  Do I have to retemplate the entire control?

I should add, this exactly the same code in both cases that's producing this different effect on the two machines
Stenly
Telerik team
 answered on 04 Apr 2022
1 answer
182 views

I am inserting text in Richtextbox control from word document. Richtextbox load document correctly and formatting is valid as per MS word document. 

Then save document as html and reopen document in Richtextbox. I noticed that Table content is overflowed in paged layout i.e. Columns are clipped or not showing in document area. And also print incomplete document. As I stated when load document, formatting is correct, but exporting document to html and reloading html generated document, this issue happened.

Moreover there is some formatting issue as I highlighted in attached sample image.

This issue can be reproduced in Telerik UI for WPF demos. Following steps to reproduce issue.

  1. In Richtextbox open or paste content from attached sampleDocument.docx document. Document is loaded, and formatting is valid.
  2. Save as html. sample html output is attached for reference
  3. Open saved html document in Richtextbox. You will notice Table formatting/ alignment is not as per actual document.

I am using Telerik UI for WPF R1 2022

 

 

Svilen
Telerik team
 answered on 04 Apr 2022
0 answers
333 views

Hello,

 

i'm currently working with some hierarchical data that i wanted to present using a RadGridView with its ChildTable feature.

 

Unfortunately i'm running in quite severe performance issues once i try to auto expand the child tables (waiting between 15 to 25 seconds to see my data).

I've read that placing the RadGridView in a container with infinite height (like ScrollViewer, Grid with height 'Auto', etc) could lead to such performance issues, but i didn't place it in such containers.

 

I prepared and attached a little demo project to reproduce my problem.

 

It would be great if someone got some tips for me on how to improve the performance when expanding multiple levels of hierarchies in a RadGridView.

 

Greetings,

Josh

 

Joshua
Top achievements
Rank 1
 asked on 04 Apr 2022
3 answers
229 views

Hi,

 

We wish to auto open the settings pane whenever the user selects a particular shape. What is the standard way of achieving this?

We have added a event handler for the selection changed event, just need the method to trigger the settings pane open.

Thank you.

Petar Mladenov
Telerik team
 answered on 04 Apr 2022
1 answer
228 views

Hi

I have a checkbox as a cell in one of my gridviews. if you double click it, the chech box  will hides.

how can I disable double click , to prevent hiding the checkbox?

I tried:

setting e.handled to true  in "PreviewMouseDoubleClick" but did not work(still hides)

 



<telerik:GridViewDataColumn>

<telerik:GridViewColumn.CellTemplate>

<DataTemplate>
<CheckBox>
#close tags#

 

Martin Ivanov
Telerik team
 answered on 04 Apr 2022
0 answers
98 views

Hi,

We are having  an issue with the settings pane of the diagram control wherein if we add a shape to the diagram, edit its text, and click on the settings pane directly, the content (text) of the control is not reflected in the settings pane text tab. Also, any change that you make, say to text or fonts etc. is not immediately reflected on the control. This is causing a great deal of confusion to our users.

How do we force the settings pane to pick up the latest value from the control and make sure it applies changes immediately (so they are visible to the user as they make them)?

I have attached a video demonstrating this issue: https://somup.com/c3ffh2O1kO

Please help.

 

Mrugendra
Top achievements
Rank 1
Iron
 asked on 04 Apr 2022
1 answer
156 views

Hi,

In my WPF MVVM solution, I'm using Telerik RadMap control with the free ArcGIS Provider to show maps,

I also use Telerik InformationLayer control to show extra data coming from my ViewModel, and it's all working well.

Now I have a paid account at ESRI, and after I log in to my account I can see and use on the ESRI website some extra Feature Layers like "Electric Dataset" and more.

I see ESRI does have an API for .NET to be able to display a map and add a feature layer, and they also show an example of how to do it by using their own WPF esri:MapView control.

But the problem is that I don't want to replace my current RadMap control with another new control because I'm worried about all my existing InformationLayers complexity, and I probably would need to code them again especially to match the new control.

My question is, Is there is a way I could combine using RadMap control with a paid ESRI ArcGIS provider?

 

Thanks in advance for your answers

Efi

Efi
Top achievements
Rank 1
 updated question on 31 Mar 2022
1 answer
127 views

I want to create a overview where all my 200+ tasks can be seen at one view. To do this, I wanted to make my row height to 5 pixels. So I added this code to my usercontrol:

<system:Double x:Key="RowHeight">5</system:Double><Style TargetType="telerik:EventContainer" BasedOn="{StaticResource EventContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:MilestoneContainer" BasedOn="{StaticResource MilestoneContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:SimpleCellContainer" BasedOn="{StaticResource SimpleCellContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:CellContainer" BasedOn="{StaticResource CellContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> <Setter Property="Padding" Value="0" /> </Style><Style TargetType="telerik:CellEditingContainer" BasedOn="{StaticResource CellEditingContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:SimpleTreeCellContainer" BasedOn="{StaticResource SimpleTreeCellContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:DragResizeSlotHighlightContainer" BasedOn="{StaticResource DragResizeSlotHighlightContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:CellHighlightContainer" BasedOn="{StaticResource CellHighlightContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:TreeCellHighlightContainer" BasedOn="{StaticResource TreeCellHighlightContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:TreeCellEditingContainer" BasedOn="{StaticResource TreeCellEditingContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style><Style TargetType="telerik:TreeCellContainer" BasedOn="{StaticResource TreeCellContainerStyle}"> <Setter Property="MaxHeight" Value="{StaticResource RowHeight}" /> <Setter Property="MinHeight" Value="{StaticResource RowHeight}" /> </Style>

But the height is only changed on the EventContainer, not the full row:

 

How can I change the full row height?

Thanks.

Regards, Marco

Dilyan Traykov
Telerik team
 answered on 31 Mar 2022
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
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
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
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Edmond
Top achievements
Rank 1
Iron
fabrizio
Top achievements
Rank 2
Iron
Veteran
RobMarz
Top achievements
Rank 2
Iron
Fakhrul
Top achievements
Rank 1
Iron
Tejas
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?