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

DropDown Multi-line Textbox

4 Answers 111 Views
PropertyGrid
This is a migrated thread and some comments may be shown as answers.
Dharmavaram
Top achievements
Rank 1
Dharmavaram asked on 27 Sep 2016, 10:30 AM

 Hi,

     I have created a custom control with Textbox having  properties values as AcceptsReturn="True" TextWrapping="Wrap" so that it will acts as Multi line Textbox. I used this control as Editor for one of the Property which binds to PropertyGrid and Editor Style as DropDown.

I have problem here,whatever I write in the textbox once dropdown closed it should be visible in propertyValue but it is not showing the value.How to achieve this??

I am asking similar to TimePicker where once we select time it will be shown in PropertyValue.

Regards,

Nagasree.

 

4 Answers, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 30 Sep 2016, 08:56 AM
Hi Nagasree,

I have created a sample project that implements the desired behavior. Please review it and update me whether it is useful.

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Dharmavaram
Top achievements
Rank 1
answered on 30 Sep 2016, 10:26 AM

Hi Stefan,

   I am not able to run the attached project.It is giving error the mentioned Resource dictionaries are not available.I have .Net Framework 4.5.

 But I saw your code I understood that you are overriding the ToString() method of the class to return the FirstName value so that we get that value in the PropertyGrid. This approach is not feasible for me. I have two fields where I am using this usercontrol in the same class with which property value I have to return in ToString() method.

Can't We use TypeConverter?? I tried to use it but I am not successful. 

Regards,

Nagasree.

 

 

0
Accepted
Stefan Nenchev
Telerik team
answered on 30 Sep 2016, 02:18 PM
Hi Nagasree,

Reapplying the references at your end should fix the issue with the Resource Dictionaries. However, I have recreated the sample for your convenience. Actually the ToString() method should not affect the EditorAttribute. Please review the code-behind of the CustomControl where a dependency property is added which eventually is set as the TargetProperty in the EditorAttribute. Please try applying such approach at your end as well. 

Regards,
Stefan Nenchev
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
0
Dharmavaram
Top achievements
Rank 1
answered on 03 Oct 2016, 05:13 AM

Hi Stefan,

It is working as expected.Thank you.

Regards,

Nagasree

Tags
PropertyGrid
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Dharmavaram
Top achievements
Rank 1
Share this question
or