Geoff Hirst
|
|
Group: Forum Members
Posts: 123,
Visits: 3.5K
|
hi, ok, moved on a fair bit. First up. The listview can have an autocolumnwidth. Populate your LV THEN set the columnwidth to -1 or -2. -2 did it for me. However, I can't use the LV because I need to export to PDF, and Excel etc. Possible enhancement chaps? . So, back to the Enhancedlist. You need to set additional properties when you add columns programmatically. The properties I had omitted were .Visible = True ' Doh, - defaults to false .VisibleIndex = something other than the default of -1 ' doh .Width = something other than 0 ' doh - why I figured it would default to 60 like everything else seems to do I don't know. Magically, columns appear. Almost there now. thanks for the contributions. Geoff.
|
|
|
Geoff Hirst
|
|
Group: Forum Members
Posts: 123,
Visits: 3.5K
|
Hi Trent, Columns are populated generically from the business object allfieldslist. I would use the Listview but I need an autocolumnwidth capability that I can't see on the list view. thanks Geoff.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
The area where the blue bar is where the data should be. I just can't see it. Any ideas? It looks like you do not have any columns. Did you clear our the columns or even create any columns for the ListView? The SF ListView is actually far more advanced than the DevEx EnhancedList. But from a first glance, it looks like there are no columns within the grid.
|
|
|
Geoff Hirst
|
|
Group: Forum Members
Posts: 123,
Visits: 3.5K
|
Hi Rainer, No solution at this time, awaiting response from Microfour guys. At the moment have removed EnhancedList and replaced with base XtraGrid. Requires a bit more messing around but have majority of results I wanted. Would prefer to have EL working though. If I resolve, I will post here. best Geoff.
|
|
|
Rainer Kempf, RK
|
|
Group: StrataFrame Users
Posts: 55,
Visits: 1.4K
|
Hello Geoff,
I have sometimes the same problem as you.
On miy side helps when i add control again on form.
But it would be interresting to know what cuases this problem.
If you have solution for this it would be nice to would tell us.
Thanks
Rainer
|
|
|
Geoff Hirst
|
|
Group: Forum Members
Posts: 123,
Visits: 3.5K
|
Hi Trent, I have now resolved the first issue. The error was all mine, as expected, and it was the methodtoexecute property. I had used semi-colons as the delimeter all the way across, rather than just after the method name. I have now resolved this so thats great thanks for the help there. My final issue, is actually seeing the data in the enhancedlist. Everything is being populated I can click rows in the grid and if I debug, the data is present. Want I cannot see is the data in the grid. I know this is a devexpress thing, I just can't remember what. The area where the blue bar is where the data should be. I just can't see it. Any ideas? thanks for helping me sort the previous issues. best Geoff
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
Given that this is occuring with a Listview as well, my Listviewpopulationsettings object has to be wrong. What have I missed? Yeah. Could you post a sample of this so I can make sure I direct you correctly? Also, you can look at the StrataFlix sample as this is done a lot within those samples...including using the CopyDataFrom method.
|
|
|
Geoff Hirst
|
|
Group: Forum Members
Posts: 123,
Visits: 3.5K
|
Trent, Sorry for my incoherence. Here is the stack trace that I get from using a SF Listview " at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.ThrowHelper.ThrowArgumentOutOfRangeException() at System.Collections.Generic.List`1.get_Item(Int32 index) at CodePage_Security_POC.POC_Menu.lvw_ListPopulating(ListPopulatingEventArgs e) in F:\CodePage\CodePage_Security_POC\CodePage_Security_POC\POC_Menu.vb:line 148 at MicroFour.StrataFrame.UI.Windows.Forms.ListView.GetFilledBusinessObject(Object[] Parameters)" {"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"} Now this was thrown in the listpopulating event, where it attempts to assign a value to the second parameter of the CopyDataFrom method. Given that this is occuring with a Listview as well, my Listviewpopulationsettings object has to be wrong. What have I missed? Above all this, the real problem I have is that when I have managed to get the Enhancedlist populated, there is nothing visible in the grid. You can click on the grid, and the selection bar moves, but there are no column headings etc. The data is in the grid, as I have established this through debug.writeline, you just can't see it on the grid. I know this is something to do with Developer Express as I remember this happening to me a long time ago, but I can't remember the solution. thanks in advance Geoff.
|
|
|
Trent Taylor
|
|
Group: StrataFrame Developers
Posts: 6.6K,
Visits: 6.9K
|
I guess I am not totally following. What was the stack trace of the error that you were getting? Also, do you get the same error with a ListView (standard SF not the EnhancedList)?
|
|
|
Geoff Hirst
|
|
Group: Forum Members
Posts: 123,
Visits: 3.5K
|
Trent, THanks for the response. Now, I don't like being the first to say something isn't right, so I am going to go down the route that I have done something or not done something to cause the problem. Star Trek is always right in that the capabilities of the many outweigh the capabilities of the one. I also understand that the underlying component is Developer Express Grid and that they may make breaking changes. So, my original post misses off a critical item and that is static properties seem to be ok. The issue I was having was when trying to do this dynamically using a ListViewPopulationSettings object. I was also talking mince when I said it was the createdatasource method, the code I changed was in the GetFilledBusinessObject function instead. (it was sunday and I had been on this most of the day) Here is my changed code, it has 'GH on the end. Not the prettiest but it stopped the exception occuring. Dim laAllParams() As String 'GHDim laparams() As String = {"Item1", "Item2"} 'GHDim loBO As BusinessLayerDim loListEventArgs As ListPopulatingEventArgs = NothingDim lnCnt As IntegerDim loType() As System.Type = New System.Type() {}TryWith _PopulationDataSourceSettings'-- Create a reference to the business objectloBO = CType(Activator.CreateInstance(GetTypeFromReferencedAssemblies(.BusinessObjectType)), BusinessLayer)'-- Find the parameterslaAllParams = .MethodToExecute.Split( ";"c) '(1).Split(New Char() {","c}, StringSplitOptions.RemoveEmptyEntries) 'GHArray.ConstrainedCopy(laAllParams, 1, laparams, 0, laAllParams.GetUpperBound(0)) ' GH'-- Get the method namelcMethodName = .MethodToExecute.Split( ";"c)(0) This is the code I was using to create the ListViewPopulationSettings Object With lvps.BusinessObjectType = "CodePage_Security_BOL.P2_1"For Each fieldname As String In Me.P2_11.AllFieldsList.DisplayFieldNames.Add(fieldname) .FormatColumns.Add( "{" & fieldcounter & "}", MicroFour.StrataFrame.UI.ListViewColumnPopulationType.FormattedString).FormatString = "{" & fieldcounter & "}"fieldcounter += 1 Next.MethodToExecute = "CopyDataFrom;MicroFour.StrataFrame.Business.BusinessLayerBase;MicroFour.StrataFrame.Business.BusinessCloneDataType".ValueMember = "UserID"End WithMe.el.PopulationDataSourceSettings = lvpsMe.el.Requery() ' Private Sub el_ListPopulating(ByVal e As MicroFour.StrataFrame.UI.ListPopulatingEventArgs) Handles el.ListPopulatinge.Parameters(0).Value = Me.P2_11e.Parameters(1).Value = MicroFour.StrataFrame.Business.BusinessCloneDataType.ClearAndFillFromDefaultView End Sub So, after deciding that modifying the Inherited UI is probably making things worse, I decided to re-install. I am now back to my original error of failing to populate the EnhancedList. So, either there is a problem with the GetFilledBusinessObject function OR my ListviewPopulationSettings creation is incorrect. I think I know where I would rather put my money, so over to you guys. What am I doing wrong? Thanks chaps. Geoff
|
|
|