Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
98 views
I understand why this is happening, but I'm not sure the best way to handle it.  The postback created when a RadDock is drag & dropped, closed, minimized, etc. is returning the HTML and overwriting the data bound RadGrids that are in the RadDocks within the RadDockZone that the RadDock is in.  I don't want to requery the the web methods to repopulate the grids (kinda defeats the benefit of client-side data binding).

I have AutoPostBack enabled on the docks because I want to continuously persist the position/state of the docks.  Is there anyway I can update the state of the docks via AJAX without doing a partial postback that overwrites my grid data (maybe by calling a WebMethod)?  If so, how?

I've created a simple example page that demonstrates this issue (most controls are dynamically created because this is how the real application is).

Thanks!

*.aspx.vb
Imports Telerik.Web.UI
Imports System.Web.UI.WebControls
Partial Class DockClientDataBoundRadGrid
    Inherits System.Web.UI.Page
    Private _DockDataTable As System.Data.DataTable
 
    Protected Sub RadDockLayout1_LoadDockLayout(ByVal sender As Object, ByVal e As Telerik.Web.UI.DockLayoutEventArgs) Handles RadDockLayout1.LoadDockLayout
        Dim zones(1) As RadDockZone
        Dim zone As RadDockZone
        For i As Integer = 0 To zones.Length - 1
            zone = New RadDockZone
            zone.Orientation = Orientation.Vertical
            zone.ID = "RadDockZone" & i
            zones(i) = zone
        Next
 
        RadDockLayout1.Controls.Add(CreateDockContainer(zones))
 
        For Each zone In zones
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(zone, zone)
        Next
 
        Dim docks(DockDataTable.Rows.Count - 1) As RadDock
        Dim dock As RadDock
        Dim rowCount As Integer = 0
        For Each row As System.Data.DataRow In DockDataTable.Rows
            dock = New RadDock
            dock.AutoPostBack = True
            dock.DockMode = DockMode.Docked
            dock.UniqueName = "dock-" & rowCount
            dock.Title = row.Item("title")
 
            Dim _RadGrid As RadGrid = CreateRadGrid("RadGrid-" & rowCount)
            dock.ContentContainer.Controls.Add(_RadGrid)
 
            RadDockLayout1.Controls.Add(dock)
            docks(rowCount) = dock
            rowCount += 1
 
            RadAjaxManager1.AjaxSettings.AddAjaxSetting(dock.ContentContainer, dock.ContentContainer)
        Next
 
        Dim lastZoneId As Integer = 0
        For Each dock In docks
            If zones.Length <= lastZoneId Then lastZoneId = 0
            zone = zones(lastZoneId)
            e.Indices(dock.UniqueName) = zone.Docks.Count
            e.Positions(dock.UniqueName) = zone.ID
            lastZoneId += 1
        Next
    End Sub
 
    Private Function CreateRadGrid(ByVal ControlID As String) As RadGrid
        Dim _RadGrid As New RadGrid
        _RadGrid.ID = ControlID
        _RadGrid.ClientSettings.ClientEvents.OnCommand = "RadGrid1_DataBinding"
        _RadGrid.ClientSettings.DataBinding.Location = "~/DockClientDataBoundRadGrid.aspx"
        _RadGrid.ClientSettings.DataBinding.SelectMethod = "GetData"
        _RadGrid.ClientSettings.DataBinding.SelectCountMethod = "GetDataCount"
        _RadGrid.ClientSettings.DataBinding.StartRowIndexParameterName = "startRowIndex"
        _RadGrid.ClientSettings.DataBinding.MaximumRowsParameterName = "maxRows"
        _RadGrid.ClientSettings.DataBinding.EnableCaching = True
        _RadGrid.PageSize = 10
 
        Dim c1 As New GridBoundColumn
        c1.HeaderText = "Name"
        c1.SortExpression = "Name"
        c1.DataField = "Name"
        c1.UniqueName = "Name"
        c1.DataType = System.Type.GetType("System.String")
 
        _RadGrid.MasterTableView.Columns.Add(c1)
        Return _RadGrid
    End Function
 
    Protected Function CreateDockContainer(ByRef zones As Telerik.Web.UI.RadDockZone()) As System.Web.UI.WebControls.WebControl
        Dim tbl As System.Web.UI.WebControls.Table = New System.Web.UI.WebControls.Table
        tbl.ID = "tblDockContainer"
        tbl.Style.Add("width", "100%")
 
        Dim row As System.Web.UI.WebControls.TableRow = New System.Web.UI.WebControls.TableRow
        Dim cell As System.Web.UI.WebControls.TableCell
        tbl.Rows.Add(row)
 
        Dim colSize As String = Math.Floor(100 / zones.Length).ToString() & "%"
        For Each zone As Telerik.Web.UI.RadDockZone In zones
            cell = New System.Web.UI.WebControls.TableCell
            cell.VerticalAlign = VerticalAlign.Top
            cell.Controls.Add(zone)
            cell.Style.Add("width", colSize)
            row.Cells.Add(cell)
        Next
 
        Return tbl
    End Function
 
    Protected ReadOnly Property DockDataTable() As System.Data.DataTable
        Get
            If _DockDataTable Is Nothing Then
                _DockDataTable = New System.Data.DataTable
                _DockDataTable.Columns.Add(New System.Data.DataColumn("title", System.Type.GetType("System.String")))
 
                Dim row As System.Data.DataRow
                For i As Integer = 0 To 5
                    row = _DockDataTable.NewRow
                    row("title") = "Dock Title " & i
                    _DockDataTable.Rows.Add(row)
                Next
 
                _DockDataTable.AcceptChanges()
            End If
            Return _DockDataTable
        End Get
    End Property
 
    <System.Web.Services.WebMethod()> _
    Public Shared Function GetData(ByVal startRowIndex As Integer, ByVal maxRows As Integer) As IEnumerable
        Dim list As New Generic.List(Of Entity)
        For i As Integer = startRowIndex To maxRows
            Dim e As New Entity
            e.Name = "Entity " & i
            list.Add(e)
        Next
 
        Return list
    End Function
 
    <System.Web.Services.WebMethod()> _
    Public Shared Function GetDataCount() As Integer
        Return 51
    End Function
 
    Public Class Entity
        Public Name As String
    End Class
