New Posts New Posts RSS Feed: How to remove "X" button from lookup field on the grid
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

How to remove "X" button from lookup field on the grid

 Post Reply Post Reply
Author
vkuzmich View Drop Down
Newbie
Newbie


Joined: 29-May-2008
Posts: 4
Post Options Post Options   Quote vkuzmich Quote  Post ReplyReply Direct Link To This Post Topic: How to remove "X" button from lookup field on the grid
    Posted: 29-May-2008 at 7:48am
Hi,
 
I am using DevExpress GridControl and IdeaBlade XtraGridBindingManager.  And I am getting "X" button on lookup columns. Please see picture. I put there an example from IdeaBlade documentation and screenshot from my app.
 
Thanks for your help.
 
VK
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 29-May-2008 at 10:45am

 There is a property on the LookupEdit called “AllowNullInput” which if set to “False” is supposed to prevent entering  null input, but it doesn’t seem to work.  Looking further, I see other posts on the Devex Forums from others who also claim that the “AllowNullIInput” property does not work,

 

Back to Top
vkuzmich View Drop Down
Newbie
Newbie


Joined: 29-May-2008
Posts: 4
Post Options Post Options   Quote vkuzmich Quote  Post ReplyReply Direct Link To This Post Posted: 29-May-2008 at 11:23am
Thank you. It is good to know.
 
When you have IdeaBlade XtraGridBindingManager for your grid and have LookUp (inside of XtraGridBindingManager ) there for one of the fields, you don't see this property "AllowNullInput".
 
 
Maybe I can access somehow this property in run-time? I have tried, but did not succeed.
 
 
VK
Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 29-May-2008 at 11:33am
VK,
 
The property is there.  it just doesn't work.  You have to look at the lookupedit.properties.
 
Back to Top
vkuzmich View Drop Down
Newbie
Newbie


Joined: 29-May-2008
Posts: 4
Post Options Post Options   Quote vkuzmich Quote  Post ReplyReply Direct Link To This Post Posted: 29-May-2008 at 11:46am

I think we are really talking about different things. Please take a look at this screen shot.

uploads/temp/20080529_144447_X_Button2.rar

VK

Back to Top
davidklitzke View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 14-Jun-2007
Posts: 715
Post Options Post Options   Quote davidklitzke Quote  Post ReplyReply Direct Link To This Post Posted: 31-May-2008 at 9:38am
A DevForce customer told me that he had obtained this from DevExpress support team:
 

To hide the LookUpEdit popup footer (which holds the close button), set the LookUpEdit.Properties.ShowFooter property to False.
To hide only the Close button, create a custom editor inherited from the LookUpEdit. Override the LookUpEdit.CreatePopupForm method to return a custom PopupLookUpEditForm descendant. Override the PopupLookUpEditForm.SetupButtons method, and after the base method call, set the fCloseButtonStyle property to BlobCloseButtonStyle.None.

[C#]

    public class MyLookUpEdit : LookUpEdit
    {
        //...

        protected override PopupBaseForm CreatePopupForm()
        {
            return new MyPopupLookUpEditForm(this);
        }
    }

    public class MyPopupLookUpEditForm : PopupLookUpEditForm
    {
        //...

        protected override void SetupButtons()
        {
            base.SetupButtons();
            this.fCloseButtonStyle = BlobCloseButtonStyle.None;
        }
    }

We suggest that you refer to the Custom Editors help topic.

Please let us know if this makes sense.

Back to Top
erturkcevik View Drop Down
Groupie
Groupie


Joined: 14-Jun-2007
Location: Turkey
Posts: 40
Post Options Post Options   Quote erturkcevik Quote  Post ReplyReply Direct Link To This Post Posted: 31-May-2008 at 11:21am
This isue solulation as the following :
 

'X' button = assign null value button in the Loookupeditor Display with DrowDown button alongside

 
- First Devforce may be adding feature enable or disable for 'X' button in the DevExpress Lookupedit of ListConverter
 
- Second Adding custom databinder with "LookupEditDataBinder"  file (provided for Devforce)
 
As far as I see, you should comment out the following lines in the LookupEditDataBinder :

[C#]

      if ((listConverter.Editability == Editability.Optional) && !ContainsDeleteButton(properties.Buttons)) {
          properties.Buttons.Insert(0, new EditorButton(ButtonPredefines.Delete));
          properties.ActionButtonIndex = 1;
          properties.ButtonPressed += new ButtonPressedEventHandler(ButtonPressedHandler);
        }

Alternatively, set the (ViewDescriptor.DataConverter as ListConverter).Editability property to a value other than Editability.Optional.

 
Best Regards
 
 
Back to Top
vkuzmich View Drop Down
Newbie
Newbie


Joined: 29-May-2008
Posts: 4
Post Options Post Options   Quote vkuzmich Quote  Post ReplyReply Direct Link To This Post Posted: 02-Jun-2008 at 10:57am
Thank you erturkcevik.
 
This code worked for me:
 

DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit lookup = (DevExpress.XtraEditors.Repository.RepositoryItemLookUpEdit)colShowIAB.RealColumnEdit;

foreach (DevExpress.XtraEditors.Controls.EditorButton button in lookup.Buttons)

{

    if (button.Kind == ButtonPredefines.Delete)

    {

        button.Visible = false;

    }

}

 
VK
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down