Telerik Forums
UI for WPF Forum
0 answers
390 views

I have a column which has read mode or edit mode. Read mode means that column display text in a textblock. Edit mode means that the column display a textbox or combobox so the use can input the value in the control. So I want to customize the datetemplate.

<telerik:GridViewDataColumn DataMemberBinding="{Binding Salary}">
            <telerik:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding Salary}" Visibility="{Binding ReadOrEdit, Convert={StackResources BooleanToOpacityConverter}}" Validation.ErrorTemplate="{StackResources myTemplate}"/>
                        <TextBox Text="{Binding Salary}" Visibility="{Binding ReadOrEdit, Convert={StackResources InvertedBooleanToVisibilityConverter}}" Validation.ErrorTemplate="{StackResources myTemplate}"/>
                    </StackPanel>                  
                </DataTemplate>
            </telerik:GridViewDataColumn.CellTemplate>
        </telerik:GridViewDataColumn>

The validation template likes

<ControlTemplate x:Key="myTemplate">
    <DockPanel>
        <Border BorderBrush="Red" BorderThickness="1">
            <AdornedElementPlaceholder x:Name="controlWithError"/>
        </Border>
        <TextBlock Foreground="Red" FontSize="20" FontFamily="Segoe UI" Margin="3,0,0,0"  MouseDown="Exclamation_MouseDown"  Tag="{Binding AdornedElement.(Validation.Errors)[0].ErrorContent, ElementName=controlWithError}">!</TextBlock>
    </DockPanel>
</ControlTemplate>

I am not sure it is the right way. Should I put the textbox in CellEditingTemplate because of it is for editing? The reason is when we validate the textbox I found besides the textbox also inside the textbox there was a red border around the text. It means there are two adorners.

Thanks

 

Trump
Top achievements
Rank 1
 asked on 03 Mar 2019
4 answers
503 views

This is a bit hard to describe, but I have a RadGridView that I'm exporting to Excel.

 

The date and time fields register as "General" (under Right Click --> "Format Cells") when I need them to be either "Date" or "Time" based on what they are. The Excel sorting of DateTime fields doesn't work property otherwise - it seems to sorts on the textual representation as opposed to proper dates.

The attached picture clearly shows what I have in mind.

How do I get Excel to see them (checkboxed) as either "Date" (for date columns/cells) or "Time" (for time columns/cells)...instead of "General" ?

 

Barry

Martin Ivanov
Telerik team
 answered on 01 Mar 2019
4 answers
212 views
Is there a way to speed up, or just remove, the animation that occurs when a group of Timeline items is expanded or collapsed? For groups containing more than 10 or so items, the animation to collapse or expand those groups begins to take a significant amount of time. This issue only gets worse with more items, and we would like to fix this.
Vladimir Stoyanov
Telerik team
 answered on 01 Mar 2019
1 answer
111 views

Is it possible to customize the GridViewGroupPanelItem content so that custom controls inside the header are not visible?

Please see the attached image i took from the example project ColumnSelection, can i remove the CheckBox from the GridViewGroupPanelItem?

Kind regards,

Gian Paolo Tessitore

 

Vladimir Stoyanov
Telerik team
 answered on 01 Mar 2019
23 answers
4.4K+ views

Hi, I am developing a WPF Application using MVVM pattern. I m attaching the final output which is required named "Final output required.jpg" and also what I am currently getting named "GridView xaml.png".

I need to display data in a grid where the columns are dynamic. So in order to achieve that I had created two classes, one named rows and other one columns. Finally I bind the collection containing rows with the GridView. My code sample is as follows:

//Observable property to bind with
        public ObservableCollection<Row> GridRows
        {
            get
            { return _gridRows; }
            set
            {
                _gridRows = value;
                RaisePropertyChanged(() => GridRows);
            }
        }
        //Rad Grid
        public class Grid
        {
            public Grid(){
                Rows = new List<Row>();
            }
 
            //contains mutiple row
            public List<Row> Rows { get; set; }
        }
 
        // RadGrid Row
        public class Row
        {
            public Row()
            {
                Columns = new List<Column>();
            }
 
            // Row Name
            public string RowName { get; set; }
            //each row contains multiple columns
            public List<Column> Columns{ get;set;}
 
        }
 
        //Rad Grid Column
        public class Column {
            public string ColumnName {get;set;}
            public int Value { get; set; }
        }
 
        public void LoadData()
        {
            Grid table = new Grid();
            for (int i = 1; i < 11; i++)
            {
 
                Row row = new Row();
                row.RowName = "Row_" + i;
                for (int j = 0; j < 5; j++)
                {
                    Column Column = new Column
                    {
                        ColumnName = "Row_" + i + "Col_" + j,
                        Value = i + j
                    };
                   
                    row.Columns.Add(Column);
                }
                table.Rows.Add(row);
            }
 
            GridRows = new ObservableCollection<Row>(table.Rows);
        }

 

