Link to home
Start Free TrialLog in
Avatar of jbhtgh
jbhtgh

asked on

Infragistics dialog control not displaying when looping thru an excel spreadsheet

I am opening an excel worksheet and looping thru the rows,

based on values in certain cells, I would like the infragistics web dialog to display in a modal state, allow the app to gather information in the dialog, then save that information, make the dialog non modal and hide it, then continue scrolling thru the spreadsheet.

The problem is that the dialog will not display, and I just continue rolling thru the spreadsheet

 

The code I'm using follows

 


        'Item Record Information

        Dim lRow As Long
        Dim iCol As Integer

        Dim iInterfaceRecordID As Integer
        Dim iInterfaceFileRecordID As Integer
        Dim sSegSeq As String
        Dim sItemSequence As String
        Dim sItemDescription As String
        Dim sDataType As String
        Dim sMaxLength As String
        Dim sName As String
        Dim sItemComments As String


        ''     Dim sCurrentRecSeq As String

        For iCol = 9 To xlWorkSheet.Rows(1).cells.Count  ' Col 9 is where the list of receiving applications starts

            If Trim(xlWorkSheet.Rows(1).Cells(iCol).text) <> vbNullString Then   ' Do nothing if no receiving application.

                Session("currrentrecseq") = xlWorkSheet.Rows(2).Cells(2).text   ' Row 2 is where data starts, row 1 is header

                For lRow = 2 To xlWorkSheet.Rows.Count    ' read the worksheet row by row

                    If Session("currrentrecseq") <> xlWorkSheet.Rows(lRow).Cells(2).text.trim Then     ' Compare the values, if different enter if block
                        ' write interface file item record record

                        Session("currrentrecseq") = xlWorkSheet.Rows(lRow).Cells(2).text.trim              ' reset the sequence
                        wDialogRecord.Visible = True                ' set dialog to visible
                        wDialogRecord.Modal = True                 ' set dialog to Modal, also set in properties
                        wDialogRecord.WindowState = Infragistics.Web.UI.LayoutControls.DialogWindowState.Normal     ' set window state to normal so it will show

                        ' when dialog shows, user fills out information and hits save button, which set dialog visible property to false, modal to false, and dialog window state to hidden

                    End If

                    If Trim(xlWorkSheet.Rows(lRow).Cells(1).text) = vbNullString Then Exit For ' Jump loop on Blank, END              

                    If xlWorkSheet.Rows(lRow).Cells(iCol).text = "X" Then                          ' If this column has an "X", then we need to save this record

                        If xlWorkSheet.Rows(lRow).Cells(1).text <> vbNullString Then           ' to account for a skipped row, or invalid data          

                            iInterfaceRecordID = xlWorkSheet.Rows(lRow).Cells(1).text           ' read values from spreadsheet
                            sSegSeq = xlWorkSheet.Rows(lRow).Cells(2).text
                            sItemSequence = xlWorkSheet.Rows(lRow).Cells(3).text
                            sItemDescription = xlWorkSheet.Rows(lRow).Cells(4).text
                            sDataType = xlWorkSheet.Rows(lRow).Cells(5).text
                            sMaxLength = xlWorkSheet.Rows(lRow).Cells(6).text
                            sName = xlWorkSheet.Rows(lRow).Cells(7).text
                            sItemComments = xlWorkSheet.Rows(lRow).Cells(8).text

                           ' Write the Interface File Record Item
                            SaveInterfaceFileRecordItem(Int(wNumInterfaceID.Value), Int(wNumRecordID.Value), sItemSequence, sItemDescription, sDataType, sMaxLength, sName, 999, sItemComments)
                        End If

                    End If

                Next

            End If

        Next

        xlWorkBook.Close()

Is this too much to ask from this dialog control. I have a open support incident when them and they have said the code looks like it should work, but haven't given me an answer why not.


Avatar of derftoy
derftoy
Flag of United States of America image

try  wDialogRecord.Show()

You have to call the show method for the dialog to show up.
Avatar of jbhtgh
jbhtgh

ASKER

derftov,

thanks for the help, but in version 9.2 this control doesn't have a show method.
ASKER CERTIFIED SOLUTION
Avatar of derftoy
derftoy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jbhtgh

ASKER

No, the dialog is just on the form.

What I've noticed today is that after I loop thru the entire spreadsheet, and there is no code executing, the dialog will appear.

it's sort of like that it doesn't have time to display when I'm reading the spreadsheet

But needless to say, that isn't acceptable.

thanks,
Avatar of Nasir Razzaq
In winforms applications, we use Application.DoEvents function so that the application processes all its win messages (which include the updating of UI). In ASP.NET, this is not available. The problem i think is that the dialog is only displayed once the function completes executing and sends data back to the client.
Avatar of jbhtgh

ASKER

I think you nailed it codecruiser.

Excel makes no difference, I ge the same results when I try to do the same thing reading an array.

It is an extremely slow dialog to display also. if i just put the code to display it behind a button it takes 3 seconds.

I am working with Infragsitics support but they have been no help.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jbhtgh

ASKER

While I'm waiting to see what infragistics pulls out their butt, I am rearchitecting the application so I won't need the dialog.

Much heavier, but it's gotta work.

thanks
Avatar of jbhtgh

ASKER

The real answer seems to be that you can't do it. I awarded points on the effort.

thanks,