
rot13
Avatar/Signature-
Posts
53 -
Joined
-
Last visited
rot13's Achievements
Newbie (1/14)
0
Reputation
-
Anyone have any ideas on this one? I'm still struggling with it.
-
No problem. It's a tough one. I've been all over msdn.com and just about any other website that google can find 'DataBinding' on... and still... nothing. *sigh* I'm just hoping somebody here has tried to do the same thing and figured out how... anyone?
-
Yes, when I have a Purchase Order that already has LineItems, and I open it, the DataGridView binds correctly and displays the correct product. EDIT: Also, I tried taking the DisplayMember off of the ComboBox cell (it was 'Name' so it would show the product name there) and now when I try to create a line item and select a product, it will select the product, but I can't move focus to anything else until I hit escape to cancel the selection.
-
The way I understand it, is the DataGridView doesn't try to 'commit' the value to the underlying object until you move off of the cell, or row. That may not be right, but that's not really important. I'm trying to change the Product property on the underlying LineItem object, and it will let me select the Product from the ComboBox, but when I move off of that Cell (click another Cell or another control, or hit enter) the value will go back to null. EDIT: I just remembered that I had put in an error handler in the DataError event to keep it from showing the message box each time. When I try to change the Product property, I get an ArgumentException with the following message: Object of type 'System.String' cannot be converted to type 'Product'. It seems to think the objects in the ComboBox are strings, not Products... but they are products. Anyone have any ideas?
-
I have a DataGridView with a BindingSource bound to a BindingList<LineItem> (A custom business object that represents a line in a purchase order) Fields in the LineItem class include Number, Product (of type Product), Quantity, and so on. I have the product field set up as a combobox field with a binding source bound to a BindingList<Product> The combobox dropdown populates fine, and you can select a product, but when you move off of the cell to 'commit' it, the value goes away and doesn't get set in the underlying LineItem object. Any ideas why this happens or how to fix it? Thanks
-
I'm automating a report where I have to pull data from a database and copy a template worksheet in the workbook and rename it for each 'campaign' i get back from the database. When doing this, I get the following COMException: "The server threw an exception. (Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT))" Error Code: -2147417851 The code I have at the moment: worksheet = DirectCast(workbook.Worksheets("(campaign name)"), Excel.Worksheet) Dim newWorksheet As Excel.Worksheet = DirectCast(workbook.Worksheets.Add(), Excel.Worksheet) worksheet.Copy(, newWorksheet) worksheet = DirectCast(workbook.Worksheets("(campaign name) (2)"), Excel.Worksheet) worksheet.Name = cmp.Description worksheet.Visible = Excel.XlSheetVisibility.xlSheetVisible That's not what I started with... I've been trying different ways of copying and pasting, and it all gets me pretty much the same result...except sometimes I get a messagebox as well as the exception box that says the memory could not be read, or something like that. Anyone have any clue what could be causing this? The file isn't readonly, it isn't opened in readonly mode, and it is finding the '(campaign name)' worksheet...
-
I've redesigned the control. I have four classes. ContainerButtonBar, ContainerButtonBarDesigner, ContainerButtonBarPage, and ContainerButtonBarPageDesigner. I have a property 'Pages' of type List<ContainerButtonBarPage> in ContainerButtonBar. I'm now getting the following error messages at design time after I try to add the control to the form. --------------------------- Microsoft Visual Studio --------------------------- Failed to create component 'ContainerButtonBar'. The error message follows: 'System.Runtime.Serialization.SerializationException: Type 'System.Windows.Forms.ContainerControl' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable. at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo() at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter) at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.Serialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter) at System.Runtime.Se...' --------------------------- OK --------------------------- --------------------------- Microsoft Visual Studio --------------------------- Code generation for property 'Pages' failed. Error was: 'Type 'System.Windows.Forms.ContainerControl' in Assembly 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.' --------------------------- OK --------------------------- Help! I don't know what to do... :confused: EDIT: I've taken off the inheritance to ContainerControl in the ContainerButtonBarPage class for now, and I get this exception on the form that i put the control on. Object of type 'aDeVIX.Irc.Presentation.ButtonBar.ContainerButtonBarPage[]' cannot be converted to type 'aDeVIX.Irc.Presentation.ButtonBar.ContainerButtonBarPage[]'. I assume this is because I don't have a TypeConverter... right? But that's a problem... cause I don't know how to make one work...
-
I want to make a control, mainly for options forms, that is like a tab control, but uses a different style 'page selector', which will be a button bar type of control. To be honest though, I'm not any good at control development, and I need to get this thing done asap... today if possible. First off, I've been working on the button bar part of it, but I don't know how to make the TypeConverter work properly, so I keep getting an exception of something like 'Can't convert ButtonBar.ButtonBarItems[] to ButtonBar.ButtonBarItems[]' or something like that. Any help there would be appreciated. I'll get the exact exception message for you later. Secondly, I know I need a designer to let me 'click' the buttons on the button bar at design time to switch between container controls. I don't know how to do this, but I'll do a little bit of reading. If you have any tips as far as that goes, it would be helpful. Thanks
-
Yeah, I agree. A menu *should* be a menu... whether it is a context menu, or part of a menu bar... but for now, you'll just have to do it in code or design time. Either way it isn't hard.
-
... You can send single bytes if you want. Show us your code.
-
Every time you start a new upload, just start it in a new thread. Dim UploadThread As New Thread(AddressOf UploadFile) UploadThread.Start() This should solve both of your problems. You might want to use delegates or something, depending on how it is built to be able to specify the file to upload, and where to upload it to. I don't have time to mess with the code otherwise I would download it and edit it for you.
-
As far as I know you will have to have a seperate menu. However, what you can do, is make the same method handle the click event for the menu items on both menus... Handles MenuItem1.Click, MenuItem2.Click
-
making sure a text box is same size as an A4 sheet
rot13 replied to fguihen's topic in Windows Forms
What is the width and height of an A4 paper? The best way I know to do this is with code similiar to the following: this.richtextbox.width = this.CreateGraphics.dpiX * <width_of_A4_in_inches>; this.richtextbox.height = this.CreateGraphics.dpiY * <height_of_A4_in_inches>; Where you need to put that code is determined by the program, and the form it's on and stuff. If it wont be resized, then you can just put that in the Form_Load method. -
What is the anchor property set to for the buttons?