PC Review


Reply
Thread Tools Rate Thread

How can I get the following functionatilty in Windows Forms ?

 
 
=?Utf-8?B?QWw=?=
Guest
Posts: n/a
 
      1st Apr 2005
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.
 
Reply With Quote
 
 
 
 
Doug Bell
Guest
Posts: n/a
 
      4th Apr 2005
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" <(E-Mail Removed)> wrote in message
news:2806E9BC-ABAD-4551-B841-(E-Mail Removed)...
> 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.



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      4th Apr 2005
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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Layering in Windows Forms and Windows Forms for Heavy graphics vikash@nagarro.com Microsoft ADO .NET 1 28th Jun 2006 06:02 PM
Ordinary Windows Forms vs Win XP embedded Windows Forms Applicatio =?Utf-8?B?ZGVuIDIwMDU=?= Windows XP Embedded 1 6th Sep 2005 07:40 PM
How can I get the following functionatilty in Windows Forms ? =?Utf-8?B?QWw=?= Microsoft C# .NET 2 4th Apr 2005 08:35 AM
How can I get the following functionatilty in Windows Forms ? =?Utf-8?B?QWw=?= Microsoft Dot NET 2 4th Apr 2005 08:35 AM
Navigating embedded UserControl forms inside a Windows Forms Panel Emma Middlebrook Microsoft C# .NET 1 25th Oct 2004 02:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:27 PM.