Telerik Forums
UI for WPF Forum
1 answer
100 views
If I simply add a gridview and leave all the default properties, then try and populate it with this simple code:

private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            List<string> strings = new List<string>();
            radGridView1.ItemsSource = strings;
 
            strings.Add("a");
            strings.Add("b");
            strings.Add("c");
 
            radGridView1.Items.Refresh();
        }

The rows do not appear until I click a column header to re-order that column. As Items.Refresh() does not work what can I call to make the rows appear?

I know using an ObservableCollection rather than list<string> will work, but I can't do that in this situation.

thanks



Pavel Pavlov
Telerik team
 answered on 27 Feb 2012
3 answers
124 views
Following the demo on GridView settings, I'm saving the declared column visibility when the user control loads. The user can then toggle which columns in the grid they want to see (and export). If they have gotten to a point where they want to reset all the columns back to the default (not all columns are visible by default), I have a link to reset the visibility, by loading the initial saved settings. This works the first time they click on it.

Let's say they then change visibility again and again want to reset, it doesn't work. I'm guessing it's because the persistence manager thinks it's already loaded? How do I get it to re-load? I could do it the manual way, but I want to use persistence because I anticipate them wanting to keep these settings between sessions, so I might eventually persist to a file.
Rayne
Top achievements
Rank 1
 answered on 27 Feb 2012
3 answers
171 views
Is there a way to have scheduleView timeline group day day, week, month, quarter in a way that the user can specify the grouping they want.  Attached is a proposed mockup of what i'm trying to accomplish.
Yana
Telerik team
 answered on 27 Feb 2012
1 answer
58 views

Hi,

I have two styling issues wtih the GridView.  The first is I am trying to by default set a column style to not display the Filter for a column by default (we only have a few columns in each grid that are filterable).  My code is as follows:

<Style  TargetType="telerik:GridViewColumn" >
        <Setter Property="IsFilterable" Value="False"/>
    </Style>

Second, I have a cell style set as well but I now when I set the Background brush for a column it has no affect.  What am I doing wrong?

<Style TargetType="telerik:GridViewCell" >
       <Setter Property="Template">
           <Setter.Value>
               <ControlTemplate TargetType="{x:Type telerik:GridViewCell}">
                   <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                       <ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                   </Border>
               </ControlTemplate>
           </Setter.Value>
       </Setter>
       <Setter Property="BorderBrush" Value="#FFEFEFEF" />
       <Setter Property="BorderThickness" Value="0,0,1,0" />
       <Setter Property="Margin" Value="2,0,0,0"/>
       <Setter Property="VerticalAlignment" Value="Center"/>
       <Setter Property="HorizontalAlignment" Value="Stretch"/>
        
   </Style>

In the gridview I am setting the background as such:

Any help would be greatly appreciated!
David A.

<telerik:GridViewDataColumn DataMemberBinding="{Binding HoursCompleted}" Header="Hours" UniqueName="HoursCompleted" DataFormatString=" {0:n2}" HeaderTextAlignment="Center" Width="60"  Background="#33FDA500"/>






Vanya Pavlova
Telerik team
 answered on 27 Feb 2012
5 answers
463 views
Hi,

I have this XAML:

<telerik1:RadSplitButton 
    Content="Some Label"
    IsEnabled="{Binding SomeProperty}"
    Command="{Binding MyCommand}"
....

Where MyCommand is a DelegateCommand class where the CanExecute method returns True. The problem is that the IsEnabled in the XAML is ignored and the button is always enabled even if SomeProperty's value is false.

This is unexpected because it does not happen with other controls like the standard Button. I was going to post a bug report but I am not sure if this is by design.

Jose
Zarko
Telerik team
 answered on 27 Feb 2012
2 answers
345 views

Our use case is to have a grid which can be expanded to show more granular details including child data, similar to your samples.  One of the catches is that not all the data is available in the ItemsSource collection of objects.  To avoid what will appear as a memory leak over time, we chose to load / unload the child data as needed.  We have success using the RowIsExpandedChanged event to manage the data.  We also use the HierarchyChildTemplate and specify the DataTemplate as a collective group of controls and UserControls.  

