You must Sign In to post a response.
  • Category: Silverlight

    How to Clear Multiple Textbox data in Silverlight ?

    Hi,

    i need to clear all textbox controls data in my silverlight page. how to clear all controls data in sliverlight ?

    could any one know about this reply me.




    Regards
    Nanda kishore.CH .
  • #717507
    c#

    private void btnClear_Click(object sender, RoutedEventArgs e)

    {

    foreach (object child in container.Children)

    {

    if (child is TextBlock || child is TextBox)

    (child as TextBlock).Text = String.Empty;

    }

    }

    vb.net

    Private Sub btnClear_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)

    For Each child As Object In container.Children

    If TypeOf child Is TextBlock OrElse TypeOf child Is TextBox Then

    TryCast(child, TextBlock).Text = String.Empty

    End If

    Next child

    End Sub

    I Hope To Use Full..
    And Choice The Best Answers

    php-wordpress Developer
    you can any problem to php wordpress to contact me
    jivanibhai7306@gmail.com
    Thanks!!...

  • #717524
    Hi,
    You may loop through all the textboxes and clear the values from it. You will find the code you require in below thread. Please have a look at it:stackoverflow.com/questions/604144/generic-method-to-find-all-textbox-controls-in-silverlight


    Regards,
    Asheej T K


  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.