Telerik Forums
UI for WPF Forum
0 answers
169 views

I need to bind List<string>  to a treeview,  the string is cut by /,like "a/b/c/d" ,''a/b/e/f" ,"a/b/c/g" ,  

Is any simple method to bind it   without  constructing  a cascading object?

rui
Top achievements
Rank 1
 asked on 08 Aug 2017
1 answer
695 views

Hello Telerik,

 

I'm using a DataTable to set my RadGridView ItemsSource. My grid was set like this :

_Xaml

<telerik:RadGridView x:Name="gridSaisie" Grid.Row="1" HorizontalAlignment="Stretch" Margin="5" ShowGroupPanel="False" CanUserInsertRows="False" CanUserDeleteRows="False" CanUserReorderColumns="False" RowIndicatorVisibility="Collapsed" AutoGenerateColumns="False" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto" CellValidating="gridSaisie_CellValidating" CellEditEnded="gridSaisie_CellEditEnded" RowEditEnded="gridSaisie_RowEditEnded"/>

_C#

private void ConstructGrid()
        {
            //Création de la colonne de dates
            GridViewDataColumn colonneDate = new GridViewDataColumn();
            colonneDate.DataMemberBinding = new Binding("Date");
            colonneDate.Header = "Jour";
            colonneDate.UniqueName = "Jour";
            colonneDate.DataFormatString = "{0: dd}";
            colonneDate.IsReadOnly = true;
            colonneDate.Width = 150;
            colonneDate.IsSortable = false;
            colonneDate.IsFilterable = false;
            colonneDate.HeaderTextAlignment = TextAlignment.Center;
            //colonneDate.DataType = typeof(DateTime);
 
            this.gridSaisie.Columns.Add(colonneDate);
 
            //Création dynamique des colonnes
            foreach (Variable v in this.ViewModel.Variables)
            {
                GridViewDataColumn colonneVariable = new GridViewDataColumn();
                var bindVariable = new Binding(string.Format("Variable_{0}", v.Id));
                bindVariable.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
                bindVariable.StringFormat = "{0:F1}";
                bindVariable.Mode = BindingMode.TwoWay;
                colonneVariable.DataMemberBinding = bindVariable;                
                colonneVariable.Header = v.Code;
                colonneVariable.UniqueName = string.Format("Variable_{0}", v.Id);
                colonneVariable.IsReadOnly = false;
                //colonneVariable.Width = ;
                colonneVariable.IsSortable = false;
                colonneVariable.IsFilterable = false;
                colonneVariable.HeaderTextAlignment = TextAlignment.Center;
                //colonneVariable.DataType = typeof(double);
 
                this.gridSaisie.Columns.Add(colonneVariable);
            }
        }
 
        private void LoadData(int idStation)
        {
            this.gridSaisie.ItemsSource = this.ViewModel.Jours; //Its the DataTable
        }

 

I have somes problems :

1) When I set DataType = typeof(...), the displayed values are empty.

2) StringFormat for the Date doesn't work.

3) When I start updating, the cell value is hidden (I think is linq to '4)')

3) I can't update values in the Grid. I found this topic : http://www.telerik.com/forums/updating-a-datatable-with-radgridview where is it explain that the update will be to do manually. So I didi it :

private void gridSaisie_CellEditEnded(object sender, GridViewCellEditEndedEventArgs e)
        {
            int numCol = e.Cell.Column.DisplayIndex;
            int numRow = this.gridSaisie.Items.IndexOf(this.gridSaisie.SelectedItem);
            var row = this.ViewModel.Jours.Rows[numRow];
 
            row.BeginEdit();
 
            var colonnes = row.ItemArray;
            colonnes[numCol] = e.NewData.ToString();// Convert.ToDouble(e.NewData.ToString());
 
            row.EndEdit();
            row.AcceptChanges();
            //this.gridSaisie.Rebind();
        }

But there isn't changement.

 

Can you help me ?

 

Thank you.

Dinko | Tech Support Engineer
Telerik team
 answered on 07 Aug 2017
3 answers
222 views

Hello everyone.

Is it possible to add context menu (RadContextMenu or System.Windows.Controls.ContextMenu) to filtering control in RadGridView?

I need to implement copy and past functions on textboxes in the FilteringControl.

