DropDown Multi-line Textbox

5 posts, 1 answers
  1. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 27 Sep Link to this post

     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.

     

  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 30 Sep Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 30 Sep in reply to Stefan Nenchev Link to this post

    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.

     

     

  5. Answer
    Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    280 posts

    Posted 30 Sep Link to this post

    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.
  6. Dharmavaram
    Dharmavaram avatar
    73 posts
    Member since:
    Jun 2013

    Posted 03 Oct in reply to Stefan Nenchev Link to this post

    Hi Stefan,

    It is working as expected.Thank you.

    Regards,

    Nagasree

Back to Top
UI for WPF is Visual Studio 2017 Ready