Telerik Forums
UI for WPF Forum
1 answer
161 views
Is there any possibility to pin/unpin rows or columns in the datagridview for WPF? I am highly looking for somehting like that and I thought due to the fact that you have somehting in for WinForms that it is also in for WPF.

I'd really like to know how to pin records in WPF. can you suggest somehting?
Thanks
Ivan Ivanov
Telerik team
 answered on 09 Aug 2011
6 answers
126 views
Hi,

I'm creating facility to jump to a specific selection (think of a calendar which has a "Today" button to jump immediately to a specific date). This facility changes both the SelectionStart and SelectionEnd properties in two separate operations, however this causes the SelectionChanged event to be triggered twice, once for each operation. Can an "AddSelection(start, end)" method be included change both properties in one operation and only trigger the SelectionChanged event once? (Similar events could be added for VisiblePeriod and Period). I've based this request on a similar AddRange method for the RadChart control that allows the minimum, maximum and step properties to be changed in one operation.

Kind regards,
Dave.
David
Top achievements
Rank 2
 answered on 09 Aug 2011
1 answer
256 views
Hi all, I have Docking with different RadPane in it. Each RadPane have different functionality that spawns a worker thread to get information, I would like to be able to stop the worker thread if the RadPane is not visible. 

I cannot seem to find an event that I can attached to watch this behavior. Any suggestions? I tried watching loading, unloading of rad pane but that does not work since switching tabs in the docked state does not trigger these events.

Any suggestions?
Konstantina
Telerik team
 answered on 09 Aug 2011
2 answers
669 views
Hi,

I have a custom control based off a standard WPF control:

Public Class SendButton
    Inherits System.Windows.Controls.Button

I have also themed standard WPF controls to adopt the current Telerik theme in the Application.Resources of the main app:

<ResourceDictionary
    <Style
        TargetType="{x:Type Button}">
        <Setter
            Property="telerik:StyleManager.Theme"
            Value="{x:Static telerik:StyleManager.ApplicationTheme}" />
    </Style>

Standard WPF controls successfully inherit the Telerik theme, however custom controls based off standard WPF controls do not inherit the Telerik theme.

How can I theme my custom controls to inherit the Telerik theme? I do not want to the change the inheritance of the custom control to a Telerik control to keep the controls as lightweight as possible (the custom controls do not require the additional features of the Telerik controls). I would like to maintain a consistent user experience over the entire solution and theme my custom controls with the Telerik theme.

Kind regards,
Dave.
David
Top achievements
Rank 2
 answered on 09 Aug 2011
1 answer
158 views
Hello

I have tried to link my data model with SQLite database using configuration file and it works fine but i faced this problem.
When i tried an example of the data model (Classes) and data access layer the in same project it works fine, but when i separated the data model in a class library it always gives this error when i tried to get the Scope:

theObjectScopeProvider1.myScope = GetNewObjectScope();
// The Error  : Could not load file or assembly 'System.Data.SQLite'

I added the reference of 'System.Data.SQLite' to class library as usual and it was working when i convert the project from class library to Console application and invoke the scope.
By the way i tried to load the assembly dynamically from the AdjustForDynamicLoad function but nothing changed:
static public void AdjustForDynamicLoad()
        {
            Assembly SQLiteAssembly = Assembly.LoadFile(@"C:\Lib\System.Data.SQLite.DLL");
            if( theObjectScopeProvider1 == null )
                theObjectScopeProvider1 = new ObjectScopeProvider1();
 
            if( theObjectScopeProvider1.myDatabase == null )
            {
                string assumedInitialConfiguration =
                           "<openaccess>" +
                               "<references>" +
                                   "<reference assemblyname='PLACEHOLDER' configrequired='True'/>" +
                                   "<reference assemblyname='PLACEHOLDEZ' configrequired='False'/>" +
                               "</references>" +
                           "</openaccess>";
                System.Reflection.Assembly dll = theObjectScopeProvider1.GetType().Assembly;
                assumedInitialConfiguration = assumedInitialConfiguration.Replace("PLACEHOLDER", dll.GetName().Name);
                //assumedInitialConfiguration = assumedInitialConfiguration.Replace("PLACEHOLDEZ", SQLiteAssembly.GetName().Name);
                System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
                xmlDoc.LoadXml(assumedInitialConfiguration);
                Database db = Telerik.OpenAccess.Database.Get("SQLiteDatabaseConnection",
                                            xmlDoc.DocumentElement,
                                            new System.Reflection.Assembly[] { dll, SQLiteAssembly. } );
 
                theObjectScopeProvider1.myDatabase = db;
            }
        }
 
So, the problem is how to add reference or assembly to the scope.

Thanks in advance.
zenus
Top achievements
Rank 1
 answered on 09 Aug 2011
