RadTabStrip not changing the page

4 posts, 0 answers
  1. Tom
    Tom avatar
    2 posts
    Member since:
    Sep 2012

    Posted 27 Sep 2012 Link to this post

    I am using one of the provided sample page for RADGrid.

    ASPX:
    <%@ Page Language="VB" MasterPageFile="~/MasterPage.Master" AutoEventWireup="false"
        CodeBehind="Tenders.aspx.vb" Inherits="WebUI.Tenders" %>
     
    <%@ Register TagPrefix="telerik" Namespace="Telerik.QuickStart" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
    <asp:Content ID="Content1" ContentPlaceHolderID="Head" runat="Server">
    </asp:Content>
    <asp:Content ID="Content2" ContentPlaceHolderID="Content" runat="Server">
        <form id="mainForm" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <!-- content start -->
        <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
            <script type="text/javascript">
                <!--
                function RowDblClick(sender, eventArgs) {
                    sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
                }
                function gridCreated(sender, args) {
                    if (sender.get_editIndexes && sender.get_editIndexes().length > 0) {
                        document.getElementById("OutPut").innerHTML = sender.get_editIndexes().join();
                    }
                    else {
                        document.getElementById("OutPut").innerHTML = "";
                    }
                }
                -->
            </script>
        </telerik:RadCodeBlock>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="rgdTenders">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="rgdTenders" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
        <telerik:RadGrid ID="rgdTenders" GridLines="None" runat="server" AllowPaging="True"
            OnNeedDataSource="rgdTenders_NeedDataSource" AutoGenerateColumns="False" CellSpacing="0"
            OnUpdateCommand="rgdTenders_UpdateCommand" OnInsertCommand="rgdTenders_InsertCommand"
            OnDeleteCommand="rgdTenders_DeleteCommand" AllowSorting="true" AllowMultiRowSelection="false">
            <ClientSettings Selecting-AllowRowSelect="true" />
            <PagerStyle Mode="NextPrevAndNumeric" />
            <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom" DataKeyNames="TenderID"
                HorizontalAlign="NotSet" AutoGenerateColumns="False" CommandItemSettings-AddNewRecordText="Add New Tender"
                RetrieveDataTypeFromFirstItem="true">
                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                        <ItemStyle CssClass="MyImageButton" Width="20px" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridBoundColumn DataField="Nr" HeaderText="Tender Nr." SortExpression="Nr"
                        UniqueName="Nr" ColumnEditorID="GridTextBoxColumnEditor1" ItemStyle-Width="150px">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this Tender?" ConfirmDialogType="RadWindow"
                        ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                        UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" Width="20px" />
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings ColumnNumber="2" CaptionDataField="Nr" CaptionFormatString="Edit properties of Tender {0}"
                    InsertCaption="New Tender">
                    <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                    <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                        Width="100%" />
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                        UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" OnGridCreated="gridCreated" />
            </ClientSettings>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
        <!-- End of Main Grid Control -->
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="200px" />
        <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor2" runat="server" TextBoxStyle-Width="400px"
            TextBoxMode="MultiLine" TextBoxStyle-Height="150">
        </telerik:GridTextBoxColumnEditor>
        <telerik:GridDateTimeColumnEditor ID="GridDateTimeColumnEditor1" runat="server" TextBoxStyle-Width="200px" />
        <br />
        <br />
        <telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1"
            SelectedIndex="0">
            <Tabs>
                <telerik:RadTab runat="server" Text="Sales" PageViewID="PageView1" />
                <telerik:RadTab runat="server" Text="Contact Information" PageViewID="PageView2" />
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage runat="server" ID="RadMultiPage1" SelectedIndex="0" RenderSelectedPageOnly="false">
            <telerik:RadPageView runat="server" ID="PageView1">
                <div>
                    PageView 1</div>
            </telerik:RadPageView>
            <telerik:RadPageView runat="server" ID="PageView2" Width="460px" BorderColor="Black"
                BorderWidth="1px">
                <div>
                    PageView 2</div>
            </telerik:RadPageView>
        </telerik:RadMultiPage>
        <br />
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>
        </form>
    </asp:Content>
    <asp:Content ID="Content3" ContentPlaceHolderID="Footer" runat="Server">
    </asp:Content>
    <asp:Content ID="Content4" ContentPlaceHolderID="AfterBody" runat="Server">
    </asp:Content>


    Code:
    Imports Telerik.Web.UI
    Imports BAL
    Imports DAL.EntityClasses
     
    Partial Class Tenders
        Inherits System.Web.UI.Page
     
        Public Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
            If Not IsPostBack Then
                 
            End If
        End Sub
     
        Public Sub rgdTenders_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgdTenders.NeedDataSource
            Dim etcTenders As New DBRealated
            rgdTenders.DataSource = etcTenders.GetTenders(Nothing)
        End Sub
     
        Protected Sub rgdTenders_InsertCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgdTenders.InsertCommand
            'Get the GridEditFormInsertItem of the RadGrid
            Dim insertedItem As GridEditFormInsertItem = DirectCast(e.Item, GridEditFormInsertItem)
     
            'Access the textbox from the edit form template and store the values in string variables.
            Dim Nr As String = (TryCast(insertedItem("Nr").Controls(0), TextBox)).Text
     
            Try
                Dim etTender As New TenderEntity
                etTender.Nr = Nr
     
                Dim obj As New DBRealated
                obj.SaveTender(etTender, False)
     
                SetMessage("New Tender """ & Nr & """ has been created!", True)
            Catch ex As Exception
                SetMessage("Tender with Nr """ & Nr & """ could not be created!", False)
                e.Canceled = True
            End Try
        End Sub
     
        Public Sub rgdTenders_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgdTenders.DeleteCommand
            'Get the GridDataItem of the RadGrid
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
     
            'Get the primary key value using the DataKeyValue.
            Dim TenderID As Integer = CInt(item.OwnerTableView.DataKeyValues(item.ItemIndex)("TenderID"))
     
            Try
                Dim obj As New DBRealated
                obj.DeleteTender(TenderID)
     
                SetMessage("Tender has been deleted!", True)
     
            Catch ex As Exception
                SetMessage("Tender could not be deleted!", False)
                e.Canceled = True
            End Try
     
        End Sub
     
        Public Sub rgdTenders_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgdTenders.UpdateCommand
            'Get the GridEditableItem of the RadGrid
            Dim editedItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
     
            'Get the primary key value using the DataKeyValue.
            Dim TenderID As Integer = CInt(editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("TenderID"))
     
            'Access the textbox from the edit form template and store the values in string variables.
            Dim Nr As String = (TryCast(editedItem("Nr").Controls(0), TextBox)).Text
     
            Try
                Dim etTender As New TenderEntity
                etTender.TenderId = TenderID
                etTender.Nr = Nr
     
                Dim obj As New DBRealated
                obj.SaveTender(etTender, True)
     
                SetMessage("Tender with Nr """ & Nr & """ is updated!", True)
     
            Catch ex As Exception
                SetMessage("Tender with Nr """ & Nr & """ could not be updated!", False)
                e.Canceled = True
            End Try
     
        End Sub
     
        Private Sub SetMessage(ByVal message As String, ByVal bIsGood As Boolean)
            gridMessage = message
            GoodMessage = bIsGood
        End Sub
     
        Private gridMessage As String = Nothing
        Private GoodMessage As Boolean = True
        Protected Sub rgdTenders_DataBound(ByVal sender As Object, ByVal e As EventArgs) Handles rgdTenders.DataBound
            If Not String.IsNullOrEmpty(gridMessage) Then
                DisplayMessage(gridMessage, GoodMessage)
            End If
        End Sub
     
        Private Sub DisplayMessage(ByVal text As String, ByVal bIsGood As Boolean)
            If bIsGood Then
                rgdTenders.Controls.Add(New LiteralControl(String.Format("<span style='color:green'>{0}</span>", text)))
            Else
                rgdTenders.Controls.Add(New LiteralControl(String.Format("<span style='color:red'>{0}</span>", text)))
            End If
        End Sub
    End Class

    Everything thing related to the RADGrid is working fine, but RADTabStrip is not working as expected, when I select "Contact Information" which is 2nd tab page inside the RADTabStrip it is not actually selecting it and so the content of the 2nd Page "PageView 2" is also not showing.

    what i am missing here? do i have to configure something in the update panel for RadTabStrip?

    kindly write the code as i am new to Rad World.
  2. Tom
    Tom avatar
    2 posts
    Member since:
    Sep 2012

    Posted 30 Sep 2012 Link to this post

    Thanks, I resolved it.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vipul
    Vipul avatar
    3 posts
    Member since:
    May 2013

    Posted 16 May 2013 Link to this post

    how did you resolve it? i have same issue.
  5. Vipul
    Vipul avatar
    3 posts
    Member since:
    May 2013

    Posted 16 May 2013 Link to this post

    i missed the MultiPageID="AssessorMultiPage" binding , adding this resolved the issue. 
Back to Top