Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
114 views
I'm finding a huge difference in speed between clicking on a tab or selecting the tab in code behind using:
RadTabStrip1.Tabs(1).Enabled = True
RadTabStrip1.Tabs(1).Selected = True
mvPost.SelectedIndex = 1

Is there a reason for this? 

If I click on the tab directly it is pretty much instant to select the tab and view the pageview but if I use a next button with the above code it takes about 10-15 seconds to load, what is the difference?

Thanks,
Paula
Yana
Telerik team
 answered on 17 Aug 2010
1 answer
131 views
Hi Telerik Team,

I have 2 problems in the radtabstrip.
i am building "div" control if its a editor content or "iframe" if its a internal or external link.
and finally adding any one of these controls to "RadPageView".

Problem 1: (only with IE)
     If i add the internal link to tab refering to same page, then this tab is not loaded.

Problem 2
: (only with Safari)
     If i add the any internal link to tab, then this tab is not loaded.
     this problem is due to AJAX enabled.(contents inside RADAJAXPANEL).
     if i disable ajax then everything works fine in safari.

Plzz help me aspd....

Thanks
K²
Yana
Telerik team
 answered on 17 Aug 2010
3 answers
164 views
Hello, Exist an event in the Refresh button of the RadGrid?

I need execute transactions when the user click on the Refresh button.

Can you help me?

Thanks.
Nikolay Rusev
Telerik team
 answered on 17 Aug 2010
