Prev: memmapfile error
Next: I cant solve this error in ANFIS
From: mattdash on 19 Apr 2007 11:04 I'm having the same problem. As far as I can tell this is some kind of bug with how matlab interacts with the activex contol's settings (but i'm no expert). I got around it by using the "formatstring" property, which automatically sizes the columns to fit the data in the format string. My setup looks like this: handles.flexgrid=actxcontrol('VSFLEX.vsFlexArrayCtrl.1',[60 70 250 520]); handles.flexgrid.formatstring='Name |<Value '; handles.flexgrid.highlight=0; handles.flexgrid.cols=2; I believe the syntax is identical for msflexgrids. The formatstring has the two column header names (name and value) padded with empty spaces to make the columns as wide as I want them. The | seperates the two columns and the < left aligns the text. If you had to, you could set up some kind of check to insert enough spaces to properly size the columns to match the size of the largest piece of data you're putting in the table. Not the nicest solution, but it gets the job done.
From: thomas.bernacki on 19 Apr 2007 12:40
On Apr 18, 11:27 am, Richard Lang <r...(a)mathworks.co.uk> wrote: > ThomasBernackiwrote: > > Hi, > > > I did in fact go to the MSDN page first... that's where I got the > > details on the method in the first place! And most of the stuff that > > was there did indeed work fine - setting numbers of columns, rows, > > putting data in, etc. > > It was just the ColWidth that was giving me the unusual error. I > > actually tried the MSFlexGrid control in VB, and the command > > > htable.ColWidth(0)=2000 > > > works fine (that's the way MSDN says to do it with MSFlexGrid). In > > Matlab though when I run that command it tells me: > > ??? No public field ColWidth exists for class > > COM.MSFlexGridLib_MSFlexGrid_1. > > > I have tried everything, and I can't get the thing to work. I was > > hoping that perhaps someone had actually tried it in Matlab and > > gotten it to work, or whether this is actually some kind of bug. I'm > > running Matlab R14 SP3 by the way. > > > Thanks! > >ThomasBernacki > > > Yair Altman wrote: > > >> Try methodsview(htable) or methods(htable,'-full') to see the full > >> method signatures. Also look at msdn for online help (that was the > >> first Google link - come on!): <http://msdn2.microsoft.com/en-us/library/aa228849(VS.60).aspx> > > >> Yair Altman > > Thomas, > In Matlab, COM properties that require an argument to get or set them > (in this case the column index) can only be set using the "set" command. > This should work: > > set(htable, 'ColWidth', 0, 1800); > > Richard Hi Richard, That worked! Pretty simple too, thank you very much. Thank you everyone else for your assistance as well. Thomas |