5 answers
258 views
As the title implies, I'm having trouble implementing a stand-alone RadClock (no TimePicker involved) control in my WPF app. Before the latest upgrade (my current version is Q1 2011), it worked smoothly (i set the Culture property to get rid of the 'AM/PM' suffixes), but now it just won't show the times from 0:00 to 23:00. My attempt:

<telerik:RadClock HorizontalAlignment="Left" Margin="1,7,0,0" Name="radTimeFrom" Culture="sl-SI"  VerticalAlignment="Top" Width="166" Height="145">
           <telerik:RadClock.Header>
               <TextBlock Text="From" Foreground="White"/>
           </telerik:RadClock.Header>
       </telerik:RadClock>

Any ideas as to why this thing doesn't work anymore? :)

EDIT: I tried reverting to an older version of the Telerik controls (ver. Q3 2009 SP2) and it works just fine.
EDIT2: But, of course, this is not a solution, because i would still like to have the latest Telerik controls installed, therefore reverting in my case is out of the question. Any info would be greatly appreciated :)



Thanks in advance,
Concerned Developer
Sandi Markon
Top achievements
Rank 1
 answered on 09 Aug 2011
1 answer
152 views
Hi, i have a project where i use your RadGridView Control, and pass an IQueryable as the ItemsSource property, but the following is happening:

When i select one of the checkboxes from a columnfilter, all works ok (only the items represented by the selected value appears), but when i unchecked it nothing appears in the gridview (the grid view shows no data [no lines]), but the sql that is passed to the database is ok! (i got it with the SqlServer Profile), the same doesn't happen if i click the clear filter button (all the data is showed in the grid).

Regards,
Miguel Freire
Rossen Hristov
Telerik team
 answered on 09 Aug 2011
3 answers
196 views
I'm having issues trying to bind IsExpanded to a bool property

<telerik:RadTreeListView.RowStyle>
    <Style TargetType="{x:Type telerik:TreeListViewRow}">
        <!--<Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}" />-->
        <Setter Property="IsExpanded" Value="True" />
    </Style>
</telerik:RadTreeListView.RowStyle>

First I tried using first setter but I would get exceptions.
Then I tried to bind to the second to isolate the issue. This is the exception I get:


Message:
Object reference not set to an instance of an object.