6 answers
313 views
hi. Using the drag and drop method... which is awesome. i can't get the detail table where i dropped my rows onto to rebind though.
scenario: two grids, Radgrid2 drops onto Radgrid1 which has a detailTables hierarchy. I am using the method to only allow for one detail table to be open at a time. user can drop either into the detail or straight onto the master.
I am calling detailTables(0).rebind()  at the end of my insert, but that isn't firing. however if I rebind the whole grid it works?
mac




Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand  
        If e.CommandName = RadGrid.ExpandCollapseCommandName Then 
            Dim item As GridItem  
            For Each item In e.Item.OwnerTableView.Items  
                If item.Expanded AndAlso Not item Is e.Item Then 
                    item.Expanded = False 
                End If 
            Next item  
        End If 
    End Sub 
 
    Protected Sub RadGrid1_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles RadGrid1.DetailTableDataBind  
        msg.Text = e.DetailTableView.ParentItem.GetDataKeyValue("costcentre").ToString  
    End Sub 
 
    Protected Sub RadGrid2_RowDrop(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridDragDropEventArgs) Handles RadGrid2.RowDrop  
        Dim dest As String = "" 
        Dim empid As String = e.DraggedItems.Item(0).GetDataKeyValue("Emp_id")  
        If e.DestDataItem.GetDataKeyValue("costcentre") IsNot Nothing Then 
            dest = e.DestDataItem.GetDataKeyValue("costcentre")  
        Else 
            dest = msg.Text ' in the event that the user has opened the detailtable(0)  
        End If 
        If dest IsNot Nothing Then 
            For i As Integer = 0 To e.DraggedItems.Count - 1  
                'insert the items  
                functions.nonqry(ConnStrings.ConnectionStrings, "insert into account (name,accountno) values ('" & dest & "','" & e.DraggedItems.Item(i).GetDataKeyValue("Emp_id") & "')")  
            Next 
        End If 
        Literal1.Text = "CC = " & dest & " " & Date.Now & empid & "     " & e.DestinationGrid.UniqueID.ToString  
        'update the detail table  
        RadGrid1.MasterTableView.DetailTables(0).Rebind()  
 
    End Sub 
    <div> 
         <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Conn %>" 
             SelectCommand="SELECT distinct  [Cost_centre]+ '-' + [Site] as costcentre,  [ID] FROM [tbl_delegate]">  
         </asp:SqlDataSource> 
         <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Conn %>" 
             SelectCommand="SELECT [name] AS costcentre , accountNo as  Emp_id    
             FROM dbo.account WHERE (name = @CostCentre)"> 
             <SelectParameters> 
                 <asp:ControlParameter ControlID="RadGrid1" Name="CostCentre" PropertyName="SelectedValue" /> 
             </SelectParameters> 
         </asp:SqlDataSource><asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:PHCJobPostsConn %>" 
             SelectCommand="Select top 20 Emp_id, EmpFirstName, EmpLastname from tbl_Current_status">  
         </asp:SqlDataSource> 
         <br /> 
         <telerik:RadGrid ID="RadGrid2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource3" 
             GridLines="None" AllowPaging="True" AllowMultiRowSelection="True" Width="200px">  
             <MasterTableView DataKeyNames="Emp_id" DataSourceID="SqlDataSource3">  
                 <RowIndicatorColumn> 
                     <HeaderStyle Width="20px" /> 
                 </RowIndicatorColumn> 
                 <ExpandCollapseColumn> 
                     <HeaderStyle Width="20px" /> 
                 </ExpandCollapseColumn> 
                 <Columns> 
                     <telerik:GridBoundColumn DataField="Emp_id" HeaderText="Emp_id" ReadOnly="True" SortExpression="Emp_id" 
                         UniqueName="Emp_id">  
                     </telerik:GridBoundColumn> 
                     <telerik:GridBoundColumn DataField="EmpFirstName" HeaderText="EmpFirstName" SortExpression="EmpFirstName" 
                         UniqueName="EmpFirstName">  
                     </telerik:GridBoundColumn> 
                     <telerik:GridBoundColumn DataField="EmpLastname" HeaderText="EmpLastname" SortExpression="EmpLastname" 
                         UniqueName="EmpLastname">  
                     </telerik:GridBoundColumn> 
                 </Columns> 
             </MasterTableView> 
             <ClientSettings AllowRowsDragDrop="True">  
                 <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" /> 
             </ClientSettings> 
             <FilterMenu EnableTheming="True">  
                 <CollapseAnimation Duration="200" Type="OutQuint" /> 
             </FilterMenu> 
         </telerik:RadGrid><br /> 
         <br /> 
         <br /> 
         <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1" 
             GridLines="None" AllowPaging="True" Width="500px">  
             <MasterTableView DataKeyNames="costcentre" DataSourceID="SqlDataSource1">  
                 <DetailTables> 
                     <telerik:GridTableView runat="server"  AutoGenerateColumns="True" DataKeyNames="emp_id" 
                         DataSourceID="SQLDataSource2">  
                         <ParentTableRelation> 
                         <telerik:GridRelationFields DetailKeyField="costcentre" MasterKeyField="costcentre" /> 
                         </ParentTableRelation> 
                         <RowIndicatorColumn> 
                             <HeaderStyle Width="20px" /> 
                         </RowIndicatorColumn> 
                         <ExpandCollapseColumn> 
                                                 <HeaderStyle Width="20px"  /> 
                                              
                         </ExpandCollapseColumn> 
                         <PagerStyle Mode="Slider" /> 
                     </telerik:GridTableView> 
                 </DetailTables> 
                     <Columns> 
                     <telerik:GridBoundColumn DataField="Costcentre" HeaderText="Cost_centre" SortExpression="Cost_centre" 
                         UniqueName="Cost_centre">  
                     </telerik:GridBoundColumn> 
                                         <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" ReadOnly="True" 
                         SortExpression="ID" UniqueName="ID">  
                     </telerik:GridBoundColumn> 
                 </Columns> 
                   
             </MasterTableView> 
               
             <FilterMenu EnableTheming="True">  
                 <CollapseAnimation Duration="200" Type="OutQuint" /> 
             </FilterMenu> 
          
               
         </telerik:RadGrid> 
         <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
             <AjaxSettings> 
                 <telerik:AjaxSetting AjaxControlID="RadGrid2">  
                     <UpdatedControls> 
                         <telerik:AjaxUpdatedControl ControlID="RadGrid2" /> 
                         <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                         <telerik:AjaxUpdatedControl ControlID="msg" /> 
                         <telerik:AjaxUpdatedControl ControlID="Literal1" /> 
                     </UpdatedControls> 
                 </telerik:AjaxSetting> 
                 <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                     <UpdatedControls> 
                         <telerik:AjaxUpdatedControl ControlID="msg" /> 
                         <telerik:AjaxUpdatedControl ControlID="Literal1" /> 
                     </UpdatedControls> 
                 </telerik:AjaxSetting> 
             </AjaxSettings> 
         </telerik:RadAjaxManager> 
         <br /> 
         <br /> 
         <asp:Literal ID="msg" runat="server"></asp:Literal> 
         <asp:Literal ID="Literal1" runat="server"></asp:Literal></div>  
 

