Telerik Forums
UI for WPF Forum
1 answer
213 views

Hello,

I have a need to customize the header part of the RadPanelBarItems, by adding a checkbox (see below). When I make this change, the text color used for that particular RadPanelBarItem (in this case "Five") is not the same as the defaults (during mouse over or selection).

How can I get the default behavior of the Black color font when selected (or mouse over) on my customized RadPanelBarItem. The only thing I need to do is add a checkbox to the header as shown.

In the picture below items "One", "Two", "Three" and "Four" use default behavior. "Five" has the customized header.

Thanks in advance

Mouse over or selected "Five". Notice the "White" font does not change to Black.

Mouse over or selected "Two". Notice that the font changes to "Black" - desired behavior

 

   <telerik:RadPanelBar>
            <telerik:RadPanelBarItem Header="One">
            </telerik:RadPanelBarItem>
            <telerik:RadPanelBarItem Header="Two">
            </telerik:RadPanelBarItem>
            <telerik:RadPanelBarItem Header="Three" />
            <telerik:RadPanelBarItem Header="Four" />

            <telerik:RadPanelBarItem>
                <telerik:RadPanelBarItem.Header>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*"/>
                            <ColumnDefinition Width="Auto"/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Grid.Column="0" Text="Five" />
                        <CheckBox Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </Grid>
                </telerik:RadPanelBarItem.Header>
            </telerik:RadPanelBarItem>
        </telerik:RadPanelBar>
Dilyan Traykov
Telerik team
 answered on 11 Apr 2022
1 answer
173 views

How do I change the color under the dates?

I tried to change colors in all sorts of styles but could not find which style was responsible for it

Would appreciate help

Stenly
Telerik team
 answered on 11 Apr 2022
0 answers
120 views

Use RadGridView and RadDropDownList controls to create the user control of the parent form, and then create a sub-form user control named AbutBodyMtdPageBase to inherit the parent form, and create a new UserControl named AbutBodyTpMtdPage, and then drag the sub-form user control of AbutBodyMtdPageBase to enter AbutBodyTpMtdPage, create a new Form form, drag AbutBodyTpMtdPage into the Form, and the RadGridView form does not display data during program execution.
The above descriptions are all created user controls, and finally a new Form is created.

Xingyu
Top achievements
Rank 1
 updated question on 11 Apr 2022
0 answers
122 views

Hello,

I've a strange issue with a treelistview.

Only when the scrollbar is at the bottom, add a new item is not "detected"  (works fine 1 /2 times and break after..., scroll to another position and add a new item works fine).

I can't reproduce the issue with an external basic "sample" , (and the issue is reproduced only for one of the two instance I have)

Basically is something like this:

public class ViewModel
{
   ObservableCollection<ItemToAdd> Items;

   void OnNewItems(ICollection<ItemToAdd> newitems)
   {
      Foreach(item in newitems)
      {
         var parentNode  = Items.where( x => x = newitem)
         parentNode?.Children.Add(item)
      }
   }
}

publicclassItemToAdd
{
   ObservableCollection <ItemToAdd> Childrens
}
<telerik:RadTreeListView x:Name="Tree"
                                 ItemsSource="{Binding Items}"
                                 CanUserFreezeColumns="False" 
                                 RowIndicatorVisibility="Collapsed" 
                                 ColumnWidth="auto" 
                                 AutoGenerateColumns="False" 
                                 IsDragDropEnabled="True"
                                 IsDropPreviewLineEnabled="False"
                                 ShowColumnHeaders="True"
                                 RowStyle="{StaticResource RowStyle}" 
                                 SelectionMode="Extended" 
                                 GridLinesVisibility="None"
                                 IsExpandedBinding="{Binding IsExpandedInTree, Mode=TwoWay}"">

...

            <telerik:RadTreeListView.ChildTableDefinitions>
                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}" />
            </telerik:RadTreeListView.ChildTableDefinitions>
        </telerik:RadTreeListView>

Here my tree is like this:

> Main node
    > Sub Node level 1
         >Sub Node level 2
         >Sub Node level 2
    > Sub Node level 1
         >Sub Node level 2
         >Sub Node level 2
    > Sub Node level 1
         >Sub Node level 2
         >Sub Node level 2

It seems that disabling Virtualization solve the issue but I don't want to do this.

