in
Forums
Blogs
Files
Devexpress.Com
Client Center
Support Center
DevExpress Channel

Xtra Editor Bind TextEdit to LookUp Edit Selection

Last post 10/17/2007 1:20 PM by Frollick. 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 10/16/2007 10:48 AM

    • Frollick
    • Not Ranked
    • Joined on 10/9/2007
    • Caribbean
    • Posts 5

    Xtra Editor Bind TextEdit to LookUp Edit Selection

    So heres my problem, I have a lookup edit on a DataLayout Control (NOT A GRID), I want when the user selects a category from the look up edit, the category code for that category is displayed in the text edit box.  Also when I open an existing record the category for that record is not being display in the lookup edit, it is always empty.  Can someone please give me some direction as to how to accomplish this, greatly appreciated.
  • 10/16/2007 10:53 PM In reply to

    Re: Xtra Editor Bind TextEdit to LookUp Edit Selection

    Have you set the LookUpEdit.Properties.DisplayMember and LookUpEdit.Properties.ValueMember properly?
     
    -Steve
    <Adrian Salmon> wrote in message news:198098@community.devexpress.com...
    So heres my problem, I have a lookup edit on a DataLayout Control (NOT A GRID), I want when the user selects a category from the look up edit, the category code for that category is displayed in the text edit box.  Also when I open an existing record the category for that record is not being display in the lookup edit, it is always empty.  Can someone please give me some direction as to how to accomplish this, greatly appreciated.

    http://community.devexpress.com//forums/p/58627/198098.aspx#198098

    Steve Rasmussen
  • 10/17/2007 12:38 PM In reply to

    • Frollick
    • Not Ranked
    • Joined on 10/9/2007
    • Caribbean
    • Posts 5

    Re: Xtra Editor Bind TextEdit to LookUp Edit Selection

    Hey Steve you I sent a response to support, thanks for ur advice it is now working.  The problem was the after changing control from text edit to lookup edit i forgot to set datasource so it s now loading properly, however, i have not yet figure out how to get the selected lookup edit column value and assign that value to a text edit control.  Any other advice on that?

    Filed under:
  • 10/17/2007 1:20 PM In reply to

    • Frollick
    • Not Ranked
    • Joined on 10/9/2007
    • Caribbean
    • Posts 5

    Re: Xtra Editor Bind TextEdit to LookUp Edit Selection

    Hey Steve, me again. Immediately after sending my last reply I got it working. For anyone with a similar problem my solution was to first set both the LookUp Edit and Text Edit Controls  Edit Value property to the same field in the DataSource, in my case to Category Code.  Next set the Display Member property of the LookUp Edit to the Catgory Name so that the user sees the Category Name instead of the Category ID and set the Value Member property to Category ID.  Now the create the binding so that when the LookUp Edit value is changed, in the EditValueChanged Event handler set the Text Edit control EditValue property to that of LookUp Edit edit value property.

     

    Private Sub LookUpEdit1_EditValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LookUpEdit1.EditValueChanged

    Dim lookup as LookUpEdit = sender 

    TextEdit1.EditValue = lookup.EditValue  'Or TextEdit1.EditValue = LookUpEdit1.EditValue

    End Sub
    Filed under:
Page 1 of 1 (4 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED