custom property

2 posts, 0 answers
  1. ChangJun
    ChangJun avatar
    4 posts
    Member since:
    Sep 2013

    Posted 22 Dec 2013 Link to this post

    hello guys~

    in my project, i need to use kind of custom property grid. 

    it's for select pictures. 

    i got some properties like 'picture1', 'pictrue2'......

    and each property has file url

    and to fill the property i need to pop a window like radwindow to select file - i'll get these files from web service or something. 

    <!-- property grid custum definition edit templete -->
    <DataTemplate x:Key="propPicture1">
        <StackPanel Orientation="Horizontal"
            <TextBox x:Name="propPicutre1"  IsReadOnly="True" />
            <Button  Tag="Picture1"  Click="propPicture_Click" Content="Click" ></Button>
        </StackPanel>
    </DataTemplate>

    so i make datatemplete and added it to propertygrid. 

    click that button opens window to select picture.  and than it changes Property.

    the problem is i couldn't find the textBox of that datatemplate to fill that with selected file url.

    please let me know guys. 


    thanks for reading this. 

    and merry christmas~~~ ^0^
  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 23 Dec 2013 Link to this post

    Hi ChangJun,

    You can try working with ChildrenOfType<T> () extension method and find the TextBox you want. Another possible way to go is to set the DataContext of your Window to be that selected item and get the value of the property you want. However, whether this is appropriate or not depends entirely on your scenario and settings.

    Regards,
    Maya
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top