This is a migrated thread and some comments may be shown as answers.

custom property

1 Answer 38 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
ChangJun
Top achievements
Rank 1
ChangJun asked on 23 Dec 2013, 03:30 AM
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^

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 23 Dec 2013, 08:02 AM
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 >>
Tags
PropertyGrid
Asked by
ChangJun
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or