Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
1.7K+ views
Hi all I am having my RadTabstrip  designed as follows

<telerik:RadTabStrip ID="rdtabEmployee" runat="server" MultiPageID="rdmpPersonal"
            UnSelectChildren="True" Skin="Vista" EnableEmbeddedSkins="False" ClickSelectedTab="True"
            AutoPostBack="True" SelectedIndex="0" OnTabClick="tabClick">
            <Tabs>
                <telerik:RadTab runat="server" Text="Personal">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Contact">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Salary">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Bank">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Taxes">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Residence">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Work">
                        </telerik:RadTab>
                    </Tabs>
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="rdmpPersonal" runat="server">
            <telerik:RadPageView ID="rdpgPersonal" runat="server">
                <label>
                    Demo Personal
                </label>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rdpgContact" runat="server">
                <label>
                    Demo Contact
                </label>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rdpgResident" runat="server">
                <label>
                    Resident Demo
                </label>
            </telerik:RadPageView>
            <telerik:RadPageView ID="rdpgWork" runat="server">
                <label>
                    Work Demo
                </label>
            </telerik:RadPageView>
        </telerik:RadMultiPage>

You can find under Taxes tab I am having sub Tabs. How can I handle Click event for that .

I write my code as follows

protected void tabClick(object sender, RadTabStripEventArgs e)
    {
        AddPageView(e.Tab.Text);
        e.Tab.PageView.Selected = true;
    }
    private void AddPageView(string pageViewID)
    {
        RadPageView pageView = new RadPageView();
        pageView.ID = pageViewID;
        rdmpPersonal.PageViews.Add(pageView);
    }

But this didn't work child Tabs can some one help me

I am also getting the following error if i click the same Tab for multiple times

Multiple controls with the same ID 'Personal' were found. FindControl requires that controls have unique IDs.

Princy
Top achievements
Rank 2
 answered on 14 Jun 2012
0 answers
399 views
hi all,
 
I m using filtering radgrid.

I'm using 2008 version of telerik DLL which does not support "Filter Template". I want to develop a screen which is something like the one attached.

As you can see the attachment i want a button in place of filter text boxes and this is for two columns alone(Column Nominate and Column Approve). To achieve that i wrote a class which is below.

public class GenerateButton : GridCheckBoxColumn
    {
 
        //RadGrid will call this method when it initializes the controls inside the filtering item cells
        protected override void SetupFilterControls(TableCell cell)
        {
 
            base.SetupFilterControls(cell);
            cell.Controls.RemoveAt(0);
            Button b = new Button();
            b.ID = ("SelectDeselect"+ this.UniqueName);
            b.BackColor = System.Drawing.Color.White;
            b.Text = "Select/Deselect All";
            string s = b.ID;
                 
            //b.OnClientClick = "clickbutton('"+s+"')";
            if (s.Equals("SelectDeselectColumnNominate"))
            {
                b.OnClientClick = "ColumnNominateClickButton()";
            }
            else if(s.Equals("SelectDeselectColumnApprove"))
            {
                b.OnClientClick = "ColumnApproveClickButton()";
            }
            cell.Controls.AddAt(0, b);
            cell.Controls.RemoveAt(1);
 
        }
 
 
    }


For those two columns i used the below logic which is written in the PageLoad.
if (dataColumn.ColumnName == "ColumnNominate")
     {
            GenerateButton columnNominate = new GenerateButton();
             RadGrid1.MasterTableView.Columns.Add(columnNominate);
             columnNominate.DataField = dataColumn.ColumnName;
             columnNominate.SortAscImageUrl = @"Arrow Down.jpg";
             columnNominate.SortDescImageUrl = @"Arrow Up.jpg";
             columnNominate.HeaderText = dataColumn.ColumnName;
      }
       else if (dataColumn.ColumnName == "ColumnApprove")
        {
         GenerateButton columnApprove = new GenerateButton();
          this.RadGrid1.MasterTableView.Columns.Add(columnApprove);
           columnApprove.DataField = dataColumn.ColumnName;
           columnApprove.SortAscImageUrl = @"Arrow Down.jpg";
           columnApprove.SortDescImageUrl = @"Arrow Up.jpg";
           columnApprove.HeaderText = dataColumn.ColumnName;
         }

