String Templates Don't Update With String Property Changes

5 posts, 1 answers
  1. Andrew
    Andrew avatar
    28 posts
    Member since:
    Mar 2013

    Posted 15 Apr 2013 Link to this post

    I'm not sure if this is a bug, or if I'm doing something wrong, but when I change a string property of my business object, the gridpropertyview string editor field doesn't reflect the new value, I have to force the control to update (ie. type in the search field) for the new value to be displayed.  The radcombobox seems to update automatically, as does the checkbox.  Is there a way to force the update with the textbox automatically?
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 16 Apr 2013 Link to this post

    Hi Andrew,

    Will it be possible to provide a bit more information about your exact scenario ? Do you update the property outside the property grid like:

    private void RadButton_Click(object sender, RoutedEventArgs e)
            {
                var firstClub = (this.Resources["MyViewModel"] as MyViewModel).Clubs[0];
                firstClub.Name = "NewName";
            }

    where the property grid is defined as:
    <telerik:RadPropertyGrid Item="{Binding Clubs[0]}" />

    Does this follow your scenario or is there anything that I am missing ?
    Furthermore, which version are you working with ? 

    Kind regards,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Andrew
    Andrew avatar
    28 posts
    Member since:
    Mar 2013

    Posted 16 Apr 2013 Link to this post

    I'm working with version 2013.1.403.40.  

    I set the binding in code-behind by setting radpropertygrid.item = mybusinessobject.

    I then modify mybusinessobject in code-behind.


    An example is as follows (in VB.net)
    <Window x:Class="MainWindow"
            Title="MainWindow" Height="350" Width="525">
            <Grid>
            <telerik:RadPropertyGrid Margin="0,37,0,0" Name="RadPropertyGrid1" />
            <TextBox Height="23" HorizontalAlignment="Left" Margin="96,6,0,0" Name="tStoreName" VerticalAlignment="Top" Width="252" />
            <Label Content="My Store Name" Height="28" HorizontalAlignment="Left" Margin="0,6,0,0" Name="Label1" VerticalAlignment="Top" />
        </Grid>
    </Window>

    Class MainWindow
        Public MyStore As New GroceryStore
     
        Public Sub New()
     
            ' This call is required by the designer.
            InitializeComponent()
     
            ' Add any initialization after the InitializeComponent() call.
            Me.RadPropertyGrid1.Item = MyStore
     
        End Sub
     
     
        Private Sub tStoreName_TextChanged(sender As System.Object, e As System.Windows.Controls.TextChangedEventArgs) Handles tStoreName.TextChanged
            MyStore.Name = tStoreName.Text
        End Sub
    End Class
     
    Public Class GroceryStore
        Public Property Name As String
    End Class

  5. Answer
    Maya
    Admin
    Maya avatar
    4062 posts

    Posted 17 Apr 2013 Link to this post

    Hello Andrew,

    Could you verify whether you have INotifyPropertyChanged interface implemented for your business object ?
     

    All the best,
    Maya
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Andrew
    Andrew avatar
    28 posts
    Member since:
    Mar 2013

    Posted 17 Apr 2013 Link to this post

    Maya,

    Thanks for the help.  I wasn't aware I had to have INotifyPropertyChanged implemented for the PropertyGrid to function properly.  I didn't see it in any of the examples I went through.  Once I researched how to implement it, it seems to work as expected.
Back to Top
UI for WPF is Visual Studio 2017 Ready