StrataFrame Forum

pick list

http://forum.strataframe.net/Topic7690.aspx

By Chan - 3/26/2007

Hi,

I would like to bind my BO to lookupedit. However, my table has 46000 records. It caused my form take too long to load. Any workaround?

Thank you

By Ivan George Borges - 3/26/2007

Hi Chan.

Isn't it the time to use the BrowseDialog for that?

By Trent L. Taylor - 3/26/2007

Chan, it doesn't matter what type of control you are trying to use....46000 records is too many in most cases.  The problem with allowing this many records to come back is one, it will be VERY slow, and two, you could outstrip the resources available on end-user machines.  Your machine probably has more memory than most end-user machines will which will result in out of memory exceptions.

You need to work within the disconnected data environment.  Ivan is right on the money, you need to bring back smaller data sets.  This would be a good place to use the BrowseDialog.

By Chan - 3/26/2007

Hi,

Thank you for reply.

I was thinking to use browsedialog. However, my current design is, user can add/edit data in grid. How to have textbox + "..." button inside devexpress xtragrid column? It might able to be done, but not so easy.

I just want to see any alternative way, or I got to change my design.

By Trent L. Taylor - 3/26/2007

How to have textbox + "..." button inside devexpress xtragrid column?

This is basic functionality of the DevExpress grid.  You will use an embedded text box control and then set the text editor to have the buttons just as though a regular DevExpress text box would be used when dropped on a form.  You can get more information on this through the DevExpress forum or their documentation.

By Chan - 3/31/2007

Hi,

I have check out devexpress forum and set to use repositoryItemButtonEdit control.

How could I store the selected record PK to my column field and show custom text? I have code as below. However, it always show same value.

        private void ItemrepositoryItemButtonEdit_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (this.ItembrowseDialog.ShowDialog() == DialogResult.OK)
            {
                this.purchaseInvoiceDetailsBO.ItemID = itemsBO.ItemID;
            }
        }
        private void ItemrepositoryItemButtonEdit_CustomDisplayText(object sender, DevExpress.XtraEditors.Controls.ConvertEditValueEventArgs e)
        {
            if (itemsBO.SeekToPrimaryKey(purchaseInvoiceDetailsBO.ItemID))
            {
                e.Value = itemsBO.ItemCode;
                e.Handled = true;
            }
        }

Please advide. Thank you

By StrataFrame Team - 4/2/2007

It looks like youre code is correct, Chan, however, it could be that the handler fell off of your ItemrepositoryItemButtonEdit_CustomDisplayText() method... there should be a ItemrepositoryItemButtonEdit.CustomDisplayText+= new ConvertEditValueEventHandler(ItemrepositoryItemButtonEdit_CustomDisplayText) somewhere in your designer file.  If that delegate combine call (the +=) is not called, then your method will never be called to return the custom text.  You can tell this pretty easily by placing a breakpoint on the e.Value call in that method and see if the breakpoint is ever hit.
By Chan - 4/2/2007

Hi,

I managed to make it works. I left one more problem, which the grid column show my PK - GUID data type instead of my custom display text when I click on the button. It would reverted to custom display text if I leave the column.

I have posted this to devexpress, still waiting for answer. Do you know the solution?

Thank you

By StrataFrame Team - 4/3/2007

No, I'm sorry... I don't know the solution.  Obviously, if the text is reverting back to the GUID, then it is not firing your event.  What you could do (which might be easier) is add a custom property to your business object... say a property with only a get{}.  Copy over all of the attributes from the PK property and put them on this new property.  Then, in the grid, bind the column to the new property, not the PK column (and you can just hide the PK column).  Then, in your new property, return your custom text.  This way, it won't ever have to swap back and forth between the PK value and your custom text.  In fact, you won't even have to handle that CustomDisplayText event at all.