Item data bound logic is below where in i'm setting the properties of checkboxes.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = (GridDataItem)e.Item;
                CheckBox chkbxNominate = (CheckBox)item["ColumnNominate"].Controls[0];
                chkbxNominate.ID = "ChkNominate";
                 
                chkbxNominate.Visible = true;
                chkbxNominate.Enabled = true;
              
 
                CheckBox chkbxApprove = (CheckBox)item["ColumnApprove"].Controls[0];
                chkbxApprove.ID = "ChkApprove";
                chkbxApprove.Visible = true;
                chkbxApprove.Enabled = true;
                
 
            }
          
        }

Now things are getting complicated for me.

The following tasks needs to be done
1. Persist the checkbox's checked status while i filter.
2. On clicking the SelectAll/DeselectAll button i need to select all checkboxes and deselect all checkboxes. I wrote this in javascript and is working fine
3. I need to identify the checked checkboxes in the (.cs) file so that i could pass in this value to the DB. Now where to write this logic? If i try to find the checkboxes in the "ColumnNominate" or "ColumnApprove" then the system is throwing an error saying "No controls are bound to that particular cell". Kind suggestion please on how to proceed further?

Also can you please suggest me some other better way to create two checkbox columns programatically?
Gowtham
Top achievements
Rank 1
 asked on 14 Jun 2012
0 answers
94 views
I have a master page that has the script manager on it.
I have a content page that has the follow RadajaxManager and Panels

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" UpdatePanelsRenderMode="Inline">
</telerik:RadAjaxManager>
 
<!-- Loading Panel -->
<telerik:RadAjaxLoadingPanel ID="DefaultAjaxLoadingPanel" runat="server" Skin="Default">
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="0"
    Skin="" Transparency="30" BackColor="#CCCCCC">
    <div id="MyLoadingPanel">
        <span class="WbHeader">Configuring Document...</span><br />
        <asp:Image ID="LoadingImage" runat="server" ImageUrl="~/images/ajax-loader.gif"></asp:Image>
    </div>
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server" MinDisplayTime="0"
    Skin="" Transparency="30" BackColor="#CCCCCC">
    <div id="Div1">
        <span class="WbHeader">Restructuring Document...</span><br />
        <asp:Image ID="Image1" runat="server" ImageUrl="~/images/ajax-loader.gif"></asp:Image>
    </div>
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel3" runat="server" MinDisplayTime="0"
    Skin="" Transparency="10" BackColor="#CCCCCC" ZIndex="2000">
    <div id="Div3" style="margin: 50px 10px 10px 10px; text-align: left">
        <span class="WbHeader">The document outline view is disabled while you are editing this
            particular content block. When you have finished and saved your work, this view
            will refresh to reflect your changes.</span>
    </div>
</telerik:RadAjaxLoadingPanel>

The RadAjaxManager is called from javascript that is initiated by a RadTree OnClientNodeClicking

<div id="MainDiv" style="height:100%;width:100%;overflow:auto;">
        <telerik:RadSplitter ID="rsMain" runat="server" VisibleDuringInit="True" Height="100%" Width="100%" AccessKey="o" style="overflow: auto;">
         
            <telerik:RadPane ID="pOutline" runat="server" Width="26%" CssClass="VisibleScrollbar">
 
            <telerik:RadTreeView ID="OutlineTree" runat="server" AccessKey="w" CausesValidation="False"
                EnableDragAndDrop="True" EnableDragAndDropBetweenNodes="True" WebServiceSettings-Path="/wbTree.asmx"
                WebServiceSettings-Method="LoadNodes"
                onclientcontextmenushowing="ClientContextMenuShowing"
                OnClientNodePopulating="ClientNodePopulating"
                OnClientNodeDropping="ClientNodeDropping"
                OnClientNodePopulated="ClientNodePopulated" Height="99%"
                OnClientNodeClicking="ClientNodeClicking"
                EnableViewState="False"
                CollapseAnimation-Type="None"
                ExpandAnimation-Type="None">
                <WebServiceSettings Method="LoadNodes" Path="/wbTree.asmx"></WebServiceSettings>
                <ContextMenus>
                    <telerik:RadTreeViewContextMenu ID="ElementMenu" runat="server" EnableAutoScroll="True">
                    </telerik:RadTreeViewContextMenu>
                </ContextMenus>
                <ExpandAnimation Type="None" />
            </telerik:RadTreeView>
         
            </telerik:RadPane>
 
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" />
     
            <telerik:RadPane ID="pContent" runat="server" Width="74%">
                <telerik:RadAjaxPanel id="plEdit" runat="server" EnableAJAX="True" Width="99%"
                    LoadingPanelID="DefaultAjaxLoadingPanel"  ClientEvents-OnResponseEnd="plEditResponseEnd"
                    Height="99%">
                     
                    <asp:HiddenField ID="SelectedIID" Value="0" runat="server" />
                     
                    <telerik:RadSpell ID="RadSpell1" runat="server" IsClientID="True" ButtonType="None" EnableViewState="False"  />                          
                     
                    <asp:Button ID="NextButton" runat="server" Visible="false" Text="Next" CausesValidation="false" EnableViewState="false"/>
 
                </telerik:RadAjaxPanel
            </telerik:RadPane>
 
        </telerik:RadSplitter>
    </div>

