|
Bindows!
Interesting!
Thanks, squeek, I will study that.
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
Have a look at the MVVM pattern that is in common use in WPF coding. It's basic selling point is that it completely separates the UI from the business logic. You could re-code separate pieces of the app over time, with no change on the UI. This would allow your users to act as a last line of defense against UI-breakage ("Hey, after the last update, XYZ broke"). Then, when you're finished with this separation, your Web UI will be a mechanical process of coding UI's for each piece.
You said that the app is multithreaded. Does that imply that it is computationally intensive? All business logic will be centralized so your server will have to be beefy enough to deal with it.
Before .NET 4.0,
object Universe = NULL;
|
|
|
|
|
You have already received lot of nice replies. I hope mine too adds something. BTW I am a windows forms fan so I would avoid doing this.
1. Your application must be divided in to layers I suppose. So reuse existing code after refactoring.
2. Do not try and achieve similar experience in UI as in windows application. It will be tough to give similar experience.
3. If it is related to some business process, have a look into work flow as well.
4. Do not forget to rewrite what deserves to be rewritten.
5. You can use use WCF but do not think of replacing remoting with that, try and make it SOA compliant for in future, you do not need to worry much.
|
|
|
|
|
Thanks very much d@nish!
d@nish wrote: You can use use WCF but do not think of replacing remoting with that
It sounds like you have had a problem that leads you to this conclusion, am I right? My app is heavily using remoting. I was under the impression that WCF was supposed to do everything remoting does. Also, could you please expand the acronym, SOA, I'm not familiar with that.
When you mention "work flow", I assume you mean using visio or similar.
Again, thanks for taking the time to provide such a thorough reply.
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
Sorry for the late reply.
BobishKindaGuy wrote: It sounds like you have had a problem that leads you to this conclusion, am I right?
No. All I am saying it do not restrict it to remoting. If you rewrite things as a web service, your application will become network independent. You can then very well use it with clients in other technology as well.
BobishKindaGuy wrote: Also, could you please expand the acronym, SOA, I'm not familiar with that.
It is Service Oriented Architecture. Maybe a quick read on MSDN would help understanding.
BobishKindaGuy wrote: When you mention "work flow", I assume you mean using visio or similar.
With .Net 3.0 and above, we have Workflow Foundation. It suites if your application deals in business processes. Something like leave approvals where you have a series of dependent activities happening with human interventions here and there.
|
|
|
|
|
Thanks again, d@nish,
I have considered a webservice in the past, but to create a responsive interactive experience such as is possible with two-way remoting, would be difficult with a webservice, since the client would be "pinging" the webservice way too often. Or maybe others have achieved that... It certainly would simplify things though. Thanks for the clarifications on SOA and workflow foundation. I'll look into that.
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
I don't know much about your application nor will i read all those replies to see if my answer is already said,
but my answer would be a simple solution to work in between, you will have to write no code at all nor using any plugins to convert your solution, all you have to do is getting a server "PC with windows server will be enough" and a static IP and a webgate certificate from microsoft
then implement the TS service and webgate "Terminal services" then people can run your application from your website as a winform application on remote desktop, I tried this option with many of my applications and it worked like charm
|
|
|
|
|
Thanks very much, nazmolla,
Sounds interesting!
I have customers who have a workstation at work, and may also want to work from home. How do you see this implementation working for them?
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
Thanks for your interest,
for your customers the solution sure will work but you have to take into consideration the cost of the server and the TS webgate certificates, so if they only want to access their own workstations there are a couple more solutions they can do including using the teamviewer,
anyway you can try it without paying anything first by downloading a trial version of windows server 2008 R2 and implement the TS service and apply a temp certificate for free
and if it worked as you like then buy it
you can find detailed info about TS and remoteapp and their step by step implementation here
http://technet.microsoft.com/en-us/library/cc753844(WS.10).aspx[^]
|
|
|
|
|
Thanks,nazmolla.
Your suggestion is very useful, since it shows a way to work with the existing desktop application rather than rewriting it for the web.
This is not the direction I wanted to explore in the original question, but of course, sometimes we need to look at the bigger picture to evaluate what is the best direction.
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
You are most welcome, actually i till a month ago didn't even know about the TS and remoteapp till our VPN connection went down and our ERP stopped working "Microsoft Ax dynamics 2009" then someone at our ISP made this suggestion instead of us buying a new webportal module or an DIA connection with around a thousand dollars monthly to implement the TS for free, and when i read more i found it very useful and now i actually stopped all other VPN connections to our branches and started using this solution,
anyway, you are welcome and i am ready to help you if you needed anymore assistance with this regard
|
|
|
|
|
My thoughts, if you find them useful.
While the technical aspects are important, you also need to consider the business aspects. In general people pay less for things over the web, but you probably have access to more potential customers. So it depends on your market size, how large is your current customer base and does it have the potential to grow larger by going web.
If your market is a niche then it may be lttle point.
WinForms to Silverlight Experience
====================================
We have an airplane flight mapping WinForms app and have done a basic silverlight version. What we have learnt is that Bing maps can't handle the sheer number of points we would like to draw, so we often go into some kind of compromise, less frame per second etc. This is just an example of the broader point that for graphics intensive apps the desktop is a better performer.
The other thing we noticed is that it was much easier to make a series of silverlight app as seperate web pages to do only one or two functions from our WinForm app. When we tried to combine many functions together into one silverlight page then little things started happening like the datagrids started slowing down when scrolling. I think this was due to a few reasons, unoptimised code, inexperience with Xaml, extra code complexity, lack of maturity of silverlight tools and controls.
We still code in vs2008 and its xaml parsing is terrible,badly formed xaml can be hard to find. I assume its got better in vs2010, but i have heard bad reports of vs2010 and i await a service pack.
If you think it it going to take you 1 year to migrate then silverlight will be mature by then i would suspect. I have seen the silverlight related products mature even in the 12 motnhs we have used it.
If you do go the silverlight path I would choose one aspect of your app and move it first to silverlight as a test case. We are happy with the final result as the UI is much easier to use than our WinForms app and has all the deployment and update benefits you get from a web app.
|
|
|
|
|
Thanks, Tim! I do find your comments very useful, and I appreciate you taking the time to document your experiences with SL versus a desktop app. Others have mentioned SL as a way to go, and I am beginning to think that might be a big part of the answer.
I love your suggestion about using several smaller SL apps to get various bits of info for a page rather than one big fetch.
From what I've seen on myVBProf.com, Bill Burrows demonstrates that VS2010 is much improved for xaml stuff.
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
I am doing that with an application as we speak. It will take awhile. Web applications architecture is completely different. If your application is millions of lines of code and it took you 10 years to develop it will take you at-least that to convert it to a web application - if you can duplicate all of the functionality to start with.
Web development is cool, but very work-intensive. It's not WYSIWYG in the same way a Windows application is.
You're not talking conversion here, you're talking complete rewrite. Completely different programming model.
-Max
|
|
|
|
|
If you have a sound database think about using one of the good code generation tools. there are several good ones out there and will deliver professional looking sites with decent security models and n tier architectures. What ever you spend on a good tool will recoup it selve in learning and development times eg std code models the things like ajax several of the tools also have wyswig design features and work with visual studio and no propreitory coding or licensing.
I use Ironspeed enterprise editon www.ironspeed.com but there are several others check out things like lightspeed for another option
http://www.mindscape.co.nz/
You only have do add your proprietory logic which is usually a small proportion of your code. The major part is learning how to get the best out of the tools and all the options offered within It pays to down loat the demos and play and read the help the full versions are really powerful for the average developer needing to get a job done.
Gerard
Gerry
|
|
|
|
|
Thanks Gerard!
Yes, good suggestion to consider the code gen tools.
Your point about the business logic being smaller than all the plumbing code is very true.
If my attempts at following OO practices have been successful, it may be that I can pull the business logic out and replace the plumbing code with a tool. I'll consider that suggestion. Thanks for taking the time to share your experience with the community!
Bob
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
Evaluate Silverlight (V4). Might meet your requirements.
|
|
|
|
|
Thanks kofflerd,
I am beginning to think you are right.
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
if you think this is the direction you want to go this could be your development enviroment
Silverlight 4
Entity Framework (Model)
RIA/WCF enabled entities
MVVM Pattern
MVVM Light Toolkit
Managed Extensibility Framework (MEF)
Silverlight Toolkit
Telerik Silverlight Controls (if more powerfull controls are needed)
Visual Studio 2010
Expression Blend 4
Maybe the "out-of-browser" functionality could be interesting in your scenario also.
Daniel
|
|
|
|
|
I recomend you take a look at visual webgui. Im not a very experienced programmer, i previously wrote some code for various projects in visual basic, I tried to learn web based technologies includeing ASP.net php etc, but got frustrated with all of them. I have used visual webgui 6.4 now for a couple of months to create a web based data driven application. I have found that i can use the knowledge and undestanding i had of forms based development but create a very powerfull web based application, and still have the familliar visual studio development and debug experiance. I dont need to understand session states etc. The resultant application is very fast and bandwidth friendly and requires no client plugins. I looked at it in earlier versions and it still had issues that meant it wasn't ready for production application deployment. I can say that the number of issues now are small and most can be worked arround. the resultant application is very stable and easy to deploy. the forums are good and any questions get answered very quickly in my experience.
|
|
|
|
|
Thanks, Phil!
I will definitely look into that.
____________________________________________________________________________________
The Vulcan Science Directorate has determined that time travel is impossible.
|
|
|
|
|
I dont know if anyone has suggested this yet, but have you looked at the Csla[^] Framework?
You decouple the presentation from the Business layer and the DataLayer. There are heaps of examples, and the Author describes using a Windows UI, A WPF UI and also a Web Interface. You can even target mobile platforms.
I don't speak Idiot - please talk slowly and clearly
'This space for rent'
Driven to the arms of Heineken by the wife
|
|
|
|
|
Hi BobishKindaGuy,
What an excellent discussion you have set off, thanks. My personal opinion is that we are in a time of a great "flux" of technologies converging on bridging what have been the disparate worlds of "desktop applications" (control intensive, data intensive) and web-sites (content intensive, navigation intensive).
Having a substantial investment in C# and WinForms, I have of course considered moving to ASP.NET and its recent MVC MVVM flavours with Ajax : but when you look at what a dog Ajax turned out to be, and the current ubiquitous adoption of JavaScript libraries like jQuery by MS, I'm tempted to follow the lead of a world-class .NET developer I know and just "jump ship" for PhP, using jQuery for interface.
Of course I want the "deeper" graphics object/model of WPF, of course I want the more sophisticated event model of WPF, and the powerful binding concepts of WPF, but going back and forth between XAML and C# is, for me, a trip back to the stone age. But I also want to use the great 3rd. party WinForm controls I've invested in learning how to use well.
It says "acres" to me about SilverLight that on my .NET development machine here (Win Vista, using IE8) with all the latest updates installed for everything related to .NET, SilverLight, etc. that going to the myVBProf page you mention starts a full-screen SilverLight app which loads 100% but never plays with a JavaScript error:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.0.30729; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Thu, 29 Jul 2010 03:35:59 UTC
Message: '_gat' is undefined
Line: 113
Char: 9
Code: 0
URI: http://www.myvbprof.com/MainSite/index.aspx
imho it's far from clear that WPF and SilverLight are here for the "long run," and the upcoming HTML 5 standard, and possibly an "ex-Flash" era, coupled with the surge toward applications that can be viewed on small/mobile devices is going to change the game. I haven't yet really taken a look at Adobe's Air, and the current incarnations of DreamWeaver, etc., and how they play together with Flash.
All kinds of strange, mutant technologies are springing up trying to bridge web and desktop application paradigms ... Aptana Studio (Aptana ... okay, it's an IDE, not really that strange) and Alpha 5 (AlphaSoftware) come to mind) ... as well as what are, imho, "grandiose" attempts, like Titanium (Appcellerator), to cross not only platform boundaries, but device form-factor boundaries, also.
I'm waiting a while longer to decide which Web technology to invest in.
best, Bill
"Many : not conversant with mathematical studies, imagine that because it [the Analytical Engine] is to give results in numerical notation, its processes must consequently be arithmetical, numerical, rather than algebraical and analytical. This is an error. The engine can arrange and combine numerical quantities as if they were letters or any other general symbols; and it fact it might bring out its results in algebraical notation, were provisions made accordingly." Ada, Countess Lovelace, 1844
|
|
|
|
|
Silverlight and WCF would seem to be a natural fit.
/ravi
|
|
|
|
|
I believe that my questions are all going to revolve around the internal workings of DataGridView.
I've been trying to find a forum where I can get some interaction and help to move forward.
Microsoft's websites seem to be all questions and no answers.
I'm using VB.Net under Visual Studio 2005 SP2.
I need to have a DataColumn that is dynamically visible based on other data in the same DataRow.
After a lot of unsuccessful testing with various methods of accomplishing this, I came across the concept of Custom Cells/Columns.
I started with several slightly varying examples and everything seemed to be falling into place. I tried to research each property and attribute as I incrementally learned a lot about the internal workings of Windows controls in general and DataGridView in particular.
The confusing symptom is that as I scroll down through the grid, the painting of the custom cells is at best unreliable.
I created a minimum test case to eliminate as many variables as possible and I combined all of the source into one Form1.vb as follows:
Option Explicit On
Option Strict On
Public Class Form1
Public m_OrderDetails As Generic.List(Of OrderDetail)
Public m_dgv As New System.Windows.Forms.DataGridView
Public Enum GridViewColumnType
TextBox
InvisibleTextBox
End Enum
Public Sub New()
MyBase.New()
InitializeComponent()
' fake the usual load procedures with minimum so this screen can stand alone
m_OrderDetails = New Generic.List(Of OrderDetail)
Dim LineCounter As Int32 = 0
Dim ItemCounter As Int32 = 0
GenerateSetOfLines(LineCounter, ItemCounter, OrderDetail.ProductItemDealerSplitType.Percent)
GenerateSetOfLines(LineCounter, ItemCounter, OrderDetail.ProductItemDealerSplitType.ItemCodes)
GenerateSetOfLines(LineCounter, ItemCounter, OrderDetail.ProductItemDealerSplitType.Percent)
GenerateSetOfLines(LineCounter, ItemCounter, OrderDetail.ProductItemDealerSplitType.Dollars)
GenerateSetOfLines(LineCounter, ItemCounter, OrderDetail.ProductItemDealerSplitType.Percent)
GenerateSetOfLines(LineCounter, ItemCounter, OrderDetail.ProductItemDealerSplitType.ItemCodes)
GenerateSetOfLines(LineCounter, ItemCounter, OrderDetail.ProductItemDealerSplitType.Percent)
End Sub
Private Sub GenerateSetOfLines(ByRef linecount As Int32, ByRef itemcount As Int32, ByVal splittype As OrderDetail.ProductItemDealerSplitType)
itemcount += 1
linecount += 100
Dim od As New OrderDetail(linecount, "ITEM" & itemcount.ToString, splittype)
m_OrderDetails.Add(od)
linecount += 100
od = New OrderDetail(linecount, String.Empty, splittype)
m_OrderDetails.Add(od)
linecount += 100
od = New OrderDetail(linecount, String.Empty, splittype)
m_OrderDetails.Add(od)
End Sub
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.Size = New Size(350, 175)
With m_dgv
.Name = "DataGridView1"
.Location = New Point(0, 0)
.Dock = DockStyle.Fill
.AutoGenerateColumns = False
.AllowUserToAddRows = False
.AllowUserToDeleteRows = False
AddCol(m_dgv, "Line#", GridViewColumnType.TextBox, "DisplayLineNumberColumn", "DisplayLineNumber", True, DataGridViewContentAlignment.MiddleLeft, "00000")
AddCol(m_dgv, "Item", GridViewColumnType.TextBox, "ItemCodeColumn", "ItemCode", True, DataGridViewContentAlignment.MiddleLeft, "")
AddCol(m_dgv, "Split Type", GridViewColumnType.InvisibleTextBox, "SplitTypeColumn", "DealerSplitType", True, DataGridViewContentAlignment.MiddleLeft, "")
.DataSource = m_OrderDetails
End With
Me.Controls.Add(m_dgv)
m_dgv.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.DisplayedCells)
AddHandler m_dgv.CellFormatting, AddressOf DataGridView1_CellFormatting
End Sub
Private Sub AddCol(ByVal grid As DataGridView, ByVal headertext As String, ByVal columntype As GridViewColumnType, ByVal name As String, ByVal propertyname As String, ByVal protect As Boolean, ByVal align As Windows.Forms.DataGridViewContentAlignment, ByVal format As String)
Dim newcol As DataGridViewColumn
Select Case columntype
Case GridViewColumnType.InvisibleTextBox
newcol = New InvisibleTextBoxColumn
Case Else
newcol = New DataGridViewTextBoxColumn
End Select
newcol.Name = name
newcol.DataPropertyName = propertyname
newcol.HeaderText = headertext
newcol.ReadOnly = protect
newcol.DefaultCellStyle.Alignment = align
newcol.DefaultCellStyle.Format = format
grid.Columns.Add(newcol)
End Sub
Private Sub DataGridView1_CellFormatting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellFormattingEventArgs)
If e.ColumnIndex <> m_dgv.Columns.Item("SplitTypeColumn").Index Then
Exit Sub
End If
Dim invtextbox As InvisibleTextBoxCell = CType(m_dgv.Item(e.ColumnIndex, e.RowIndex), InvisibleTextBoxCell)
invtextbox.Invisible = (m_dgv.Item("ItemCodeColumn", e.RowIndex).Value.ToString = String.Empty)
Dim sb As New System.Text.StringBuilder
sb.Append("CellFormat: ")
sb.Append(m_dgv.Item("DisplayLineNumberColumn", e.RowIndex).Value.ToString)
sb.Append(" ")
sb.Append(m_dgv.Item("ItemCodeColumn", e.RowIndex).Value.ToString)
sb.Append(" ")
sb.Append(invtextbox.Instance.ToString)
sb.Append(" ")
sb.Append(invtextbox.Invisible.ToString)
Debug.Print(sb.ToString)
End Sub
End Class
Public Class OrderDetail
Private m_DisplayLineNumber As Int32
Private m_ItemCode As String
Private m_DealerSplitType As ProductItemDealerSplitType
Public Enum ProductItemDealerSplitType
Percent = 0
Dollars = 1
ItemCodes = 2
End Enum
Public Sub New(ByVal displaylinenumber As Int32, ByVal itemcode As String, ByVal dealersplittype As ProductItemDealerSplitType)
m_DisplayLineNumber = displaylinenumber
m_ItemCode = itemcode
m_DealerSplitType = dealersplittype
End Sub
Public ReadOnly Property DealerSplitType() As ProductItemDealerSplitType
Get
Return m_DealerSplitType
End Get
End Property
Public ReadOnly Property DisplayLineNumber() As Int32
Get
Return m_DisplayLineNumber
End Get
End Property
Public ReadOnly Property ItemCode() As String
Get
Return m_ItemCode
End Get
End Property
End Class
Public Class InvisibleTextBoxCell
Inherits Windows.Forms.DataGridViewTextBoxCell
Private InvisibleValue As Boolean
Private InstanceValue As Int32
Public Property Instance() As Int32
Get
Return Me.InstanceValue
End Get
Set(ByVal value As Int32)
Me.InstanceValue = value
End Set
End Property
Public Property Invisible() As Boolean
Get
Return Me.InvisibleValue
End Get
Set(ByVal value As Boolean)
Me.InvisibleValue = value
If Me.DataGridView IsNot Nothing Then
If Me.DataGridView.ReadOnly OrElse _
Me.DataGridView.Rows.Item(Me.RowIndex).ReadOnly OrElse _
Me.DataGridView.Columns.Item(Me.ColumnIndex).ReadOnly Then
Else
Me.ReadOnly = value
End If
End If
End Set
End Property
Public Overrides Function Clone() As Object
Dim Cell As InvisibleTextBoxCell = CType(MyBase.Clone(), InvisibleTextBoxCell)
Cell.Invisible = Me.Invisible
LastInstanceId += 1
Cell.Instance = LastInstanceId
Return Cell
End Function
Public Sub New()
MyBase.New()
Me.InvisibleValue = False
LastInstanceId += 1
Me.InstanceValue = LastInstanceId
End Sub
Protected Overrides Sub Paint(ByVal graphics As Drawing.Graphics, ByVal clipBounds As Drawing.Rectangle, ByVal cellBounds As Drawing.Rectangle, ByVal rowIndex As Integer, ByVal elementState As Windows.Forms.DataGridViewElementStates, ByVal value As Object, ByVal formattedValue As Object, ByVal errorText As String, ByVal cellStyle As Windows.Forms.DataGridViewCellStyle, ByVal advancedBorderStyle As Windows.Forms.DataGridViewAdvancedBorderStyle, ByVal paintParts As Windows.Forms.DataGridViewPaintParts)
Dim sb As New System.Text.StringBuilder
sb.Append("InvTxtPaint: ")
sb.Append(MyBase.DataGridView.Rows.Item(rowIndex).Cells.Item("DisplayLineNumberColumn").Value.ToString())
sb.Append(" ")
sb.Append(MyBase.DataGridView.Rows.Item(rowIndex).Cells.Item("ItemCodeColumn").Value.ToString())
sb.Append(" ")
sb.Append(Me.InstanceValue.ToString)
sb.Append(" ")
sb.Append(Me.InvisibleValue.ToString.ToUpper)
Debug.Print(sb.ToString)
If Me.InvisibleValue Then
' The textbox cell is invisible, so paint the border and background
' Draw the background of the cell, if specified.
If (paintParts And Windows.Forms.DataGridViewPaintParts.Background) = Windows.Forms.DataGridViewPaintParts.Background Then
Dim cellBackground As New Drawing.SolidBrush(cellStyle.BackColor)
graphics.FillRectangle(cellBackground, cellBounds)
cellBackground.Dispose()
End If
' Draw the cell borders, if specified.
If (paintParts And Windows.Forms.DataGridViewPaintParts.Border) = Windows.Forms.DataGridViewPaintParts.Border Then
PaintBorder(graphics, clipBounds, cellBounds, cellStyle, advancedBorderStyle)
End If
Else
' The textbox cell is not invisible, so let the base class handle the painting.
MyBase.Paint(graphics, clipBounds, cellBounds, rowIndex, elementState, value, formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts)
End If
End Sub
End Class
Public Class InvisibleTextBoxColumn
Inherits Windows.Forms.DataGridViewTextBoxColumn
Public Sub New()
Me.CellTemplate = New InvisibleTextBoxCell()
End Sub
End Class
The only other code is a Public variable called LastInstanceId in a module file so that I could generate an identifier for each created Custom Cell.
Structurally I am binding the grid to a Generic.List of Custom Business Objects. I believe there is enough evidence here that something very unusual is going on but I can't imagine what some of the answers might lead to.
As the form is first loaded, the grid appears entirely correct and the following Output messages are produced:
CellFormat: 100 ITEM1 3 False
InvTxtPaint: 100 ITEM1 3 FALSE
CellFormat: 200 7 True
InvTxtPaint: 200 5 FALSE
CellFormat: 300 9 True
InvTxtPaint: 300 5 FALSE
CellFormat: 400 ITEM2 11 False
InvTxtPaint: 400 ITEM2 5 FALSE
CellFormat: 500 13 True
InvTxtPaint: 500 5 FALSE
CellFormat: 600 15 True
InvTxtPaint: 600 5 FALSE
CellFormat: 100 ITEM1 3 False
InvTxtPaint: 100 ITEM1 3 FALSE
CellFormat: 200 7 True
InvTxtPaint: 200 7 TRUE
CellFormat: 300 9 True
InvTxtPaint: 300 9 TRUE
CellFormat: 400 ITEM2 11 False
InvTxtPaint: 400 ITEM2 11 FALSE
CellFormat: 500 13 True
InvTxtPaint: 500 13 TRUE
CellFormat: 600 15 True
InvTxtPaint: 600 15 TRUE
Scrolling down one line at a time works correctly but clicking below the scrollbar handle to cause an entire page at a time produces the following Output:
CellFormat: 600 15 True
InvTxtPaint: 600 15 TRUE
CellFormat: 700 ITEM3 17 False
InvTxtPaint: 700 ITEM3 5 FALSE
CellFormat: 800 19 True
InvTxtPaint: 800 5 FALSE
CellFormat: 900 21 True
InvTxtPaint: 900 5 FALSE
CellFormat: 1000 ITEM4 23 False
InvTxtPaint: 1000 ITEM4 5 FALSE
CellFormat: 1100 25 True
InvTxtPaint: 1100 5 FALSE
The InstanceId's and Invisible properties are totally out of control starting with line 700.
So, my questions go something like this:
Why does a Custom Cell have to have a Clone method at all and how is functionally used?
Why would there ever be 2 instances of the same Custom Cell at the same point in time?
Where are all of the 'missing' InstanceId's?
Why isn't the Paint method inside the Custom Cell class getting the same instance that was just immediately processed by the CellFormatting event?
When I intentionally avoid interacting directly with the form and I move some other window in front of it and away again, the resulting repaint is again entirely correct without any of the InstanceId 'problems'. Why?
When I decided to do this as a learning experience, I didn't know how much I was going to need to understand.
Then again, there could just be a bug somewhere in this code that I can't see because I have been looking at it for too long.
Thank you in advance for any insights and your time.
|
|
|
|
|