473,387 Members | 3,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How can I get the following functionatilty in Windows Forms ?

Al
I have a useful framework, written in a different language (PowerBuilder),
which I'd like to replicate in .Net and Forms, but I'm unsure of how to
approach it, as the Event model is being used different between the
development environments.

Currently we have data entry screens, whose columns have been "wired" into a
class that performs checks on the entered data. As the user "leaves" a
column, the specific check / business rule is carried out. A lot of the
checks are common across all the screens and linking the column to the
specific method to be called is as easy a giving the column the appropriate
Name.

How can I create my own framework which would allow an easy method of
connecting / wiring the columns and the method checks together. I was
planning on using DataGrids, but can change that if I need to.
Nov 17 '05 #1
2 956
Hi Al,
I am not sure how complex your business rules are but you can use a
datagrid.
Build a Class that overrides methods of the DataGridTextBoxColumn

Example below was a test to see what I could do and needs to be built into a
more generic class where the style is passed to it as a parameter but it
makes the column readonly depending on the value in another column as well
as converting the displayed data into upper case.

I am not an expert and find this stuff fiddly and time consuming but it can
be done.

Public Class DacDGTextColLotNo

Inherits DataGridTextBoxColumn

Public Sub New()

MyBase.New()

Me.MappingName = MappingName

Me.Format = Format

Me.Alignment = Alignment

Me.Width = Width

Me.ReadOnly = [ReadOnly]

Me.HeaderText = HeaderText

Me.NullText = NullText

End Sub

Protected Overrides Function GetColumnValueAtRow _

(ByVal source As System.Windows.Forms.CurrencyManager, _

ByVal rowNum As Integer) As Object

Dim s As Object

Dim drv As DataRowView = CType([source].Current, DataRowView)

s = MyBase.GetColumnValueAtRow([source], rowNum)

If SetStyle = 1 Then

s = UCase(s)

'Set to Read Only if Column "LotFlg" (Commodity Flag) <> 2

Dim fReadOnly As Boolean

Try

fReadOnly = drv("LotFlg").ToString <> "2"

Catch

fReadOnly = True

End Try

Me.ReadOnly = fReadOnly

End If

Return s

End Function

Protected Overrides Sub SetColumnValueAtRow( _

ByVal source As System.Windows.Forms.CurrencyManager, _

ByVal rowNum As Integer, ByVal value As Object)

Value = UCase(value)

MyBase.SetColumnValueAtRow([source], rowNum, NValue)

End Sub

End Class
"Al" <Al@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
I have a useful framework, written in a different language (PowerBuilder),
which I'd like to replicate in .Net and Forms, but I'm unsure of how to
approach it, as the Event model is being used different between the
development environments.

Currently we have data entry screens, whose columns have been "wired" into a class that performs checks on the entered data. As the user "leaves" a
column, the specific check / business rule is carried out. A lot of the
checks are common across all the screens and linking the column to the
specific method to be called is as easy a giving the column the appropriate Name.

How can I create my own framework which would allow an easy method of
connecting / wiring the columns and the method checks together. I was
planning on using DataGrids, but can change that if I need to.

Nov 17 '05 #2
Al,

In my opinion is for that the validate event from every control.

As I understand your problem well, just by instancing it from a class and
let it go.
(typed in this message, watch typos)

\\\
Rules myRules = new Rules();
string ruleResult = myRules.MaxAmount((double) textBox1.text);
///
\\\
dim myRules as New Rules
dim ruleResult as String = myRules.MaxAmount(CDbl(textBox1.text))
///

I hope this helps,

Cor

Nov 17 '05 #3

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

Similar topics

2
by: Al | last post by:
I have a useful framework, written in a different language (PowerBuilder), which I'd like to replicate in .Net and Forms, but I'm unsure of how to approach it, as the Event model is being used...
15
by: Wiktor Zychla | last post by:
today we've found a critical issue regarding the ListView from Windows.Forms. it was confirmed on several machines with Win2K and XP. here's the problem: create a ListView with about 50000 rows....
5
by: david | last post by:
I have developed my web service with a domain name of my computer name and wwwroot directory. I also developed a client of windows form application. It works locally (i.e. in the same machine). ...
16
by: NetPointer | last post by:
How to convert following in to VB.NET ??? specifically the constant...es_number. const int ES_NUMBER = 0x2000; protected override System.Windows.Forms.CreateParams CreateParams { get {...
9
by: Günther Rühmann | last post by:
Hi, I´m not sure if i´m right int this group... My problem: I made a vb .net application that reads from AD via System.Directoryservices.Directoryentry. The appliocation enumerates group...
2
by: Just Me | last post by:
Anyone know what could cause the following error messages? Note the versions are: A...B B...A Warning: The dependency 'LibraryCs, Version=1.0.1916.39646, Culture=neutral' in project 'CAG...
0
by: gxl034000 | last post by:
Hi, I have been trying to use a .net Forms control in my webpage to open up an application(notepad) on the client. The control works fine when embedded in a windows form, but I keep getting a...
0
by: Budhi Saputra Prasetya | last post by:
Hi, I still have the same problem with embedding Windows Control. I'll just requote what I posted last time: I managed to create a Windows Form Control and put it on my ASP .NET page. I...
1
by: mfunkmann | last post by:
Hi, I recently got an error and I don't know how to fix it: Error 1 'System.Data.DataColumn' does not contain a definition for 'Windows' C:\c#\CsharpPRO\Form1.Designer.cs 304 77 CsharpPRO I...
21
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...

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.