//Called when you are attempting to click a node on the tree.
function ClientNodeClicking(sender, args) {
    var Node = args.get_node();
    var attrs = Node.get_attributes();
    var ClickStatus = attrs.getAttribute("ClickStatus");
    var IID = attrs.getAttribute("IID");
 
    if (ClickStatus != null) {
        if (ClickStatus == "None") {
            args.set_cancel(true);
            return;
        }
    }
 
    if (IID == null || IID == "") {
        args.set_cancel(true);
        return;
    }
 
    Page_ValidationActive = false;
 
    var _ajax = $find("<%=RadAjaxManager1.ClientID %>");
     
    if (_ajax != null) {
        var CmdStr = "IID=" + IID;
        _ajax.ajaxRequestWithTarget("<%= plEdit.ClientID %>", CmdStr);
    }
 
}

The ClientIDs and CmdStr are properly assigned (attached ClickedValues).

I also have a server side method that overrides the RaisePostbackEvent which I would expect to get called but does not.

Protected Overrides Sub RaisePostBackEvent(ByVal source As IPostBackEventHandler, ByVal eventArgument As String)
       MyBase.RaisePostBackEvent(source, eventArgument)
 
       If TypeOf source Is RadAjaxPanel Then
 
           ''No, there is no tree!
           If MyTree Is Nothing Then
               Exit Sub
           End If
 
           If eventArgument.Contains("IID=") Or eventArgument.Contains("Refresh") Then
               ''Slight Hack for multi-page wizard controls
               Session("_CurrentWizardPage") = 0
               If _NodeTransformed = True Then
                   RadAjaxManager1.ResponseScripts.Add(String.Format("ServerSideRefreshNode('{0}');", SelectedIID.Value))
               End If
           End If
 
           If eventArgument.Contains("IID=") Then
               Dim _NodeStr As String = eventArgument.Substring(eventArgument.LastIndexOf("=") + 1)
               If SelectedIID.Value <> _NodeStr Then
                   _NodeStr = _NodeStr
                   SelectedIID.Value = _NodeStr
                   BuildControls(_NodeStr, True)
               End If
           End If
 
           If eventArgument.Contains("Refresh") Then
               BuildControls(SelectedIID.Value, True)
           End If
 
           If eventArgument.Contains("SaveFile") Then
               ''Do nothing technically. We've already done the binding to the XML document in the postback at this point.
           End If
 
           If eventArgument.Contains("SaveWithValidation") Then
               RadAjaxManager1.ResponseScripts.Add("ValidateXmlCallback();")
           End If
 
           If eventArgument.Contains("ValidationOnly") Then
               RadAjaxManager1.ResponseScripts.Add("ValidateXmlCallback('report');")
           End If
 
           _NodeTransformed = False
       End If
 
   End Sub

This is a web application (Not Web site).  I have an application level function for logging errors and nothing is being caught, No javascript error is being received nor is any IIS error being logged in the event viewer.  It appear that processing is simply stopping.

