How to populate grid view depending on textbox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 111111222222
    New Member
    • Dec 2008
    • 6

    How to populate grid view depending on textbox

    Hi All,

    As of now I am populating grid view using code behind. I want to place a textbox and a button to search the grid view using TIN which is one column in my grid view. I placed the textbox and button on top of grid view.

    Please send the process or code to do this...

    I am new to programming field. Your help will be greatly appreciated.

    Thanks
  • peepoohead7
    New Member
    • Dec 2008
    • 9

    #2
    You mean listview, right?

    Code:
    ListView YourListview = new ListView();
                foreach (ListViewItem YourListViewItems in YourListview.Items)
                {
                    // To search list view text
                    if (YourListViewItems.Text == "What you're searching")
                    {
                        // To select the item you found
                        YourListview.SelectedIndices.Clear();
                        YourListview.SelectedIndices.Add(YourListViewItems.Index);
                    }
    
                    // To search sub items
                    if (YourListViewItems.SubItems[0/*The item you're searching in*/].Text == "What you're searching for")
                    {
                        // Do stuff.
                    }
                }

    Comment

    Working...