The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

ComponentOne Combo

Last post 03-07-2007, 7:03 AM by David.Parsons. 25 replies.
Page 1 of 2 (26 items)   1 2 Next >
Sort Posts: Previous Next
  •  02-23-2007, 1:26 AM 497

    ComponentOne Combo

    I have posted this on the component One forum (http://helpcentral.componentone.com/cs/forums/ShowPost.aspx?PostID=191862)

    but thought I would also post here in case there may be something in ES

    A Component One grid works fine:

    Code:
    With Me.C1TrueDBGrid1 
    	.DataSource = countiesCollection 
    	.Rebind(False) 
    End With 


    A standard ms combo works:

    Code:
    With Me.CountyIDComboBox 
    	.DataSource = countiesCollection 
    	.DisplayMember = "CountyName" 
    	.ValueMember = "ID" 
    End With 

    but a c1 combo crashes:

    Code:
    With Me.C1Combo1 
    	.DataSource = countiesCollection 
    	.Rebind(False) 
    	.DisplayMember = "CountyName" 
    	.ValueMember = "ID" 
    End With 
    

    with :

    An unhandled exception of type 'System.StackOverflowException' occurred in EntitySpaces.Core.dll

    According to C1Live I am using the latest c1combo

    I am using EntitySpaces to provide the data. If it works for the grid why not the Combo?

    Declan

  •  02-23-2007, 2:11 AM 498 in reply to 497

    Re: ComponentOne Combo

    Hi Declan

    It sounds like the C1 combo is trying to navigate through the relationship hierarchy for some reason - not sure on that though.  Out of interest, is there any reason why you're calling ReBind() before you've set the display and value members? I would have thought it better to do that after you'd set them?

    HTH

    Martin

  •  02-23-2007, 2:27 AM 499 in reply to 498

    Re: ComponentOne Combo

    Hi Martin,

    The rebind is not necessary in this case.

    Further tests seem to show that there is something in ES causing the problem. I have just done a simple test on another table with success.

    This table works in the combo:

    id, int, Identity spec = yes, increment = 1
    Description, nvarchar(50)

    This fails:

    id, int, Identity spec = yes, increment = 1
    timestamp, timestamp
    CountyName, nvarchar(50)
    CountyCode, nvarchar(2)
    SelectionTypeID, int
    aka, nvarchar(50)

    I'll post my findings.

    Declan

  •  02-23-2007, 2:40 AM 500 in reply to 499

    Re: ComponentOne Combo

    Hi Declan

    Is there a relationship defined in the second table? The reason I ask is that I'm sure I've seen overflow issues before that have been caused by databinding components trying to walk through the relationships but getting stuck in recursive loops etc.  To check if this is the case, if there are any relationships defined then do you get the same error if you temporarily remove this relationship?

    Cheers

    Martin

  •  02-23-2007, 2:49 AM 501 in reply to 500

    Re: ComponentOne Combo

    Martin,

    I had already tried that and unchecking hierarchical.

    I may have found the cause but not a solution. I deleted the timestamp field from the table and regenerated the class and SQL. This seems to have solved the problem.

    Now what do I do? This table has been in use for years and I need it in the current development. How do I overcome the timestamp issue?

     Declan

  •  02-23-2007, 3:00 AM 502 in reply to 501

    Re: ComponentOne Combo

    Hi Declan

    From the sounds of it, if by removing the TimeStamp field fixes the problem then the combo box must be trying to access ALL of the fields from your object rather than just the two that you've specified for Display and Value - make sense? 

    I don't use C1 components (and am also away from a dev machine so can't test anything anyway) but does it have a 'fields' or 'items'/'columns' type property where you can tell it which fields you want it to use etc? If so, can you add these manually rather than letting it decide which ones to use?

    HTH

    Martin

  •  02-23-2007, 3:33 AM 503 in reply to 502

    Re: ComponentOne Combo

    Martin,

    Yes the combo will list all the selected fields, very handy at times. The simple solution to the problem is to use a view to select the required fields, excluding the timestamp. I will contact Component One and notify them of the problem.

    HTH - ? 

    Declan

  •  02-23-2007, 3:56 AM 504 in reply to 503

    Re: ComponentOne Combo

    Hi Declan

    I don't think you need to bother with generating a View as you should be able to either a) specify which fields you want the Combo to display (check your C1 docs for how to on that) or, b) limit the fields returned in your ES collection using a query (you can select all fields except your timestamp for example) - check the ES docs on how to do that (I would do a quick test here so I could provide a code sample but as I say I'm not at a dev machine so can't unfortunately).

    Oh, and HTH = Hope That Helps/Helped - sorry, I usually avoid using acronyms if I can but occassionally one will slip by un-noticed!

    Cheers

    Martin

  •  02-23-2007, 4:06 AM 505 in reply to 504

    Re: ComponentOne Combo

    Martin,

    Normally there is no problem limiting the fields for display in the C1 combo. However they still exist in the collection and it is when the collection is assigned to then datasource that the crash happens. In order to use the C1Combo I must provide a collection that does not contain the timestamp field.

    I know I could use dynamic SQL to select the required fields. In this instance  a view is the simple and clean approach.

    Thanks, as the ad says "It's good to talk". Are you in the UK?

    Regards,

    Declan

  •  02-23-2007, 4:14 AM 506 in reply to 505

    Re: ComponentOne Combo

    Yup - I'm in "sunny" Birmingham!

    Glad you've made some progress on this - as for the decision to use a View, whatever's best for you - I think in my case in instances like this I'd prefer not to have too many views created just for 'removing' fields from a single table so I'd probably go down the query road but either way, whatever gets the job done right?

    Cheers

    Martin

  •  02-23-2007, 6:14 AM 508 in reply to 506

    Re: ComponentOne Combo

    A timestamp will also crash an MS DataGridView. There is no default formatter for it the way there is for, say, a gif image like the one found in Northwind Employees. This is how I normally handle it for the DataGridView. Perhaps there is a similar mechanism for the Component One control. Although, since you are not trying to display the timestamp in the combobox, it seems odd that it would throw an exception.

    Code:
    DataGridViewColumn col = new DataGridViewColumn();
    col = dataGridView1.Columns["ConcurrencyCheck"];
    if (col != null)
    {
    	col.Visible = false;
    }

    I'm in martin's camp on using DynamicQuery to limit the columns to just those you want to display. It means all the code is in one place and not split between a View and source.


    David Neal Parsons
    www.entityspaces.net
  •  02-23-2007, 6:29 AM 509 in reply to 508

    Re: ComponentOne Combo

    David.Parsons:

    I'm in martin's camp on using DynamicQuery to limit the columns to just those you want to display. It means all the code is in one place and not split between a View and source.

    Point take. Smile

    The Component One Combo will list, in grid format, all the fields presented to it. Basically it is a multi-column dropdown list. I find this useful, for example, where I may wish to select from a list of contacts allowing me to list the names along with other details. This allows for easy selection of the required name where there may be more than one "Joe Bloggs" etc. It has lots of other useful display features.

    Declan

     

     

  •  02-23-2007, 6:37 AM 512 in reply to 509

    Re: ComponentOne Combo

    Ah... so, maybe it is a simple as making the column invisible in the control itself.
    David Neal Parsons
    www.entityspaces.net
  •  02-23-2007, 7:24 AM 513 in reply to 512

    Re: ComponentOne Combo

    Not really! This control is not bound at design time, in my case. Therefore if the collection contains a timestamp I get the crash as soon as the collection is assigned to the datasource property of the combo control.

    Component one handle timestamp columns in their TrueGrid control. The combo is just an extension of the grid, as far as I know. I've just IM'd one of the C1 tech guys who will follow it up for me.

    Trying design time binding and removing the timestamp column from the combo may be worth looking into though if C1 fix the problem the issue will be closed Smile

     

    Did I read somewhere that we may get the ability to select individual fields from a table? If not an option to "not select" certain fields (timestamp ?) may be nice though by no means essential.

  •  02-23-2007, 9:33 AM 518 in reply to 513

    Re: ComponentOne Combo

    Did I read somewhere that we may get the ability to select individual fields from a table? If not an option to "not select" certain fields (timestamp ?) may be nice though by no means essential.

    We have discussed that as a future enhancement. If you did not select the timestamp you would lose concurrency control. But, that would not be an issue for a combobox.


    David Neal Parsons
    www.entityspaces.net
Page 1 of 2 (26 items)   1 2 Next >
View as RSS news feed in XML