Jump to content
Xtreme .Net Talk

rot13

Avatar/Signature
  • Posts

    53
  • Joined

  • Last visited

Everything posted by rot13

  1. Anyone have any ideas on this one? I'm still struggling with it.
  2. 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?
  3. 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.
  4. 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?
  5. 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
  6. 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...
  7. 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...
  8. 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
  9. 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.
  10. ... You can send single bytes if you want. Show us your code.
  11. 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.
  12. 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
  13. 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.
  14. What is the anchor property set to for the buttons?
  15. ok, I will try this as soon as I get to that computer.
  16. You just put it on the cd, and double click the .exe! That's the cool part about .NET :) Just copy everything in your C:\My\Project\bin\ folder to the cd, and then access the cd and double click the .exe. Simple as that afaik
  17. I have fixed the spelling errors and the exception is still thrown. I'm sure it's just the SQL statement is not set up right. I'll explain what I'm doing now that I have time. I am making a shipping program for my parents machine shop. When a new product order (P.O.) comes in, the secretary enters in all of the line items on that P.O. into the program. When we ship parts, she finds the order on the 'Pending Sales' grid control and adds a shipment to it. It can be a partial shipment, which is why I have the WHEN part of it like it is, to make sure it still shows up until the QuantityComplete is >= Quantity (on order) I have a ProductsOrder table, a Parts table, a LineItems table, and a Customer table (I have more, but those are the only relevant ones) The LineItems table has a relationship to 'Customers', 'Parts', and 'ProductOrders' tables. The following is how the grid is setup, and what info needs to be pulled for the the columns: | Part Number | Customer | Description | Quantity | Due Date | and the fields are | Parts.PartID | Customers.CustomerID | Parts.Description | LineItems.Quantity | LineItems.DueDate | Thanks in advance for any help. I hope this was clear, I just typed it out real quick.
  18. Heh... quantity is spelled wrong... I'm such an idiot. :P thx
  19. "No value given for one or more required parameters." This is the error I get on the .Fill line of this code. 'Select Command Dim txtSelectCommand As String txtSelectCommand = "SELECT Customers.CustomerID, Parts.PartID, Parts.Description, " & _ "LineItems.Quanity, LineItems.QuantityComplete, " & _ "LineItems.DueDate FROM Customers, Parts, " & _ "LineItems WHERE LineItems.QuantityComplete < LineItems.Quanity" 'Set connection and create DataAdapter and DataSet Dim dbConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=""Manufacturing Manager.mdb""") Dim daPendingSales As New OleDbDataAdapter(txtSelectCommand, dbConnection) Dim dsPendingSales As New DataSet("dsPendingSales") 'Fill the DataSet daPendingSales.Fill(dsPendingSales) 'Set the grids DataBinding Me.gridPendingSales.SetDataBinding(dsPendingSales, "ProductOrders") Me.gridPendingSales.RetrieveStructure(True) Me.gridPendingSales.Refetch() 'Close Connection dbConnection.Close() Any idea what is wrong? I'm in a hurry to go somewhere right now... be back in an hour or two... I'll explain more then if needed... later
  20. The very reason .NET 2.0 is better than 1.1. :cool:
  21. Implement IEnumerator(Of Char) Look in the base types of a class such as CharEnumerator in the object browser and you will see. Works on .NET 2.0 anyways...
  22. Why do you use With/End With for .Filter? :confused: thanks
  23. I got together with another developer after I tried to figure this stuff out, and neither one of us can figure out UPDATE and DELETE commands... I am using an Access database, and I have a BindingSource, then a DataSet, and a TableAdapter. I opened up the DataSet designer and tried editing the commands, but I just can't get them to work... it's been a frustrating couple of hours... I keep getting exceptions like "Paramater not provided for one or more required paramaters" or w/e... that's basically what it means... and I don't get how to fix it... everything *looks* right... to me. Does anybody know of a step by step tutorial for this, or does anyone have any advice or help? Thanks
×
×
  • Create New...