473,837 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Two Forms Datagrid Control Problems

I am having two issues with the Datagrid and I hope that someone can help me
out with them.

1) Printing.
I pulled the code for sending the control to a printer off the msdn site. It
works for the most part but will not print all the information contained in
the control. For example, If the datagrid contains enough rows that the
scroll bars become active and a user has to scroll down to display all the
data the controll will only print what is visible when the user clicks the
button that fires my print control. What I want to do is print the entire
contents of the control, even the rows that are not curently visible to the
user do to the size of the control. Does anyone know of a work around for

Here is the event code for my printdocument.p rintpage event:
Private Sub PrintDocument1_ PrintPage(ByVal sender As Object, ByVal e As
System.Drawing. Printing.PrintP ageEventArgs) Handles PrintDocument1. PrintPage

Dim PaintArgs As New PaintEventArgs( e.Graphics, New Rectangle(New
Point(0, 0), Me.Size))

Me.InvokePaint( dgChlorineRepor ts, PaintArgs)
End Sub

2) Datagrid data validation

I am trying to do some column data validation with the datagrid control.
Once again I pulled the code from the MSDN site. I setup the event handler
per msdn per code but when I run the code I get an error to the effect that
the object doesnt exist when I set up the addressof operator. Can you offer
me some insight as to why this is not working? Here is the code:

In my Form_load event, this is the line that causes the error:

AddHandler dsChlorineTankR ecords.Tables(" EmpoyeeID").Col umnChanging,
AddressOf EmployeeID_Colu mnChanging

This is the event:
Private Sub EmployeeID_Colu mnChanging(ByVa l sender As Object, _
ByVal e As System.Data.Dat aColumnChangeEv entArgs)

' check for errors in the EmployeeID column
' check the number against the global
' intEmployeeIDs array for a match

If (e.Column.Colum nName.Equals("E mployeeID")) Then
Dim i, j As Integer
j = 0
For i = 0 To UBound(intEmplo yeeIDs)
If CType(e.Propose dValue, Integer) = intEmployeeIDs( i) Then
j += 1
End If
' if j > 0 then we have a matching employee id
' in the database and the value can be accepted
' otherwise toss out a warning to the user
' and do not accept the data
If j = 0 Then
With e
.ProposedValue = "Bad Data"
.Row.RowError = "The employee id you entered does not
match with a valid pool maintenance employee."
.Row.SetColumnE rror(e.Column, "The employee ID " & _
CType(e.Propose dValue, Integer) & " does not match with
a valid pool maintenance employee")
End With
End If
End If
End Sub

Thanks in advance
Nov 21 '05 #1
0 1224

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

by: James Fortune | last post by:
I have a lot of respect for David Fenton and Allen Browne, but I don't understand why people who know how to write code to completely replace a front end do not write something that will automate the code that implements managing unbound controls on forms given the superior performance of unbound controls in a client/server environment. I can easily understand a newbie using bound controls or someone with a tight deadline. I guess I need...
by: Sanddevil | last post by:
Hi there - I hope someone out there can help me! I'm using a .Net DataGrid Class to show the results of a SQL query in a spreadsheet type control. The code, which works fine is: iRowCount = oleDbDataAdapter1->Fill(dataSet1); dataGrid1->DataSource = dataSet1->Tables->Item->DefaultView;
by: Joseph D. DeJohn | last post by:
I am trying to get pagination working on a datagrid. Can anyone point me to a resource for help on this? I'm not sure if custom paging is the best option or not.
by: optimizeit | last post by:
What I am attempting to do is import an Excel Workbook and display the worksheets in a datagrid dynamically. I am very close to getting this to work. I have to this point successfully imported a single worksheet into a dataset. I successfully built a dynamic datagrid. And I did successfully bind it to the dataset. Then I added the datagrid control to a PlaceHolder. The first worksheet displays beautifully. The next step is to allow...
by: Suzanne | last post by:
Hi all, I'm having problems with datagrids and the currentcellchanged event. My problem is this: I have a datagrid on a form, if the user changes the text in a cell on the datagrid then tries to close the form via a button on the toolbar (with going to another cell in the datagrid)I want to be able to popup a messagebox to the user asking them if they want to keep their changes. At the momment I'm accomplishing this by a property that...
by: Spam Trap | last post by:
I am getting strange resizing problems when using an inherited form. Controls are moving themselves seemingly randomly, but reproducibly. "frmBase" is my base class (a windows form), and contains a few controls anchored to the sides of the form. "frmChild" inherits from "frmBase"... and the controls appear on the inherited form as expected. However things start going wrong when I place addition controls on the "frmChild" form. When I...
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes get MyVarialble is not declared errors when the variable is quite clearly declared, when I change it to public and then back again to private the error goes away!!! Also I get lots of member not found errors, these however don't stop me from...
by: dbuchanan | last post by:
I have a Windows Forms application that accesses SQL Server 2k from a small local network. The application has been used for weeks on other systmes but a new install on a new machine retruns errors. The machine is a new laptop Windows XP Pro SP2 The machine is up to date with respect to the dot net framework. Details: Dot Net Framework ver. 1.0.3705 is installed Dot Net Framework ver. 1.1.4322 is installed
by: Frank | last post by:
Hello All, I ham using VS.NET 2003. Have followed instructions from http://gridviewguy.com/ArticleDetails.aspx?articleID=26 along with several other articles to no avail. I am pulling my hair out at this point. What I have is this : Members.aspx file:
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.