The View for this is as follows:

<telerik:RadGridView Name="GridView"
                            CanUserReorderColumns="False"
                            CanUserSortColumns="False"
                            ItemsSource="{Binding GridRows}"
                            GridLinesVisibility="Both"
                            AutoGenerateColumns="True"
                             >
           <telerik:RadGridView.Columns >
              
                <!-- My question is how can i bind the dynamic columns here  -->
                <!-- I want to generate the columns spcified for each row -->
               <telerik:GridViewColumn Header = "{Binding Name}" >
                   <telerik:GridViewColumn.CellTemplate>
                       <DataTemplate>
                           <TextBlock Text="{Binding Value}" />
                       </DataTemplate >
                   </telerik:GridViewColumn.CellTemplate>
               </telerik:GridViewColumn >
 
           </telerik:RadGridView.Columns>
       </telerik:RadGridView>

Basically what my requirement is to create dynamic columns as per the Collection of column in Rows. . I tried but it's showing Collection in column.

Also i want to inline editing for columns that why using the GridView. Please check the required output and suggest if there is any other i can use .

Please response soon as i'm in rush .Also let me know if anything not clear.

Thanks

Vladimir Stoyanov
Telerik team
 answered on 01 Mar 2019
0 answers
327 views

Hello, 

I have this combobox with is bound to List of customers around 5k customers

<telerik:RadComboBox ClearSelectionButtonVisibility="Visible" ClearSelectionButtonContent="Clear Selection"
                                     ItemsSource="{Binding Customers}"  Margin="0 0 0 18"
                                     DisplayMemberPath="DisplayMember"
                                     SelectedValuePath="Id"
                                     SelectedValue="{Binding CustomerId,Mode=OneWay}"
                                     Command="{Binding GetCustomerCommand}">
                    <telerik:RadComboBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <VirtualizingStackPanel />
                        </ItemsPanelTemplate>
                    </telerik:RadComboBox.ItemsPanel>
</telerik:RadComboBox>

 

 

I changed to virtualization and this helped in getting the list faster but when I added SelectedValue to bind to my viewmodel It is getting very very slow to load.

Is there any way to overcome this problem ?

Regards

moe
Top achievements
Rank 1
 asked on 01 Mar 2019
7 answers
176 views

Using the RangeBarSeries with data points that overlap another series, the tooltip for the covered up data point is shown rather than the one on top.

 

However the "hover" clearly knows which is the series being hovered over. See attached screenshots. chart1.pg shows the longest (yellow) bar being hovered over. chart2.png shows the adjacent orange series and chart3 shows the green series. All 3 have the same tooltip, of the longest series which runs underneath the others.

 

How can I fix this and get the tooltips to show for the proper data point?

Steve
Top achievements
Rank 1
 answered on 01 Mar 2019
1 answer
312 views

Does the RadGridView have something similar to the SelectedItemsSource that the RadListbox has? I'd like to automatically bind the selected items to a collection in my view-model like I do with the list box.

example:

<telerik:RadGridView
     ItemsSource="{Binding ..., Mode=OneWay}"
     telerik:ListBoxSelectedItemsBehavior.SelectedItemsSource="{Binding ..., Mode=OneWay}">

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Feb 2019
1 answer
418 views

I am trying to set the default visual style of my line series. (Using Telerik UI for WPF 2015)

Based on the page, the default visual style of the dot & line styling can be set at the default visualstyle properties:

https://docs.telerik.com/devtools/wpf/controls/radchartview/styles-and-templates/customizing-cartesianchart-series

 

This configuration does not seems to work on Telerik UI for WPF 2015, how do I set the dot size & coloring on line series ? 

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Feb 2019
1 answer
240 views

I have two series, and I want to display them in a same graph. 

The series 1 has valued at {0.5: value1, 1.5 : value2, 2.5 : value3}

And series 2 has value at { 1: value 1, 2 value2: 3 value3} 

 

How do I draw the two series on the same graph with X value being interlaced ? Tried linear axis but nothing displayed, tried catagroy axis but the graph is separated into two parts. The x value is not interlacing. 

Dinko | Tech Support Engineer
Telerik team
 answered on 28 Feb 2019
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?