Telerik Forums
UI for WPF Forum
1 answer
221 views

I was following the SDK example for Highlighting a Custom Column and got it all implemented.  For mine it is highlighting the correct text but it isn't keeping those rows that should stay in the search results.  My project differs from the example project since I have the Grid bound to a DataTable of various columns and types whereas the example is bound to a list of objects.

My code for the Custom Column is here.  The column is bound to a custom type listed below this code.

publicclassAttributeListColumn: GridViewBoundColumnBase { public override FrameworkElement CreateCellElement(GridViewCell cell, object dataItem) { StackPanel mainContainer = new StackPanel { Orientation = Orientation.Horizontal }; if (cell.DataContext != null) { string glyphResourceKey = ((cell.DataContext as System.Data.DataRow)[DataMemberBinding.Path.Path] as ListValueContainer)?.GlyphResourceKey; System.Windows.Shapes.Path path = new System.Windows.Shapes.Path { Margin = new Thickness(0, 0, 5, 0), Fill = System.Windows.Media.Brushes.Black, Width = 13, Height = 13, Data = glyphResourceKey == null ? null : Application.Current?.TryFindResource(glyphResourceKey) as System.Windows.Media.Geometry, Visibility = glyphResourceKey == null ? Visibility.Collapsed : Visibility.Visible }; mainContainer.Children.Add(path); } //Add HighlightTextBlock to keep the SearchPanel functionality HighlightTextBlock htb = new HighlightTextBlock(DataControl.SearchStateManager); htb.SetBinding(HighlightTextBlock.HighlightTextProperty, new Binding($"[{DataMemberBinding.Path.Path}].Id")); cell.SetBinding(GridViewCell.IsHighlightedProperty, new Binding("ContainsMatch") { Source = htb, Mode = BindingMode.TwoWay }); SetHighlightTextBlockTextProperty(dataItem, htb); mainContainer.Children.Add(htb); return mainContainer; } public void SetHighlightTextBlockTextProperty(object dataItem, TextBlock textBlock) { if (this.DataMemberBinding != null) { var content = this.GetCellContent(dataItem); if (content != null) { textBlock.SetValue(TextBlock.TextProperty, (content as ListValueContainer).Id); } } else { textBlock.ClearValue(TextBlock.TextProperty); } } }


[TypeConverter(typeof(ListValueConverter))]
    public class ListValueContainer : IComparable, IEquatable<ListValueContainer>, INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        protected string glyphResourceKey;
        protected List<string> values = new List<string>();

        public ListValueContainer()
        {
        }

        public ListValueContainer(string value, string glyphResourceKey = null)
        {
            values.Add(value);
            this.glyphResourceKey = glyphResourceKey;
        }

        public ListValueContainer(List<AttributeListLookup> lookupValues, string glyphResourceKey = null)
        {
            if (lookupValues != null)
            {
                lookupValues.ForEach(a => values.Add(a.Id));
            }
            this.glyphResourceKey = glyphResourceKey;
        }

        public string GlyphResourceKey
        {
            get
            {
                return glyphResourceKey;
            }
        }

        public List<string> Values
        {
            get
            {
                return values;
            }
        }

        public string Id
        {
            get
            {
                return string.Join(", ", values);
            }
        }

        public virtual void OnPropertyChanged(PropertyChangedEventArgs args)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, args);
            }
        }
}

Like I said the correct text highlights as you type in the GridView search bar, but those cells aren't actually getting filtered.

 

The HighlightTextBlock.HighlightTextProperty is being bound correctly but I'm guessing the GridViewCell.IsHighlightedProperty is what says if the row should stay in the GridView as you are typing?

Martin Ivanov
Telerik team
 answered on 01 Nov 2021
1 answer
103 views

Is it possible to add charts to a document created via RadPdfProcessing, if so is there a sample anywhere?

 

THx

Dimitar
Telerik team
 answered on 01 Nov 2021
1 answer
134 views

Hello,

Is it possible to drag RadNavigationViewItems around in the RadNavigationView If so, how would this be implemented?

 

Thanks

 

Tony

Dinko | Tech Support Engineer
Telerik team
 answered on 29 Oct 2021
1 answer
601 views

Hello,

i implemented a feature "auto fit columns" which just set every column to with = auto:

foreach (var column in ItemGrid.Columns)
{
	column.Width = GridViewLength.Auto;
}

After this i will save the ActualWidth of all Columns. This works for all rendered columns, but not for the virtualized (they are always 20 pixels).

I tried a lot workarounds, but nothing works or causes UI glitches (Disable and Enable virtualization):

ItemGrid.EnableColumnVirtualization = false;                            

foreach (var column in ItemGrid.Columns)
{
	column.Width = GridViewLength.Auto;
	ItemGrid.ScrollIntoView(null, column);
	ItemGrid.UpdateLayout();
	column.Width = column.ActualWidth;
	column.IsSelected = true;
	column.Focus();
	column.Width = column.ActualWidth;
}

ItemGrid.UpdateLayout();

SaveLayout();

ItemGrid.EnableColumnVirtualization = true;

I think I need something like the "GridColumnSizer" from Syncfunsion (https://help.syncfusion.com/wpf/datagrid/autosize-columns#customizing-built-in-column-auto-sizing-logic) to calculate the width.

Do you have any ideas how to solve this problem?

regards, Marco

Dilyan Traykov
Telerik team
 answered on 27 Oct 2021
1 answer
1.3K+ views

I want to make GridView Editable. But when Cell is blank, i can't enter anything. (If there's data in cell, no problem)

       

I have set IsReadonly=false.

 

btw, i want to change the textbox style in cell when editing data, like the gray borderbrush in pic, where to set the style?

Stenly
Telerik team
 answered on 27 Oct 2021
2 answers
239 views
Hello,

Is it possible to generate the code completion or Overload List automatically? This means not to do it manually. The available examples show how to use and implement them manually.

Thank you for your feedback
Petar Mladenov
Telerik team
 answered on 25 Oct 2021
1 answer
129 views

Hi,

I'm trying to build a screen with a RadGridView with a Save and Cancel button outside of the RadGridView itself.
The purpose would be to save the entire Grid at once to our DB and a cancel would put everything back to the "original" state.
Including, any items that might have been deleted.

Does anybody have a good working example of this kind of setup?
I've seen the document on how to handle the external buttons. https://docs.telerik.com/devtools/wpf/controls/radgridview/how-to/cancel-edit-on-lost-focus
But this still works on a row level. I'm looking for an example that takes the entire grid.

One note, we are working in an MVVM architecture!

Kind Regards
Tim

Dilyan Traykov
Telerik team
 answered on 25 Oct 2021
1 answer
270 views
-
Martin Ivanov
Telerik team
 answered on 25 Oct 2021
1 answer
193 views

not very nice Picture if you use RadMultiColumnBox and switch to another App

 

based on my App:

If you Drop Down the MultiColumnBox the "Grid" Part are always stay on Top of EACH Other Window!!!

I think the users would be very unhappy with this picture.

 

Any solutions?

Regards Peter

 

Stenly
Telerik team
 answered on 22 Oct 2021
1 answer
148 views

Hi,

I would like to create a Scatter plot that shows both dot and line in the same series (shown in attached image). I am using ScatterPointSeries in C-sharp code but there is no strockThickness property.

Thanks,

Chao-An

Martin Ivanov
Telerik team
 answered on 22 Oct 2021
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?