Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2730
Binding source position index search
posted

I am basically doing a  search against the binding source so that i can set the active row. Can some give me assistance. I get set the binding source with current position. One I recieve the binding source position , i can set the active row with the value of the binding source position. For some reason it keep giving me the position 0

 

  private void UserSearchUltraTextEditor_ValueChanged_1(object sender, EventArgs e)
    {
      string userNameToFind = UserSearchUltraTextEditor.Text;

      this.ultraGrid1.ActiveRow = null;

      foreach (var user in this.userDataSet.ApprovedPersonnel)
      {
        if (user.UserName.StartsWith(userNameToFind, true, System.Globalization.CultureInfo.CurrentCulture))
        {
          BindingSource.Position =  this.BindingSource.IndexOf(user);  //  This line is setting the position to 0 //everytime which is false

          this.ultraGrid1.ActiveRow = this.ultraGrid1.Rows[BindingSource.Position];
          break;
        }
      }
    }

Parents Reply Children
No Data