It is the sample where I try to do this ( https://drive.google.com/file/d/0B1j-40J5aVOfSEctRHdZYnh3RjA/view?usp=sharing ). 
There are ContextMenu in UserControlWithMenu and in FilteringControlEx, but both of them doesn't appear on right mouse click.

Stefan
Telerik team
 answered on 07 Aug 2017
1 answer
205 views

When Mouse is on a recurring, it show tooltip.

However when case 'Recurring task on single row', it doesn't show tooltip.

How can I make it to show tooltip when 'Recurring task on single row'?

Polya
Telerik team
 answered on 07 Aug 2017
1 answer
97 views

Hi,

I want to show one empty row at the end of the RadGridview when it is loaded when the data is empty.How to achieve this.I tried like shown below but no use

 

if(collection.Count ==0)

{

var itemsView = (IEditableCollectionView)CollectionViewSource.GetDefaultView(SyncObjects);
                    itemsView.NewItemPlaceholderPosition = NewItemPlaceholderPosition.AtEnd;

}

Once after loaded user will add data using add button.Now the grid is appearing as shown in the image where only headers are coming and it is not appealing  like grid.

 

I want one empty row once it is loaded when no data exist.How to achieve this.

Stefan
Telerik team
 answered on 04 Aug 2017
1 answer
255 views

Hi I am having combobox in the GridViewData column and i am binding the ItemSource with one  of the property present on the class binded to the radgridview itemsource collection.For example I binded radgridview with list of employees.Employee is a class and I binded the combobox itemsource with dependants property which is one of the property on the employee class.

But the combobox is not populating.DataContext of RadGridView is separate and it is another viewmodel class.

 

<telerik:GridViewDataColumn.CellEditTemplate>
                       <DataTemplate>
                           <telerik:RadComboBox x:Name="ComboBox"  SelectedIndex="0"  Height="20" Width="150"
                            ItemsSource="{Binding Items,RelativeSource={RelativeSource AncestorType=telerik:GridViewRow}}"
                            ItemTemplate="{StaticResource RadComboBoxItemTemplate}"
                            SelectionBoxTemplate="{StaticResource SelectionBoxTemplate}">
                           </telerik:RadComboBox>
                       </DataTemplate>
                   </telerik:GridViewDataColumn.CellEditTemplate>

 

Stefan
Telerik team
 answered on 04 Aug 2017
2 answers
240 views

Hi,

I have a real simple grid prototype. Works fine until I group by a column. When any grouping applied the area below the header row is blank although the gridview seems to be resizing as expected. I think this is a rendering issue. 

More details:

  • Windows 10 OS
  • VS2017
  • Dell PC
  • Latest Telerik, installed today (trial)

Images attached show the before and after. Notice that the size (border) of the grid changes as expected.

Code fragment:

 
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
     
    <telerik:RadGridView Grid.Row="0" ItemsSource="{Binding Variables}" GroupRenderMode="Nested"
                         AutoExpandGroups="True" AutoGenerateColumns="False">
        <telerik:RadGridView.Columns>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Type}" Header="Type" IsGroupable="True"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Header="Name" IsGroupable="False"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding Index}" Header="Index"/>
            <telerik:GridViewDataColumn DataMemberBinding="{Binding BriefDescription}" Header="Description" IsGroupable="True"/>
        </telerik:RadGridView.Columns>
         
        <telerik:RadGridView.GroupDescriptors>
            <telerik:GroupDescriptor Member="BriefDescription" SortDirection="Ascending" />
        </telerik:RadGridView.GroupDescriptors>
    </telerik:RadGridView>
     
</Grid>

Any ideas?

Stefan
Telerik team
 answered on 04 Aug 2017
0 answers
139 views

 Hello,

I've implemented 2 years ago a CustomDockingPane to work with Catel MVVM pattern but reviewing the code looks like a ...hum... Code smell...

I was wondering if I'm the only one which use those 2 framework together or is there anyone who can share his implementation with me

 

I've asked in the past and also sent ticket to Telerik support but they don't know the Catel Framework so well...

 

so...anyone alive?

Thanks

 

Michele
Top achievements
Rank 2
 asked on 03 Aug 2017
1 answer
106 views
Hi,

As I would like to display rich, structured information with validation errors, in my application calls to INotifyDataErrorInfo.GetErrors don't return strings but complex objects. For example, there is a severity level that would need to affect the colors (from orange to darker red).

It easily works everywhere, except on the RadGridView.

I've been trying to replace the GridViewValidationToolTipTemplate with something that does not assume errors to be simple strings. I've tried setting the ToolTip.Content in other templates to Validation.Errors (the original errors) instead of Errors (which is a list of strings), but that just brings a list of duplicated entries at row level (GridViewRowTemplate), or no entry at all on cell level (GridViewCellTemplate).

Am I missing something? What do you suggest?

Thanks
Stefan
Telerik team
 answered on 03 Aug 2017
1 answer
88 views

Hey

I have some problem with Kendo.Grid()

I wanna add filter for some column value then is NULL.

Code here:

x.Ajax().Read(r => r.Action("DataSource", "SRV_Service", new { area = "SRV" }))
.Filter(f => f.Add(s => s.PID).IsEqualTo((Guid?)null))

Datasource when i use null value filter.

https://resimyukle.xyz/resim/KU48JA

 

MVC Enums for filter operators

    public enum FilterOperator
    {
        IsLessThan = 0,
        IsLessThanOrEqualTo = 1,
        IsEqualTo = 2,
        IsNotEqualTo = 3,
        IsGreaterThanOrEqualTo = 4,
        IsGreaterThan = 5,
        StartsWith = 6,
        EndsWith = 7,
        Contains = 8,
        IsContainedIn = 9,
        DoesNotContain = 10
    }

 

And your "Operator used in FilterDescriptor" keys has IsNull operator
http://docs.telerik.com/aspnet-mvc/api/Kendo.Mvc/FilterOperator

How can i do append IsNull operator on Kendo.Mvc.FilterDescriptor ?

Please help me

 

 

 

Martin Ivanov
Telerik team
 answered on 03 Aug 2017
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
DataPager
PersistenceFramework
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
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?