How to get all textbox control in a RadWindow and how to set selecteditem of a RadComboBox.

6 posts, 1 answers
  1. tungnt185
    tungnt185 avatar
    40 posts
    Member since:
    Aug 2009

    Posted 30 Mar 2010 Link to this post

    Hello Telerik team.
    I've some question about RadComboBox as below:

    1) I've a RadWindow with many controls on it: Textbox, RadDateTime, RadComboBox ...
    I want to find all Textbox control and I'm using:

    CType

     

    (frmParam.Content, UIElement).ChildrenOfType(Of TextBox)()

    But it return all textbox like: PickerTextbox(RadDateTime, ComboBox) with name as 'InputBox', 'PART_EditableTextBox'
    So how can I retrieve all Textbox, except PickerTextbox

    2) In RadWindow I've a RadComboBox binding to a entity with SelectedValuePath='ID' type guid
    When RadWindow closed, I save this SelectedValue to a database.
    So If I open this RadWindow again, how can I set selected value of the RadComboBox by this SelectedValue(guid) from database

    Thanks.

     

  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 30 Mar 2010 Link to this post

    Hello Taufik,

    First of all I would strongly recommend avoiding the ChildrenOfType method at any cost. Because it could bring serious performance penalties. It is much better to design your application around MVVM - widely used design pattern in Silverlight and WPF - when you use it you will not need any references to the UI controls, generally you will not have to handle events, etc. If you really have to use ChildrenOfType, you could loop the returned array of TextBox controls and process only those which Type is exactly TextBox, not a descendant type.

    Regarding your second question, if you set the SelectedValue property of RadComboBox, the control will automatically select the specified item.

    Best wishes,
    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. tungnt185
    tungnt185 avatar
    40 posts
    Member since:
    Aug 2009

    Posted 30 Mar 2010 Link to this post

    Hi Hristov.

    Can you show me more detail about using "array of TextBox controls and process only those which Type is exactly TextBox, not a descendant type". I don't know how to get TextBox, not a descendant type.

    I've already set SelectedValue of RadComboBox but have no result. I think because it's a guid value 's get from database

    Regards.




  5. tungnt185
    tungnt185 avatar
    40 posts
    Member since:
    Aug 2009

    Posted 30 Mar 2010 Link to this post

    Hi again,

    I've resolve the second question because I've not yet convert it to guid value when assign.
    But the first question is remain. I don't know how to get exactly TextBox not a descendant type

    Regards.
  6. Answer
    Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 02 Apr 2010 Link to this post

    Hi Taufik,

    Thank you for your question.

    Please find the attached project in which is illustrated how you can find only the TextBoxes which are not descendant.

    If you have any other questions please feel free to contact us again.

    Kind regards,
    Konstantina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  7. tungnt185
    tungnt185 avatar
    40 posts
    Member since:
    Aug 2009

    Posted 04 Apr 2010 Link to this post

    Thanks Konstantina,

    This's my need. My problem's solve now.

    Regards.
Back to Top
DevCraft banner