Well I've copied some code lines so you can help me.
I've captured some windows for explain more detailly the problem.
The images are in the folder Webform at:
http://es.f1.pg.briefcase.yahoo.com/inigo_jimenez
The problem:
- From an ASP page I open a modal dialog (figure_A.JPG)
- If I click one of the buttons (the ! button) another window open so
I can choose one of the options (figure_B.JPG)
- When I've chosen one item, this window is closed and the datatable
is updated with a new row. The datagrid refresh automatically
(figure_C.JPG)
- I can insert a new row directly from the textbox that is down the
datagrid (figure_D.JPG)
- If I click on the button that is on the right of the textbox, the
datatable is updated with a new row and the datagrid is refreshed.
(figure_E.JPG).
Well, if this webpage is on a Windows 2000 server works fine but if
the same webpage is on a Windows 2003 server in Windows 2000 client
doesn't work but in Windows XP works fine. The problem is that the
data is inserted in the datatable but the datagrid doesn't refresh the
data.
What's Wrong?
Thanks in advance.
Here the code:
//----------------------------------------------------------------------
// THIS IS THE WEBPAGE HEADER
//----------------------------------------------------------------------
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="frmAnomalias.aspx.vb" Inherits="Anomalias.frmAnomalias"
smartNavigation="True" %>
//----------------------------------------------------------------------
// THIS IS THE WEBPAGE HEADER
//----------------------------------------------------------------------
<DIV id="div1" style="Z-INDEX: 109; LEFT: 14px; OVERFLOW: auto; WIDTH:
451px; POSITION: absolute; TOP: 95px; HEIGHT: 116px"
ms_positioning="GridLayout">
<asp:datagrid id="gridPdtes" style="Z-INDEX: 115; LEFT: 0px;
POSITION: absolute; TOP: 0px" runat="server" ForeColor="Navy"
Height="64px" Width="433px" BackColor="FloralWhite" BorderColor="Navy"
AutoGenerateColumns="False" Font-Size="8pt" Font-Names="Verdana">
<HeaderStyle Font-Size="10pt" Font-Names="Verdana" Font-Bold="True"
ForeColor="SteelBlue" BorderColor="White"
BackColor="Azure"></HeaderStyle>
<Columns>
<asp:TemplateColumn></asp:TemplateColumn>
<asp:BoundColumn DataField="Objeto"
HeaderText="Objeto"></asp:BoundColumn>
<asp:BoundColumn DataField="Descripcion"
HeaderText="Descripción"></asp:BoundColumn>
<asp:BoundColumn Visible="False" DataField="Index"
HeaderText="Index"></asp:BoundColumn>
</Columns>
</asp:datagrid>
</DIV>
//----------------------------------------------------------------------
// THIS IS THE CODE OF THE BUTTON THAT INSERTS NEW ROWS
//----------------------------------------------------------------------
Private Sub bAddTxt_Click(ByVal sender As System.Object, ByVal e As
System.Web.UI.ImageClickEventArgs) Handles bAddTxt.Click
If Me.txtAnomTxtLibre.Text <> "" Then
AgregarAnomTxtLibre(Me.txtAnomTxtLibre.Text)
Me.txtAnomTxtLibre.Text = ""
RellenarTablas()
End If
End Sub
//----------------------------------------------------------------------
// THIS IS THE CODE THAT USE A COMPONENT TO UPDATE/INSERT ROWS IN THE
// DATABASE
//----------------------------------------------------------------------
Public Sub AgregarAnomTxtLibre(ByVal txt As String)
SETSI_XFolder = New SETSI_Folders.SETSI_XFolders.SETSI_XFolder()
FolderBase = New IDESFOLDERLib.FdrClass()
XFolder = New IDESXLib.iDesX_XFolderClass()
XFolder = FolderBase.XNew(SessionPId, ArchAnomPId)
XFolder.SetFieldValue(SETSI_FLDID_ANOM_IDEXP, IdExp)
XFolder.SetFieldValue(SETSI_FLDID_ANOM_IDOBJ, IdObj)
If IdTipoObj = 0 Then
XFolder.SetFieldValue(SETSI_FLDID_ANOM_IDTIPOBJ, "Expediente")
Else
XFolder.SetFieldValue(SETSI_FLDID_ANOM_IDTIPOBJ,
ObjFunciones.DescripcionTipObj(IdTipoObj))
End If
XFolder.SetFieldValue(SETSI_FLDID_ANOM_SUBSAN, "N")
XFolder.SetFieldValue(SETSI_FLDID_ANOM_TEXTO, txt)
SETSI_XFolder.XFolder = XFolder
SETSI_XFolder.Flags = 0
SETSI_XFolders.Add(SETSI_XFolder)
SETSI_XFolder = Nothing
XFolder = Nothing
FolderBase = Nothing
End Sub
//----------------------------------------------------------------------
// THIS IS THE SUB THAT INITIALIZES THE DATATABLE OBJECT
//----------------------------------------------------------------------
Public Sub RellenarTablas()
Dim table As New DataTable()
Dim col As New DataColumn()
Dim row As DataRow
Dim txt As String
Dim objTxt As String
Dim chk As System.Web.UI.WebControls.CheckBox
Dim i As Integer
Dim TipoObjeto As Object
Dim IdTipoObjeto As Object
Dim IdObjeto As Object
Dim IdTipoAnomalia As Object
Dim TextoAnomalia As Object
Dim Subsanada As Object
col.ColumnName = "Objeto"
table.Columns.Add(col)
col = New DataColumn()
col.ColumnName = "Descripcion"
table.Columns.Add(col)
col = New DataColumn()
col.ColumnName = "Subsanada"
table.Columns.Add(col)
col = New DataColumn()
col.ColumnName = "Index"
table.Columns.Add(col)
For i = 0 To SETSI_XFolders.GetCount - 1
SETSI_XFolder = New
SETSI_Folders.SETSI_XFolders.SETSI_XFolder()
XFolder = New IDESXLib.iDesX_XFolderClass()
SETSI_XFolder = SETSI_XFolders.GetItem(i)
If SETSI_XFolder.Flags = 0 Or SETSI_XFolder.Flags = 2 Then
XFolder = SETSI_XFolder.XFolder
objTxt = XFolder.GetFieldValue(SETSI_FLDID_ANOM_IDTIPOBJ)
IdTipoObjeto = ObjFunciones.GetIdTipObj(CStr(objTxt))
IdObjeto = XFolder.GetFieldValue(SETSI_FLDID_ANOM_IDOBJ)
IdTipoAnomalia =
XFolder.GetFieldValue(SETSI_FLDID_ANOM_IDTIPOANOM)
TextoAnomalia =
XFolder.GetFieldValue(SETSI_FLDID_ANOM_TEXTO)
Subsanada = XFolder.GetFieldValue(SETSI_FLDID_ANOM_SUBSAN)
If IdTipoObjeto > 1 And IdTipoObj <> 4 Then
' Equipos o titulados
objTxt = objTxt & " - " &
ObjFunciones.DescripcionObj(ObjSession, SessionPId, IdTipoObjeto,
IdObjeto)
End If
If IsDBNull(IdTipoAnomalia) Then
txt = TextoAnomalia
Else
If IdTipoAnomalia = 0 Then
txt = TextoAnomalia
Else
RS = ObjSession.XDBSelect(SessionPId, "A" &
SETSI_ARCHID_TIPOS_ANOM & "SF", "FLD" & SETSI_FLDID_TIPOS_ANOM_VALOR,
"WHERE FDRID = " & IdTipoAnomalia, Found)
If Not RS Is Nothing And Found Then
RS.Item(1, txt)
End If
RS = Nothing
End If
End If
row = table.NewRow()
row.Item(0) = objTxt
row.Item(1) = txt
row.Item(2) = Subsanada
row.Item(3) = i
table.Rows.Add(row)
XFolder = Nothing
SETSI_XFolder = Nothing
End If
Next
CrearVistas(table)
AgregarCheckboxes()
DeshabilitarAutom()
End Sub
//----------------------------------------------------------------------
// THIS SUB BUILDS THE DATAVIEW ON THE DATATABLE OBJECT
//----------------------------------------------------------------------
Public Sub CrearVistas(ByVal table As DataTable)
Dim dv As DataView
If IdTipoObj > 1 Then
' Equipos y Titulados:
Me.gridPdtes.Columns(1).Visible = False
Me.gridSubs.Columns(1).Visible = False
End If
dv = New DataView(table, "Subsanada='N'", "",
DataViewRowState.CurrentRows)
Me.gridPdtes.DataSource = dv
Me.gridPdtes.DataBind()
dv = New DataView(table, "Subsanada='S'", "",
DataViewRowState.CurrentRows)
Me.gridSubs.DataSource = dv
Me.gridSubs.DataBind()
End Sub
//----------------------------------------------------------------------
// THIS SUB INSERT CHECKBOXES IN THE DATAGRID
//----------------------------------------------------------------------
Public Sub AgregarCheckboxes()
Dim i As Int16
Dim chk As System.Web.UI.WebControls.CheckBox
For i = 0 To Me.gridPdtes.Items.Count - 1
chk = New System.Web.UI.WebControls.CheckBox()
Me.gridPdtes.Items.Item(i).Cells(0).Controls.Add(chk)
Next
For i = 0 To Me.gridSubs.Items.Count - 1
chk = New System.Web.UI.WebControls.CheckBox()
Me.gridSubs.Items.Item(i).Cells(0).Controls.Add(chk)
Next
End Sub
//----------------------------------------------------------------------
// THIS SUB PUTS SOME CONTROLS DISABLED
//----------------------------------------------------------------------
Private Sub DeshabilitarAutom()
Dim m_Item As System.Web.UI.WebControls.DataGridItem
Dim Tipo As String
Dim Color As System.Drawing.Color
Color = Color.FromName("Snow")
For Each m_Item In Me.gridPdtes.Items
Tipo = m_Item.Cells(1).Text
If Tipo = "Automática" Then
m_Item.Enabled = False
'm_Item.BackColor = Color
End If
Next
End Sub