Dan
Top achievements
Rank 1
 answered on 17 Aug 2010
3 answers
119 views
hello, 

Is is possible to have just 1 pane inside of the splitter and have that resize? pretty much just a box that has the ability to resize the height.

<telerik:RadSplitter Orientation="Horizontal" ResizeMode="AdjacentPane" Width="100%" ID="rsSplitter" runat="server">
    <telerik:RadPane ID="spltPane" Scrolling="Y" runat="server">
        <div>sdasdsadasd</div>
    </telerik:RadPane>
    <telerik:RadSplitBar AdjacentPanesNames-TopPaneName="spltPane" ID="splitter1"  runat="server" />
   
</telerik:RadSplitter>
 
this shows the content that i want and the resize bar but the bar does not allow you to resize without a second pane. Are there any work arounds for this so that we can use just a single pane?
Svetlina Anati
Telerik team
 answered on 17 Aug 2010
7 answers
198 views
I have a sample rad upload on my website.
It run fine but progress area not show if upload large file (> 30 Mb).
I have configured file web.config : <httpRuntime maxRequestLength="100000" executionTimeout="3600" />
Please help me!
Thanks a lot!
Regards,
Genady Sergeev
Telerik team
 answered on 17 Aug 2010
2 answers
128 views
I binded data to radgrid using webservice but GridEditCommandColumn & GridButtonColumn  click event  not fire

 
<telerik:RadGrid runat="server" ID="RadGrid1" AllowPaging="True" AllowSorting="True"
    AutoGenerateColumns="False" GridLines="None"
    OnItemCommand="RadGrid1_ItemCommand">
    <MasterTableView DataKeyNames="Id" ClientDataKeyNames="Id">
        <Columns>
            <telerik:GridBoundColumn DataField="Firstname" HeaderText="Firstname" DataType="System.String">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Lastname" HeaderText="Lastname" DataType="System.String">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Age" HeaderText="Age" DataType="System.Int32">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn"
                ButtonType="ImageButton">
            </telerik:GridButtonColumn>
        </Columns>
        <PagerStyle Mode="Slider" />
    </MasterTableView>
    <ClientSettings>
        <DataBinding SelectMethod="GetSampleData" Location="Webservice/GridData.svc" SortParameterType="String">
        </DataBinding>
    </ClientSettings>
</telerik:RadGrid>

However when clicking on the appropriate button on a grid row the event isn't fired, basically no postback to the server is being done. A solution I found is to add the "EnablePostBackOnRowClick=true" to the ClientSettings, but this would cause a postback on each click on a row, which is not really desired.

Is there a better way to realizing this or does anybody have a hint what could be the problem??

nanthakumar thangavel
Top achievements
Rank 1
 answered on 17 Aug 2010
6 answers
546 views
Quick question.  I see you can change the colors and fonts in RadGrid using VSB, but how do you change just pagination buttons at the bottom?  I just want to do a simple color change so the page buttons match the button colors on my site.  Also, is there anything you can do other than get in the code when VSB won't accept CSS changes?  I've tried to change the header font several times and it just won't accept it.  Thanks in advance!
Dimo
Telerik team
 answered on 17 Aug 2010
1 answer
72 views
Hello, I have a Rad Dock and I am saving the layout into a database, I am saving whenever I move a dock item. The problem is if I move a dock item around too much, or move an item erratically the item duplicates. I attached the html and vb.net can anyone help me with this problem?

VB.net
Imports System.Web.Script.Serialization

