By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,909 Members | 1,728 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,909 IT Pros & Developers. It's quick & easy.

How to populate grid view depending on textbox

P: 6
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.

Dec 25 '08 #1
Share this Question
Share on Google+
1 Reply

P: 9
You mean listview, right?

Expand|Select|Wrap|Line Numbers
  1. ListView YourListview = new ListView();
  2.             foreach (ListViewItem YourListViewItems in YourListview.Items)
  3.             {
  4.                 // To search list view text
  5.                 if (YourListViewItems.Text == "What you're searching")
  6.                 {
  7.                     // To select the item you found
  8.                     YourListview.SelectedIndices.Clear();
  9.                     YourListview.SelectedIndices.Add(YourListViewItems.Index);
  10.                 }
  12.                 // To search sub items
  13.                 if (YourListViewItems.SubItems[0/*The item you're searching in*/].Text == "What you're searching for")
  14.                 {
  15.                     // Do stuff.
  16.                 }
  17.             }
Dec 30 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.