One of these UserControls is another GridView to present a collection of child details of the parent record.  This user control will subscribe to events and update its grid with additions and edits.  To wire up these events we use an identifier passed to the control via a DependancyProperty.  We have found that once a row has been expanded and the UserControl initialized for those events it will remain in effect even when the row is collapsed.  To confirm this we wired up the CoerceValueCallback on the DependancyProperty and it is not getting fired when we expand the row after the first time.  We understand that due to the virtualization rows are destroyed when out of view. So, in turn, just the event of the user scrolling around will perform a sort of "clean up."  As good practice of not leaving resources in use when no longer visible, is there some property we should be setting to destroy the HierarchyChildTemplate when the row is collapsed? 

Here are some segments of code we are using. 

<Telerik:RadGridView Grid.Row="1" x:Name="radGridViewMain" ItemsSource="{Binding Incidents}"

 IsReadOnly="True" AutoGenerateColumns="False" CanUserFreezeColumns="False"

RowIsExpandedChanged="radGridViewMain_RowIsExpandedChanged"

 ShowGroupPanel="True" RowIndicatorVisibility="Collapsed"

TelerikGridViewHeaderMenu:GridViewHeaderMenu.IsEnabled="True"

 CustomFilter:CustomFilterBehavior.TextBox="{Binding ElementName=textBoxFilter}">

 

 

 

<Telerik:RadGridView.ChildTableDefinitions>

<Telerik:GridViewTableDefinition>

<Telerik:GridViewTableDefinition.Relation>

<TelerikWindowsData:PropertyRelation ParentPropertyName="PrimaryKey"/>

</Telerik:GridViewTableDefinition.Relation>

</Telerik:GridViewTableDefinition>

</Telerik:RadGridView.ChildTableDefinitions>

<Telerik:RadGridView.HierarchyChildTemplate>

<DataTemplate>

<Controls:ChildItems PrimaryKey="{Binding PrimaryKey}"  />

 

 

 

Paul
Top achievements
Rank 1
 answered on 27 Feb 2012
1 answer
133 views
Hi,
I have a radtileview with a small number of tiles and I am attempting to loop through the tiles and maximse each one in turn form code behind. I get the  'Object reference not set to an instance of an object.' error when maximise is called. Can you put me right with this.
Regards,
Joe

The Code:

 

For I As Integer = 0 To Me.RadTileView1.Items.Count - 1

Dim item As RadTileViewItem = TryCast(Me.RadTileView1.Items(6), RadTileViewItem)

item.TileState =

 

TileViewItemState.Maximized

Thread.Sleep(5000)

Next


Zarko
Telerik team
 answered on 27 Feb 2012
1 answer
74 views
Hi,

Anybody can help me,
I need to provide the ability to store number of fixed (by user) filters and also the ability to activate each one by single-click. (like Favorites).

Thanks a lot
Dimitrina
Telerik team
 answered on 27 Feb 2012
7 answers
530 views
Currently, groups are sorted alphabetically by their first constituent property definition (eg, if group 1 contains B, C, and D while group 2 contains A, E, and F, group 2 will appear first). Is there a way to control the sorting behavior of the groups-- for example, to sort by the groupname rather than by it's constituents? If not, is such a feature planned?
Ivan Ivanov
Telerik team
 answered on 27 Feb 2012
1 answer
139 views
I need to set those 3 buttons ( navigate left , navigate right and the middle one who opens up a datetimepicker) Enabled = False in some scenarios. I did succed for the left and right navigation buttons by searching through their parents untill i reach the RadScheduleView type (using GetVisualParent<RadScheduleView>()). I dont know why this is not happening for the middle button too. Please help.
Thank you !

Edit : Please let me know if there is a short way to do that instead of my approach.
Dorin
Top achievements
Rank 1
 answered on 27 Feb 2012
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
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?