Partial Class MyLanding
    Inherits System.Web.UI.Page
    Private LoginClass As New LoginClass
    Private _dockStateCleared As Boolean = False
    Private _conn As New SqlConnection(ConfigurationManager.ConnectionStrings("MidwestPartsConnectionString").ConnectionString)

    Private ReadOnly Property CurrentDockStates() As List(Of DockState)
        Get
            'Get saved state string from the database - set it to dockState variable for example
            Dim dockStatesFromDB As String = ""

            _conn.Open()
            Dim command As New SqlCommand("SELECT JavascriptStr FROM SysProperties WHERE (UserID = @UserID)", _conn)
            command.Parameters.Add("@UserID", SqlDbType.UniqueIdentifier).Value = Me.LoginClass.ReturnUserID()
            Try
                dockStatesFromDB = command.ExecuteScalar().ToString()
                _conn.Close()
            Catch ex As Exception
                _conn.Close()
                Me.CreateSavedLayout("")
            End Try

            Dim _currentDockStates As New List(Of DockState)()
            Dim stringStates As String() = dockStatesFromDB.Split("|"c)
            For Each stringState As String In stringStates
                If stringState.Trim() <> String.Empty Then
                    _currentDockStates.Add(DockState.Deserialize(stringState))
                End If
            Next
            Return _currentDockStates
        End Get
    End Property


    Protected Sub Page_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreRender
        If Not Page.IsPostBack Then
            If CurrentDockStates.Count = 0 Then
                Me.LoadItems()
            End If
        End If
    End Sub

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Init
        Dim i As Integer = 0
        While i < CurrentDockStates.Count
            If CurrentDockStates(i).Closed = False Then
                Dim dock As RadDock = CreateRadDockFromState(CurrentDockStates(i))
                dlColumnOne.Controls.Add(dock)
                CreateSaveStateTrigger(dock)
                LoadUserControl(dock)
            End If
            System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
        End While
    End Sub

    Protected Sub dlColumnOne_LoadDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs)
        For Each state As DockState In CurrentDockStates
            e.Positions(state.UniqueName) = state.DockZoneID
            e.Indices(state.UniqueName) = state.Index
        Next
    End Sub
    Protected Sub dlColumnOne_SaveDockLayout(ByVal sender As Object, ByVal e As DockLayoutEventArgs)
        Dim stateList As List(Of DockState) = dlColumnOne.GetRegisteredDocksState()
        Dim serializedList As New StringBuilder()
        Dim i As Integer = 0

        While i < stateList.Count
            serializedList.Append(stateList(i).ToString())
            serializedList.Append("|")
            System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
        End While

        Dim dockState As String = serializedList.ToString()
        If dockState.Trim() <> [String].Empty Then
            _conn.Open()
            Dim command As New SqlCommand([String].Format("update sysproperties set javascriptstr = '{0}' Where UserID = @UserID ", dockState), _conn)
            command.Parameters.Add("@UserID", SqlDbType.UniqueIdentifier).Value = Me.LoginClass.ReturnUserID()
            command.ExecuteNonQuery()
            _conn.Close()
        End If
    End Sub

    Private Function CreateRadDockFromState(ByVal state As DockState) As RadDock
        Dim dock As New RadDock()
        dock.DockMode = DockMode.Docked
        dock.UniqueName = state.UniqueName
        dock.ID = String.Format("RadDock{0}", dock.UniqueName)
        dock.ApplyState(state)
        dock.Commands.Add(New DockCloseCommand())
        dock.Commands.Add(New DockExpandCollapseCommand())
        Return dock
    End Function

    Private Function CreateRadDock(ByVal DockTitle As String) As RadDock
        Dim docksCount As Integer = CurrentDockStates.Count
        Dim dock As New RadDock
        dock.DockMode = DockMode.Docked
        Dim UniqueName As String = Guid.NewGuid().ToString()
        UniqueName = UniqueName.Replace("-", "")
        dock.UniqueName = UniqueName
        dock.ID = String.Format("RadDock{0}", UniqueName)
        dock.Title = DockTitle
        dock.Width = Unit.Pixel(400)
        dock.Commands.Add(New DockCloseCommand())
        dock.Commands.Add(New DockExpandCollapseCommand())
        Return dock
    End Function

    Private Sub LoadItems()
        Dim DocksDataTable As DataTable = Me.ReturnReports()
        For i = 0 To DocksDataTable.Rows.Count() - 1
            Dim dock As RadDock = Me.CreateRadDock(DocksDataTable.Rows(i).Item("ReportTitle").ToString())
            Dim dz As RadDockZone = Me.dzColumnOne
            Dim dl As RadDockLayout = Me.dlColumnOne
            dz.Controls.Add(dock)
            Me.CreateSaveStateTrigger(dock)
            dock.Tag = DocksDataTable.Rows(i).Item("ReportPath")
            Me.LoadUserControl(dock)
        Next
    End Sub

    Public Function ReturnReports() As DataTable
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("MidwestPartsConnectionString").ConnectionString)
        Dim Query As String = "SELECT Reports.ReportPath, Reports.ReportTitle, UserReports.UserID FROM UserReports INNER JOIN Reports ON UserReports.ReportID = Reports.ReportID WHERE (UserReports.UserID = @UserID)"
        Dim adapter As New SqlDataAdapter
        adapter.SelectCommand = New SqlCommand(Query, connection)
        adapter.SelectCommand.Parameters.Add("@UserID", SqlDbType.UniqueIdentifier).Value = Me.LoginClass.ReturnUserID()
        Dim table1 As New DataTable
        connection.Open()
        Try
            adapter.Fill(table1)
        Finally
            connection.Close()
        End Try
        Return table1
    End Function

    Private Function ReturnLayout() As DataTable
        Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("MidwestPartsConnectionString").ConnectionString)
        Dim Query As String = "select * from sysproperties"
        Dim adapter As New SqlDataAdapter
        adapter.SelectCommand = New SqlCommand(Query, connection)
        adapter.SelectCommand.Parameters.Add("@UserPropertiesID", SqlDbType.Int).Value = 1
        Dim table1 As New DataTable
        connection.Open()
        Try
            adapter.Fill(table1)
        Finally
            connection.Close()
        End Try
        Return table1
    End Function

    Private Sub LoadUserControl(ByVal dock As RadDock)
        If String.IsNullOrEmpty(dock.Tag) Then
            Return
        End If
        Dim usercontrol As Control = LoadControl(dock.Tag)
        dock.ContentContainer.Controls.Add(usercontrol)
    End Sub

    Private Sub CreateSaveStateTrigger(ByVal dock As RadDock)
        dock.AutoPostBack = True
        dock.CommandsAutoPostBack = True
        Dim saveStateTrigger As New AsyncPostBackTrigger()
        saveStateTrigger.ControlID = dock.ID
        saveStateTrigger.EventName = "DockPositionChanged"
        UpdatePanel1.Triggers.Add(saveStateTrigger)
        saveStateTrigger = New AsyncPostBackTrigger()
        saveStateTrigger.ControlID = dock.ID
        saveStateTrigger.EventName = "Command"
        UpdatePanel1.Triggers.Add(saveStateTrigger)
    End Sub

    Private Sub CreateSavedLayout(ByVal JavascriptStr As String)
        Dim sqlConn As New SqlConnection(ConfigurationManager.ConnectionStrings("MidwestPartsConnectionString").ConnectionString)        
        Dim strSqlInsert As String = "INSERT INTO SysProperties(UserID, JavascriptStr) VALUES (@UserID, @JavascriptStr)"
        strSqlInsert += "; SELECT SCOPE_IDENTITY() ;"
        Dim sqlCmd As New SqlCommand(strSqlInsert, sqlConn)
        With sqlCmd.Parameters
            .Add("@JavascriptStr", SqlDbType.Text).Value = JavascriptStr
            .Add("@UserID", SqlDbType.UniqueIdentifier).Value = Me.LoginClass.ReturnUserID()
        End With
        sqlCmd.Connection.Open()
        sqlCmd.ExecuteScalar()
        sqlCmd.Connection.Close()
    End Sub


    Protected Sub btnAddReports_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAddReports.Click
        Try
            Response.Redirect("~/MyUserAccount/SelectedReports.aspx", False)
        Catch ex As Exception

        End Try
    End Sub
End Class


Pero
Telerik team
 answered on 17 Aug 2010
1 answer
123 views
Hi,

I am using the asp.net ajax tab container. Inside each tab, I have a radgrid included. The radgrid has a "GridCreated" event attached in the clientsettings section. I am using this event to adjust the height and width dynamically. But somehow, the grid is not calling that event. Any suggestions?

Thanks,
sridhar.
Veli
Telerik team
 answered on 17 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?