I can not find the problem out.
Hierarchical Grid, autogenerated column, datasource from my business object.
Here is the code
I have a simple button too, it is used to rebind grid with different values for the business object datasource (
For example:
at the beginning d1=today d2=dateadd("m",1,today) everything ok
I change d1 and d2, press reload button.
Mastertableaview is correct, show colums and data for the changed period, innerviews still shows old data BUT
tells me they are bound to the correct datasource (gives back coloumn count of new period).
So I first thought to an ajax problem. I removed all the ajax still does not work
Hierarchical Grid, autogenerated column, datasource from my business object.
Here is the code
<
telerik:RadGrid
ID
=
"RadGridTableau"
runat
=
"server"
GridLines
=
"Vertical"
AllowPaging
=
"true"
allowsorting
=
"true"
Skin
=
"Simple"
AllowFilteringByColumn
=
"False"
AutoGenerateColumns
=
"True"
PageSize
=
"10"
Width
=
"1500"
>
<
MasterTableView
NoMasterRecordsText
=
"Nessun Tableau presente."
GridLines
=
"Vertical"
AllowPaging
=
"true"
AllowFilteringByColumn
=
"False"
TableLayout
=
"Fixed"
Name
=
"TableauMain"
DataKeyNames
=
"idTypology"
>
<
DetailTables
>
<
telerik:GridTableView
DataKeyNames
=
"idRisorsa"
Name
=
"TableauDetail"
AutoGenerateColumns
=
"true"
>
<
Columns
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
enablePostBackOnRowClick
=
"true"
>
<
ClientEvents
OnRowContextMenu
=
"RowContextMenu"
></
ClientEvents
>
<
Selecting
AllowRowSelect
=
"True"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
Protected Sub RadGridTableau_DetailTableDataBind(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles RadGridTableau.DetailTableDataBind
Try
Dim dataItem As GridDataItem = CType(e.DetailTableView.ParentItem, GridDataItem)
Dim idTypology As String = dataItem.GetDataKeyValue("idTypology").ToString()
Dim d1 As Date = RadDatePicker_From.SelectedDate
Dim d2 As Date = RadDatePicker_To.SelectedDate
Dim polInterface As New POL_Manager.CPolInterface(myConn)
Dim myDatasource As DataSet = polInterface.StateResources(idTypology, d1, d2, AvailableState)
LogManager.WriteToDebugLog("c:\log\aa\", "RadGridTableau_DetailTableDataBind myDatasource.Tables(0).Columns.Count " & myDatasource.Tables(0).Columns.Count)
e.DetailTableView.DataSource = myDatasource
'e.DetailTableView.ShowHeader = False
Catch ex As Exception
Call LogManager.WriteToErrorLog(errorPath, ClassName, System.Reflection.MethodBase.GetCurrentMethod.Name.ToString(), ex, Err())
End Try
End Sub
I have a simple button too, it is used to rebind grid with different values for the business object datasource (
polInterface.StateResources(idTypology, d1, d2, AvailableState)
) d1 and d2 are here different then first time<
asp:Button
ID
=
"btnRebind"
runat
=
"server"
Text
=
"Reload"
/>
Protected Sub btnRebind_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRebind.Click
Try
RadGridTableau.Rebind()
For Each item As GridDataItem In RadGridTableau.MasterTableView.Items
For Each innerView As GridTableView In item.ChildItem.NestedTableViews
innerView.DataSource = Nothing
innerView.Rebind()
Next
Next
Catch ex As Exception
Call LogManager.WriteToErrorLog(errorPath, ClassName, System.Reflection.MethodBase.GetCurrentMethod.Name.ToString(), ex, Err)
End Try
End Sub
For example:
at the beginning d1=today d2=dateadd("m",1,today) everything ok
I change d1 and d2, press reload button.
RadGridTableau_DetailTableDataBind
is invoked.Mastertableaview is correct, show colums and data for the changed period, innerviews still shows old data BUT
myDatasource.Tables(0).Columns.Count)
tells me they are bound to the correct datasource (gives back coloumn count of new period).
So I first thought to an ajax problem. I removed all the ajax still does not work