Stack:
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.OnItemAdded(Object item, Int32 index) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\GridViewItemContainerGenerator.cs:line 2442
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\GridViewItemContainerGenerator.cs:line 2411
   at Telerik.Windows.Controls.GridView.GridViewItemContainerGenerator.System.Windows.IWeakEventListener.ReceiveWeakEvent(Type managerType, Object sender, EventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\ItemsControl\GridViewItemContainerGenerator.cs:line 2290
   at System.Windows.WeakEventManager.DeliverEventToList(Object sender, EventArgs args, ListenerList list)
   at System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   at System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.DataItemCollection.OnCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 665
   at Telerik.Windows.Data.DataItemCollection.OnCollectionViewCollectionChanged(NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 642
   at Telerik.Windows.Data.DataItemCollection.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs e) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\DataItemCollection.cs:line 1046
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 33
   at Telerik.Windows.Data.QueryableCollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 677
   at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChangedWithAdjustedArgs(NotifyCollectionChangedEventArgs originalArguments, Int32 adjustedOldIndex, Int32 adjustedNewIndex) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1133
   at Telerik.Windows.Data.QueryableCollectionView.ProcessSynchronousCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1053
   at Telerik.Windows.Data.QueryableCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 983
   at Telerik.Windows.Data.HierarchicalCollectionView.ProcessCollectionChanged(NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\HierarchicalCollectionView.cs:line 249
   at Telerik.Windows.Data.QueryableCollectionView.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1343
   at Telerik.Windows.Data.QueryableCollectionView.Telerik.Windows.Data.IWeakEventListener<System.Collections.Specialized.NotifyCollectionChangedEventArgs>.ReceiveWeakEvent(Object sender, NotifyCollectionChangedEventArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Collections\QueryableCollectionView.cs:line 1328
   at Telerik.Windows.Data.WeakEvent.WeakListener`1.Handler(Object sender, TArgs args) in c:\Builds\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\WeakEvents\WeakEvent.cs:line 33
   at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, T item)
   at System.Collections.ObjectModel.Collection`1.Add(T item)

The exception occurs when I'm adding a new item to the IEnumerable source that the RadTreeListView is bound to. It is bound to an observable collection (And the bottom 4 lines of the stack are from the Observable collection)




Is there a better way of binding to the IsExpanded property?

v.2011.1.315.35
Vlad
Telerik team
 answered on 09 Aug 2011
0 answers
153 views
Hello,
I want to copy multiple rows from excel and paste them to my grid. At my first copy action all off the rows are copied. but when i try to copy other rows, blank cells-rows are pasted to the grid. i have checked Clipboard.GetText(); but it is not empty.
I have a grid like below
<telerik:RadGridView AutoGenerateColumns="False" Margin="5" ShowGroupPanel="False" HorizontalAlignment="Left"
                             Name="DataGridProducts" IsFilteringAllowed="False" ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
                             AncestorType={x:Type local:PageUpdateProductMainFields}},Mode=TwoWay, UpdateSourceTrigger=PropertyChanged, Path=Products}"
                             Pasting="DataGridProducts_Pasting" KeyDown="DataGridProducts_KeyDown">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="Malzeme Kodu"  DataMemberBinding="{Binding ItemStockCode}" Width="150"/>
                <telerik:GridViewDataColumn Header="Malzeme Adı" DataMemberBinding="{Binding ItemName}" Width="150"/>
                <telerik:GridViewDataColumn Header="Alış Fiyatı"  DataMemberBinding="{Binding IncomePrice}" Width="100"/>
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>

the items source and the events in the grid is below
private DynaList<Product> _Products;
public DynaList<Product> Products
{
    get
    {
        if (_Products == null)
            _Products = new DynaList<Product>();
        return _Products;
    }
    set
    {
        _Products = value;
    }
}
public void AddEmptyProduct()
{
    Product tempProduct = new Product();
    Products.Insert(Products.Count, tempProduct);
}
 
private void DataGridProducts_Pasting(object sender, Telerik.Windows.Controls.GridViewClipboardEventArgs e)
{
    string nodes1 = Clipboard.GetText();
    string[] nodes2 = nodes1.Split(new char[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
    for (int i = 1; i < nodes2.Count(); i += 1)
    {
        AddEmptyProduct();
    }
}
 
private void DataGridProducts_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{
    if (e.Key == Key.RightShift)
    {
        DataGridProducts.CommitEdit();
        AddEmptyProduct();        
        DataGridProducts.SelectedItem = DataGridProducts.Items[Products.Count - 1];
    }
}

Ahmet Özgür
Top achievements
Rank 1
 asked on 09 Aug 2011
1 answer
130 views
Hello,

just moved from R1 to R2 and we have a problem with some of the bindings in the GridView
In the UC I have a grid described like this:
<telerik:RadGridView
                            Margin="6,6,1,4"
                            CanUserReorderColumns="False"
                            CanUserDeleteRows="False"
                            CanUserInsertRows="False"
                            IsReadOnly="True"
                            AutoGenerateColumns="False"
                            IsFilteringAllowed="False"
                            SelectionMode="Extended"
                            SelectedItem="{Binding PersoanaSelectata, Mode=TwoWay}"
                            ItemsSource="{Binding Persoane, Mode=TwoWay}"
                            Name="radGridViewPersoane"
                            ShowGroupPanel="False" >
                   <telerik:RadGridView.Columns>
                       <telerik:GridViewDataColumn Header="Nume"
                                           DataMemberBinding="{Binding Nume}"  Width="4*" TextWrapping="Wrap" IsReadOnly="True"/>
                       <telerik:GridViewDataColumn Header="Prenume"
                                           DataMemberBinding="{Binding Prenume}" Width="4*" TextWrapping="Wrap" IsReadOnly="True"/>
                       
                   </telerik:RadGridView.Columns>
               </telerik:RadGridView>

in the vm I have the properties

private VerificarePersoana _verificarePersoana;
        public VerificarePersoana VerificarePersoana
        {
            get
            {
                if (_verificarePersoana == null)
                    _verificarePersoana = new VerificarePersoana();
                return _verificarePersoana;
            }
            set
            {
                _verificarePersoana = value;
                Notify("VerificarePersoana");
            }
        }
 
        private ObservableCollection<Persoana> persoane;
        public ObservableCollection<Persoanaa> Persoane
        {
            get
            {
                if (_verificarePersoana.Persoane == null)
                {
                    _verificarePersoana.Persoane = new ObservableCollection<Persoana>();
                    
                }
                return _verificarePersoana.Persoane;
            }
            set
            {
                _verificarePersoana.Persoane = value;
                Notify("Persoane");
            }
        }



and in  persoana I have something like
private string _nume;
public string Nume
{
    get { return _nume; }
    set { _nume = value; Notify("Nume"); }
}
 
private string _prenume;
public string Prenume { get { return _prenume; } set { _prenume=value; Notify("Prenume"); } }

  public void Notify(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }


My problem is that in R1 when I updated the information in a separate form for one of the entries the information got updated in the grid too. now it doesn't do that. If i sort the items by a column the information shows up correctly again.

Why is that? i would really like to move my solution to R2 but this is really a problem.

Thanks in advance.
Vlad
Telerik team
 answered on 09 Aug 2011
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?