Any suggestions as to why this would not be working would be appreciated.
Phillip
Top achievements
Rank 1
 asked on 14 Jun 2012
4 answers
146 views
Hi
    I am using telerik Radcontrols for AJAX 2011.3.1115 version. Some times my web page UI is disturbing, the Telerik controls are not visible properly,please find the attachment. 
Please help me ASAP,Getting lot of disturb for this,this is happening in rad controls(Radlistbox,Radcombobox)


Thank you
Gurumoorthy.V
JJ
Top achievements
Rank 1
 answered on 13 Jun 2012
1 answer
176 views
I need to implement the below requirement in my telerik rad grid.

1. In the X-> Axis we need to show the days of a month(1-31) and in Y-Axis we need to show the month name. We have a name column which shows the name of different persons worked on a team.

2. A person can take multiple categories leaves in a single day. For Example in a day if we consider 8 hours as working hours and lets say I took 2 hours of Sick Leave, 2 hours of Working from home and 4 hours of out of office.

3. For each kind of leave we have different color codes to represents that in a grid cell for that day. These color code as the hex codes coming from a database based on the user preference set for that employee.

4. If you see the attachment, for the month of Jan, Person1, took 3 categories of leaves on 3rd Jan and 14th Jan. How to achieve this functionality of having 3 different color codes in a single grid cell and that to those colors are coming from database.

It will be great if you can tell me how to achieve this functionality.

Thanks,
Nishith
Richard
Top achievements
Rank 1
 answered on 13 Jun 2012
1 answer
81 views
I have a RadGrid and an RadAjaxLoadingPanel and wire them together.  I choose to edit a row of the grid within an Edit Form template and if I click on the update or cancel buttons of my edit form the RadAjaxLoadingPanel displays as normal.  If I click into one of the fields of my edit form and TAB over to the submit or cancel buttons and then click the enter key... the postback occurs and my grid is updated BUT the RadAjaxLoadingPanel never displays.

What's going on here?
Richard
Top achievements
Rank 1
 answered on 13 Jun 2012
1 answer
215 views
Hi all,

am using asp.net 3.5 i need to limit the adding levels of my tree list main categories limit to MAX 6 levels... wont alow to add after 6th level..

have you any idea about this then please let me know..

Regards,

Prassin
Richard
Top achievements
Rank 1
 answered on 13 Jun 2012
1 answer
81 views
Hello all

We're using a fairly oldish release (2010.3.1317.40) on Windows 7 using IE9.  Currently this is needed due to the amount of testing already performed with this version, so the customer is reticent to update to the latest version if it's all avoidable.

We're having a problem with performance when selecting a row in a RadGrid with a 1000 rows

It takes 1.5 seconds on the first time a row is selected, and then 0.75 seconds on subsequent selections.  This is more than enough for a user to notice the lag.

In Firefox selecting a row takes up 0.15 seconds.

Note that in both cases a callback is being made back to the server.  I've profiled this and that's taking 0.12 seconds, so the Firefox response time seems more than adequate.

Any ideas what can be causing this problem, or is it a problem with IE?

Thanks in advance.
Richard
Top achievements
Rank 1
 answered on 13 Jun 2012
1 answer
329 views
Hi,


    I used a Link button in listview itemtemplate.I need to redirect to a page in a new window.
But, I unable to find the solution.. It does not redirect to..


My code is here...
 
