http://planetofcoders.com/windows-developer-framework-4-0-sample-questions-10/

 private void btnFindNext_Click(object sender, EventArgs e)
        {
            if (this.bindingSource == null)
            {
                return;
            }
            PropertyDescriptor property = this.cboProperties.SelectedItem as PropertyDescriptor;
            if (property == null)
            {
                return;
            }
            try
            {
                if (bindingSource.SupportsSearching)
                {
                    string find = this.cboFindWhat.Text;
                    int idx = this.bindingSource.Find(property, find);
                    if (idx >= 0)
                    {
                        this.bindingSource.Position = idx;
                    }
                }
            }
            catch
            {
            }
        }

posted @ 2011-05-20 12:56  leslie116  阅读(184)  评论(0编辑  收藏  举报