End Class

*.aspx
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DockClientDataBoundRadGrid.aspx.vb" Inherits="DockClientDataBoundRadGrid" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
<telerik:RadDockLayout ID="RadDockLayout1" runat="server"></telerik:RadDockLayout>
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function RadGrid1_DataBinding(sender, args) {}   
    </script>
</telerik:RadScriptBlock>
</form>
</body>
</html>
Josh
Top achievements
Rank 1
 answered on 26 Aug 2011
0 answers
497 views
Hi,
I've been searching the forums and it looks like this is a common problem. Unfortunately, I cannot find a solution, partly because many of these issues were solved with support tickets, but the forum posts never got the details of the fix.

Can you please give me steps to take to troubleshoot it? What should I be looking at? Because of the time involved to strip the project down, I'd rather not submit my project, just looking for the general direction I should take in my troubleshooting.

Related threads: http://www.telerik.com/community/forums/aspnet-ajax/scheduler/radgrid-inside-scheduler-advanced-edit-insert-form.aspx
AND: http://www.telerik.com/community/forums/aspnet-ajax/scheduler/script-control-radajaxmanager1-is-not-a-registered-script-control.aspx

Thanks in advance,
Dan

<edit>
OK, so I have a RadWindowManager in 2 UserControls that are included in my advanced form. I made it past this error, I set each RadWindowManager and each RadWindow to RegisterWithScriptManager="false".

Unfortunately this brought me to the following error if I trigger an action that should show the RadWindow from the User Control: "Multiple controls with the same ID 'RadWindowManager3_alerttemplate' were found..."

I have everything ajaxified. Googling this error tells me that it is probably because my usercontrol is getting added dynamically more than once. How do I fix this?

Thanks,
Dan

</edit>

<edit2>
Hi, I'm preparing to submit a support ticket.
</edit2>
Dan Lehmann
Top achievements
Rank 1
 asked on 26 Aug 2011
2 answers
156 views
Hi Telerik Team,

I am currently using a telerik:RadButton and encountering some cross-browser issues with Chrome. Please see the screenshot for a better view of the problem.

I've also provided a code snippet of the solution :
<%--Component--%>
<td style="width: 192px;">
<table cellpadding="0" cellspacing="0" width="100%">
    <tr>
        <td>
            <telerik:RadButton ID="chkBoxComponent" runat="server" ToggleType="CheckBox" ButtonType="StandardButton"
                SkinID="filterCheckBox" AutoPostBack="false">
                <ToggleStates>
                    <telerik:RadButtonToggleState Text="Exclude Components Filter" PrimaryIconCssClass="rbToggleCheckboxChecked" />
                    <telerik:RadButtonToggleState Text="Include Components Filter" PrimaryIconCssClass="rbToggleCheckbox" />
                </ToggleStates>
            </telerik:RadButton>
        </td>
    </tr>
    <tr>
        <td>
            <asp:ListBox ID="listBoxComponent" SkinID="listboxFilter" runat="server"></asp:ListBox>
        </td>
    </tr>
</table>
</td>


I have also debugged it by using Chrome's Inspect Element feature and found that the following css class is causing the issue. The problem is that if I make any alterations to it, other rad controls will not display properly as I believe it's a key class to all the Rad Controls.

.rbSkinnedButton {
padding-right: 2px;
}


Any suggestions?
Thanks

Regards,
Navnit
Navnit
Top achievements
Rank 2
 answered on 26 Aug 2011
10 answers
373 views
Hi,
   We are looking for a flexable controls for asp.net, and we found the Telerik RadControls!
It's so amazing and we all love it!
   The only one thing that we worry abount is the size( >16MB)!!
   For example,If we just use a ComboBox control of Telerik RadControls in a page, we need to load the Telerik.Web.UI.dll to the memory first?
   And if that's yes, int that case thousands of users visit the page in the same time, our server can take it?
   In a word , is the Telerik RadControls work well in the distributed application?
  I'm looking forward to your reply.
