Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6754141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:14:41+00:00 2026-05-26T13:14:41+00:00

i have a windows phone silverlight grid that is quite big, around 4 x

  • 0

i have a windows phone silverlight grid that is quite big, around 4 x 22 elements (4 columns, 22 rows) and im trying to implement a search box that dynamically changes properties of those elements and their position in the grid.

each element is a StackPanel (with an Image followed by a TextBlock).

so this page xaml is something like:

<stackpanel>
    <textbox />
    <scrollviewer>
       <grid 22x4 />
    </scrollviewer>
</stackpanel>

ive done it like this so i can scroll that grid without making the top textbox scroll too.

what i want now is to implement the textchange event on the textbox so it filters those elements. for instance there are 3 elements whose name begin with the letter ‘z’, so what i want when i type ‘z’ into the textbox is that all elements whose name dont start with ‘z’ to change their visibility to “collapse” and move all the ones that start with ‘z’ to the firsts row and columns.

but how can i access those elements in code? if i have the grid object, what method returns the list of elements if there is any so i can manipulate them?

also, is this the best way to do it? the way i see it it might be a bit overhead for a mobile application, any tips are welcome.

thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:14:42+00:00Added an answer on May 26, 2026 at 1:14 pm

    I don’t exactly understand how do you want to filter and what kind your grid elements are. But my example shows the way to filter all grid elements, change Grid.Row, Grid.Column, Visibility properties.

    private void Filter(Grid grid, string text)
    {
      var cur = 0;
      var columnCount = grid.ColumnDefinitions.Count;
    
      foreach (var child in grid.Children)
      {
        var name = child.GetValue(NameProperty) == null ? child.GetValue(NameProperty).ToString() : "";
        if (name.StartsWith(text))
        {
          child.Visibility = Visibility.Visible;          
          child.SetValue(Grid.RowProperty, cur / columnCount);
          child.SetValue(Grid.ColumnProperty, cur % columnCount);
          cur++;
        }
        else        
          child.Visibility = Visibility.Collapsed;                  
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Windows Phone 7.5/Silverlight app. I have some code that I duplicate
I have some trigger in my Windows Phone 7 Silverlight app such as <Grid
I have a Silverlight Windows Phone 7 app that pulls data from a public
I'm trying to implement binding validation using Silverlight on Windows Phone, but all I
In Silverlight for Windows Phone I have several view models that are disposable and
I have a Windows Phone 7 application (Silverlight-based) that sends a web request and
I have been using Silverlight for quite a bit and am learning Windows Phone
I have a simple Silverlight app that I want to run on Windows Phone
I have created a Windows Phone 7.5 Silverlight application. Most of the design and
I have a windows phone 7.1 app that tries to get data from a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.