<telerik:RadAjaxPanel ID="rAjaxPnlForumsCategory" runat="server" LoadingPanelID="rAjaxLoadingPnlForumsCategory">
    <div style="border-top:1px solid #828282; border-bottom:1px solid #828282;">
 
        <telerik:RadListView ID="rlstviewReply" runat="server" Width="100%"
                             DataKeyNames="ForumPostReplyID"
                             OnNeedDataSource="rlstviewReply_NeedDataSource"
                             OnItemDataBound="rlstviewReply_ItemDataBound">
            <ItemTemplate >
                <table width="100%">
                    <tr>
                        <td>
                            Replied by
                            <asp:LinkButton ID="lnkbtnCandidateName" runat="server" OnCommand="lnkbtnCandidateName_Command" Enabled="false"  CssClass="_TextBoldSubCategory"></asp:LinkButton>
                          <span> On <asp:Label ID="lblCreatedOn" runat="server" Text=""></asp:Label></span>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <div id="divReply" runat="server" class="_PaddingTop5 _PaddingBottom5"><%# Eval("Reply") %></div>
                        </td>
                    </tr><tr><td id="Td1" runat="server" visible='<%# (Container.DataItemIndex + 1).ToString() != hidCount.Value  %>' align="center" class="DottedLineBottom2" style="text-align:center;"></td></tr>
                        
                </table>
            </ItemTemplate>
        </telerik:RadListView>
    </div>
  
    <div class="_PaddingTop20">
        Post your reply
        <div class="_PaddingTop20">    
        <telerik:RadEditor runat="server" Skin="Telerik" ToolsFile="~/Forums/RadEditorTools.xml"  ContentAreaCssFile="~/Styles/Editorstyle.css"
                           ID="radeditorReply" Width="100%">
        </telerik:RadEditor>
        <asp:RequiredFieldValidator CssClass="ErrorMessage" ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="radeditorReply" ValidationGroup="reply"></asp:RequiredFieldValidator>
        </div>
    </div>
    <div class="_PaddingTop5" style="text-align :center;">
        <telerik:RadButton ID="btnSubmit" runat="server" Text="SUBMIT" onclick="btnSubmit_Click" ValidationGroup="reply">
        </telerik:RadButton>
    </div>
    <div> </div>
</telerik:RadAjaxPanel>
<asp:HiddenField ID="hidCount" runat="server" />
 
 
        protected void rlstviewReply_ItemDataBound(object sender, Telerik.Web.UI.RadListViewItemEventArgs e)
        {
            try
            {
                if (!(e.Item is RadListViewDataItem))
                {
                    return;
                }
 
                if (e.Item is RadListViewItem)
                {
                    RadListViewDataItem rlvItem = (RadListViewDataItem)e.Item;
 
                    LinkButton lnkbtnCandidateName = (LinkButton)rlvItem.FindControl("lnkbtnCandidateName");
                    Label lblCreatedOn = (Label)rlvItem.FindControl("lblCreatedOn");
 
                    ForumPostReplies forumpostsreply = (ForumPostReplies)rlvItem.DataItem;
                    if (forumpostsreply == null)
                    {
                        return;
                    }
 
                    lnkbtnCandidateName.Text = string.Format("{0}", forumpostsreply.Users.UserName);
                    lblCreatedOn.Text = forumpostsreply.CreatedOn.ToString("g");
 
                    if (SessionHandler.User.UserTypeID == (int)FrameworkConstants.USER_TYPE.Employer)
                    {
                        lnkbtnCandidateName.Enabled = true;
                        lnkbtnCandidateName.CommandArgument = forumpostsreply.Users.UserID.ToString();
                        lnkbtnCandidateName.Attributes.Add("OnClick", " window.location.href =" + FrameworkConstants.PROJECT_PAGES.CANDIDATE_PROFILE.Description() + ");");
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorLogging.AddErrorLog(ex);
            }
        }
 
        protected void lnkbtnCandidateName_Command(object sender, CommandEventArgs e)
        {
            try
            {
                if (e.CommandArgument == null)
                {
                    return;
                }
 
                long userID = 0;
                if (long.TryParse(e.CommandArgument.ToString(), out userID))
                {
                    Session[FrameworkConstants.SESSION_VARIABLES.CANDIDATEID.ToString()] = userID;
                }
            }
            catch (Exception ex)
            {
                ErrorLogging.AddErrorLog(ex);
            }
        }


Thank you in advance...
Richard
Top achievements
Rank 1
 answered on 13 Jun 2012
1 answer
92 views
I am trying to format a spreadsheet that I am exporting. I have had to add some hidden columns in the grid so I could use the Data.DataItem in the ExcelMLExportRowCreated event to do some calculations to determine if a date should be highlighted or not. In my click event for my export button I am setting them to visible so I have access to the value. It appears if they are hidden I cannot access this value in the ExcelMLExportRowCreated. The issue is that I don't want these values in the actual spreadsheet. I just want to use them in the calculation. Am I going about this the wrong way?
Chris
Top achievements
Rank 1
 answered on 13 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?