Jan 18, 2013, 7:54 AM
[CLOSED] GridPanel disappear code-behind
When I refresh gridpanel it will disappear
case 1: directclick refresh and wait around 1 second -> gridpanel is work fine
case 2: directclick refresh and wait less then 1 second -> gridpanel is disappear and never show again until refresh browser
I am using List Of <T> to fill in the Store and call gridpanel.Render
case 1: directclick refresh and wait around 1 second -> gridpanel is work fine
case 2: directclick refresh and wait less then 1 second -> gridpanel is disappear and never show again until refresh browser
I am using List Of <T> to fill in the Store and call gridpanel.Render
Public Sub FillLstOfDataToGridPanel(Of t)(ByVal objLstOf As List(Of t), Optional ByVal strShowHideColNameList As String = Nothing, Optional ByVal strIDProperty As String = Nothing, Optional blnTIsShowFIsHide As Boolean = False, Optional strColumnAlias As String = Nothing )
Dim objLstOfProp As List(Of clsNameAndProperty)
Dim objModel As New Ext.Net.Model
Dim objExtCol As Ext.Net.Column
Dim objExtDateCol As Ext.Net.DateColumn
Dim i As Integer
Dim blnShowIt As Boolean
Dim strSplit() As String
Dim strText As String
Dim strAlias() As String
If objLstOf.Count < 1 Then
mExtNetStore.Reader.Clear()
objModel.Fields.Clear()
mExtNetGridPanel.RemoveAllColumns()
Exit Sub
End If
objLstOfProp = getListOfProperty(objLstOf(0))
mExtNetStore.DataSource = objLstOf
mExtNetGridPanel.RemoveAllColumns()
objModel = FillLstOfObjectToModel(objLstOfProp, strIDProperty)
If mExtNetGridPanel.StoreID Is Nothing OrElse mExtNetGridPanel.StoreID.Trim = "" Then
mExtNetGridPanel.StoreID = mExtNetStore.ID
End If
strAlias = Split(strColumnAlias, ",")
strSplit = Split(strShowHideColNameList, ",")
For i = 0 To objLstOfProp.Count - 1
blnShowIt = False
If strShowHideColNameList Is Nothing OrElse strShowHideColNameList.Trim = "" Then
blnShowIt = True
Else
Dim query = From obj As String In strSplit Where obj = objLstOfProp(i).Name.Trim
If query.Count > 0 Then
If blnTIsShowFIsHide = True Then
blnShowIt = True
Else
blnShowIt = False
End If
End If
End If
Dim strPropertyName As String
strPropertyName = objLstOfProp(i).Name
strText = ""
If strColumnAlias Is Nothing OrElse strColumnAlias.Trim = "" Then
strText = strPropertyName
Else
strText = strPropertyName
Dim CheckEqu As Char() = New Char() {"="}
Dim AliasQuery = From objAlias As String In strAlias Where objAlias.Split("=")(0).Trim = strPropertyName.Trim
If AliasQuery.Count > 0 Then
For Each objResult In AliasQuery
strText = objResult.ToString.Split("=")(1)
Next
End If
End If
If blnShowIt = True Then
If objLstOfProp(i).ExtNetModelType = Ext.Net.ModelFieldType.Date Then
objExtDateCol = New Ext.Net.DateColumn
objExtDateCol.Text = strText ''objLstOfProp(i).Name
objExtDateCol.DataIndex = objLstOfProp(i).Name
objExtDateCol.Format = "yyyy/MM/dd"
mExtNetGridPanel.AddColumn(objExtDateCol)
Else
objExtCol = New Ext.Net.Column
objExtCol.Text = strText ''objLstOfProp(i).Name
objExtCol.DataIndex = objLstOfProp(i).Name
mExtNetGridPanel.AddColumn(objExtCol)
End If
End If
Next
mExtNetStore.Model.Clear()
mExtNetStore.Model.Add(objModel)
mExtNetStore.RebuildMeta()
mExtNetStore.DataBind()
mExtNetGridPanel.DataBind()
mExtNetGridPanel.Render()
End Sub
Last edited by Daniil; Jan 22, 2013 at 9:25 AM.
Reason: [CLOSED]