Any idea?

Thanks!!

Emy
Top achievements
Rank 1
 asked on 08 Apr 2022
1 answer
198 views

Hi,

In our project we have a document editor that borrows from the code of the telerik editor found here: https://github.com/telerik/xaml-sdk/blob/master/RichTextBox/TelerikEditor/TelerikEditor.xaml. After the release allowing shapes to be added we have been receiving requests to add the ability for the use to input shapes using the our editor in the same way it is shown here: https://docs.telerik.com/devtools/wpf/controls/radrichtextbox/features/shapes/shapes. After a lot of searching through forums and the documentation on shapes I have found no way to implement this feature. Could someone advise me on how to add the shapes dropdown to the ribbon of the editor, and whether or not that is all the code I will need to allow a user to add/manipulate the predefined shapes? The documentation says that "In the Insert tab, you will find a list containing various predefined shapes you can choose between". I haven't found a way to add this to our editor or even where it resides in the telerik editor. Any help would be greatly appreciated.

Dimitar
Telerik team
 answered on 08 Apr 2022
1 answer
393 views

Hi,

I have created a gridview with a rowdetail that uses the rowdetailstemplateselector to show a different row depending on an itemsource property. I would like to control rowdetailsvisibiltiy based on a property of the item. Is there an example for this and or could you point me to what event I would need to use to control the the rowdetailsvisiblity on a per row basis?

Thanks

Rob

Martin Ivanov
Telerik team
 answered on 08 Apr 2022
1 answer
130 views

Tried extending the a custom tooltip tagger to recognize multiple words/tooltips but no luck. Below is my custom tooltip tagger, any thoughts on where I am going wrong?


using System.Collections.Generic;
using Telerik.Windows.SyntaxEditor.Core.Editor;
using Telerik.Windows.SyntaxEditor.Core.Tagging;
using Telerik.Windows.SyntaxEditor.Core.Text;

namespace QuickMeasuresPro
{
    class DAXTooltipTagger : TaggerBase<ToolTipTag>
    {
        private string searchWord;

        private static readonly string[] Keywords = new string[]
        {
            "APPROXIMATEDISTINCTCOUNT","AVERAGE","AVERAGEA","AVERAGEX"
        };

        private static readonly string[] Tooltips = new string[]
        {
            "APPROXIMATEDISTINCTCOUNT(<columnName>)\r\nReturns the approximate number of rows that contain distinct values in a column.",
            "AVERAGE(<column>)\r\nReturns the average (arithmetic mean) of all the numbers in a column.",
            "AVERAGEA(<column>)\r\nReturns the average (arithmetic mean) of the values in a column.",
            "AVERAGEX(<table>,<expression>)\r\nCalculates the average (arithmetic mean) of a set of expressions evaluated over a table.",
        };

        public DAXTooltipTagger(ITextDocumentEditor editor)
            : base(editor)
        {
        }

        public override IEnumerable<TagSpan<ToolTipTag>> GetTags(NormalizedSnapshotSpanCollection spans)
        {
            if (string.IsNullOrEmpty(this.searchWord))
            {
                yield break;
            }

            TextSnapshot snapshot = this.Document.CurrentSnapshot;
            foreach (TextSnapshotSpan snapshotSpan in spans)
            {
                string lineString = snapshotSpan.GetText();
                int i = 0;
                foreach (string keyword in Keywords)
                {
                    string tooltip = Tooltips[i];
                    i++;
                    int index = lineString.IndexOf(keyword);
                    while (index != -1)
                    {
                        TextSnapshotSpan tempSnapshotSpan = new TextSnapshotSpan(snapshot,
                            new Span(snapshotSpan.Start + index, keyword.Length));

                        yield return new TagSpan<ToolTipTag>(tempSnapshotSpan, new ToolTipTag(tooltip));

                        index = lineString.IndexOf(keyword, index + keyword.Length);
                    }
                }
            }
        }

        public void UpdateSearchWord(string newSearchWord)
        {
            this.searchWord = newSearchWord;
            this.CallOnTagsChanged(this.Document.CurrentSnapshot.Span);
        }
    }
}

Petar Mladenov
Telerik team
 answered on 08 Apr 2022
1 answer
195 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
184 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
188 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
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
LayoutControl
ProgressBar
Sparkline
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
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?