Thanks!
Gimmik
Top achievements
Rank 1
 answered on 26 Aug 2011
7 answers
78 views
Hi Telerik Team,


 Its been a great Pleasure to Work with u r Telerik Controls.i have been using Telerik Controls from past one year and i feel so comfortable with u r controls.Thanks for that

My issue here is that When i'm trying to hide a EditcommandColumn through Code behind, its changing the Alignments  of the other columns..can u please help me in this issue

Code i used in Item Data bound Event
 if (e.Item is GridEditableItem && !(e.Item.IsInEditMode))
 {
            GridDataItem dataItem = e.Item as GridDataItem;
            dataItem["EditColumn"].Visible = false;
 }


Thanks,
Vijay
Pavlina
Telerik team
 answered on 26 Aug 2011
4 answers
197 views
I have tried searching through threads for 20 minutes on how to use the new FilterTemplate functionality of the RadGrid to apply google type filters to my columns, but can't find anything.

Is there any working example of the google type filtering using the FilterTemplate ?

I would prefer this as my Grid has several non text columns that the google filter does not really apply to, and we would like to use normal filter functionality for that, but wire up the google suggest type for the text fields.

Also to create the grid declaratively with sqldatasource is big bonus.

Any help?
Pavlina
Telerik team
 answered on 26 Aug 2011
3 answers
96 views
I had copied the code for enabling google like filter from this URL Google Like Filter Demo
it works fine it we didn't specified any Data bound column in Design time. My requirement is i have Design time Bound Column's and i am binding data to Grid. When i tried to implement Google like filtering its not working as i want. Please have a look on JPG image attached to this post.

red crossed filter is not required
green color filter which i am generating using overriding template column

its creating extra columns in grid for goolge like filtering. Its not overriding existing filter column
Pavlina
Telerik team
 answered on 26 Aug 2011
5 answers
203 views
Hello,

I would like to know if ASP.NET Ajax Q1 2011 has still the Visual Studio 2005 support? Or it has been dropped?

On my Windows, Visual Studio 2005 and SQL Server 2005 are installed, with Framework .NET 2.0.
I wanted to install this new Q1 2011 and what was my surprise that the installer requieres the Framework .NET 3.5 or 4 to be running.

If Q1 2011 has still Visual Studio 2005 support, what to do to install it without installing the Framework .NET 3.5 or 4?

Thank your for your answer,
Alain
Erjan Gavalji
Telerik team
 answered on 26 Aug 2011
2 answers
200 views
I want to try and use a list of objects as my data source where the object contains multiple fields and I am populating the listbox programmatically.  If I set the Datasource of my list box to the object how can I set what fields actually show up in the listbox I tried using templates but I couldn't get that to work.

List<Keyword> resultList = keywordService.FindKeywords();
            canonicalSearchResults.DataSource = resultList;
            canonicalSearchResults.DataBind();

I want the Keyword's name field to appear in the textbox but be able to keep the datasource as a list of keywords so that I can later access them. Right now it calls the tostring method and displays the result but the toString method is different than what I want displayed
ted
Top achievements
Rank 1
 answered on 26 Aug 2011
1 answer
1.1K+ views

Hello Telerik,
We are encountering an error that is very perplexing.
we found how to correct this,
if you would indicate why this fix works.  This was extremely hard to
find.  Is there a best practice as to how this section should be formatted in web config going forward...to avoid this.

Removing this block bypasses the error below, but it has to do with - Telerik.Web.UI.Skins.Web20.Grid.Web20.css:

<

 

 

telerik:RadStyleSheetManager ID="RadStyleSheetManagerPrePaidSettlements" runat="server">

 

 

 

<StyleSheets>

 

 

 

<telerik:StyleSheetReference Name="Telerik.Web.UI.Skins.Web20.Grid.Web20.css" Assembly="Telerik.Web.UI" />

 

 

 

</StyleSheets>

 

 

 

</telerik:RadStyleSheetManager>


in the web config.....to fix
move this entry below after the 2nd verb entry and the error noted will be gone.

 

<

 

 

add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>

 

 

 

 



<

 

 

httpHandlers>

 

<

 

 

remove verb="*" path="*.asmx"/>

 

<

 

 

add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

 

--place here..
<

 

 

add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

 

<

 

 

add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>

 

<

 

 

add path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" validate="false"/>

 

<

 

 

add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false"/>

 

<

 

 

add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false"/>

 

<

 

 

add path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" validate="false"/>

 

<

 

 

add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>

 

<

 

 

add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/>

 

</

 

 

httpHandlers>

 




System.IO.FileLoadException: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName)
   at Telerik.Web.UI.WebResource.Exists(HttpContext context, String path, String applicationPath)
   at Telerik.Web.UI.RadStyleSheetManager.OnPreRender(EventArgs e)
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Control.PreRenderRecursiveInternal()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Simon
Telerik team
 answered on 26 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?