Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
809 views

Hi,
I have a grid like following.....I have given only 1 column but there are 10 similar columns which comes from DB..similar in the sense it is rendered similar way this one column is shown below.
ASPX page.

 

 

<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="true" Width="1080px" AutoGenerateColumns="false" GridLines="Both" Skin="XYZ" EnableEmbeddedSkins="false">

 

 

 

<MasterTableView Width="1063px" TableLayout="Fixed" ItemStyle-Font-Names="Arial" ItemStyle-Font-Size="11px" AlternatingItemStyle-Font-Size="11px" AlternatingItemStyle-Font-Names="Arial" HeaderStyle-Font-Names="Arial" HeaderStyle-Font-Size="11px" CommandItemDisplay="None">
<Columns>
<telerik:GridTemplateColumn HeaderText="Name" HeaderStyle-HorizontalAlign="Center" HeaderStyle-CssClass="rgcItemName" ItemStyle-CssClass="rgcItemName">

 

 

 

<ItemTemplate> <%#Container.DataItem("name").ToString%> </ItemTemplate> </telerik:GridTemplateColumn>

 

 

 

</Columns>

 

 

 

 

</MasterTableView>

 

 

 

<ClientSettings><Scrolling AllowScroll="true" UseStaticHeaders="true" /></ClientSettings>

 

</telerik:RadGrid>

 

 

 

</telerik:RadAjaxPanel>

 

VB Page

 

Protected Sub RadGrid1_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource

 

GetData()

 

End Sub

 

 

 

 

 

Protected

 

Function GetData() As Object

 

 

 

Dim table2 As New DataTable()

 

 

Dim XYZSql As String

 

 

 

XYZSql = ""

 

 

 

Dim XYZComm As New OracleCommand

 

 

Dim XYZConn As New OracleConnection(SQLConnStr)

 

 

Dim adapter As OracleDataAdapter = New OracleDataAdapter

 

adapter.SelectCommand =

New OracleCommand(XYZSql, XYZConn)

 

XYZConn.Open()

 

Try

 

 

 

adapter.Fill(table2)

 

RadGrid1.DataSource = table2

 

Catch ex As Exception

 

---

 

 

 

 

Finally

 

 

 

XYZConn.Close()

 

XYZConn.Dispose()

OracleConnection.ClearPool(XYZConn)

 

End Try

 

 

Return table2

 

 

End Function

 

 

 

On my Page Init Event all i am doing is RadGrid1.DataSource = Nothing like below code snippet shows. I am not calling Radgrid.ReBind(). But the Data still rebinds.

 

 

 

 

 

Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init

 

 

RadGrid1.DataSource = Nothing

 

End

 

Sub

 

WORKING CASE: Everything works fine so far...grid binds and sorts perfectly......

 

HOWEVER CASE: If i put Radgrid1.Rebind() after RadGrid1.DataSource = Nothing my grid does not sort in proper manner. If try to sort Col 1, col 3 sorts or col 2 sorts. I have no sorting event  other than AllowSorting=True in the aspx page. I absolutely dont have any columns to not be visible. Why Does it not sort well if i have Rebind() method called in Page Init.
I happen to read this topic in the link given below.....
http://www.telerik.com/help/aspnet/grid/grdcommandsthatinvokerebindimplicitly.html


Does NeedDataSource implicitly call Rebind method and sort the grid in WORKING CASE. Where does it store the data and binds it to the grid every time i sort the grid. Does it store in Hard Disc memory? If you are going to give me a link for sorting will it have an answer to the Question i just asked about where does it store the data to bind the grid again and again for each sorting. WORKING CASE does not have a direct call to Rebind.

In my HOWEVER CASE I am making an explicit call to Rebind(). Is it messing up the automatic sorting and the grid does not sort well?

References for Radgrid in Master page looks like.....
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

</telerik:RadAjaxManager>

 

Your answer will help me greatly
Vidya

Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2011
3 answers
71 views
I am trying to display a grid with 3 columns. 2 of the columns are updateable. The problem I am having is when the client does a batch update, I dont want to update every record from the grid to the database. I only want to process just the changed records/cells. It is almost like a hybrid Excel grid project demo and the Telerik ClientEditBatchUpdates demo. I dont want the user to have to click edit on every row so that is why I am using the Excel like demo. Anyone have any experience with this?
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2011
1 answer
84 views
Below is a code snippit I found in one of your forums.  It was working fine until I turned on filtering.  Now "id" in gridHeader.childNodes[i].id is null so it fails on ".indexOf".   


function BulkOperationRadGrid_GridCreated(sender, eventArgs) {
    var masterTable = sender.get_masterTableView();
    //check whether all items on the active page are selected    
    if (masterTable.get_selectedItems().length == masterTable.get_pageSize()) {
        /*find the checkbox in the header of the GridClientSelectColumn and set checked state for it - will work with AllowMultiRowSelection = true only!*/
        var gridHeader = masterTable.get_element().getElementsByTagName("TH")[0];
        for (var i = 0; i < gridHeader.childNodes.length; i++) {
            if (gridHeader.childNodes[i].id.indexOf("columnSelectCheckBox") > -1) {
                gridHeader.childNodes[i].checked = "true";
            }
        }
    }
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2011
1 answer
106 views
Hi,

Can you tell me how to change the selectedrow color of a rad grid?  I tried changing the selected row forecolor to green but If you look at the attached photo I provided you will see where it is just sitting below the gray background. This is strange...can you take a look at the example I provided?

Thanks,
Ron.
Jayesh Goyani
Top achievements
Rank 2
 answered on 26 Aug 2011
1 answer
78 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
451 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
107 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
336 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
66 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
176 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?