Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
210 views
Hi telerik
Is there any way to force the user to enter uppercase letters along with other characters in radtextbox?
Princy
Top achievements
Rank 2
 answered on 13 Nov 2013
1 answer
174 views
I have the code mentioned below:
When I try to collapse or close the opened NesteViewTemplate,it works when the CommandName is cancel and does not work when the CommandName is Save.
What could be reason behind this behaviour?
I need to close/collapse the NestedViewTemplate after saving the data.
What is worng with the code?

Below are the linkbuttons which will fire the event.
<asp:LinkButton ID="lnkBtnSave" runat="server" Text="Save" CommandName="Save"/>

<asp:LinkButton ID="lnkBtnCancel" runat="server" Text="Cancel" CommandName="Cancel"></asp:LinkButton>

if (e.CommandName == "Save")
{
               e.Item.Expanded = false;
}
else if (e.CommandName == RadGrid.CancelCommandName)
{
e.Item.Expanded = false;
}

Princy
Top achievements
Rank 2
 answered on 13 Nov 2013
15 answers
1.6K+ views

 

 

Hello,

I have the following CommandItemTemplate (below) in my RadGrid and I am wondering how to access the buttons and checkboxes in that template.  Specifically, I want to disable/enable them when appropriate.  How do I access those controls programatically serverside?  I'll be doing this in the PageLoad() method.  VB.NET.  Thanks for the help!

 

 

<telerik:RadGrid ID="rgT" runat="server" Skin="WebBlue" AutoGenerateColumns="False"

 

 

GridLines="None" AllowFilteringByColumn="True" AllowMultiRowEdit="true" AllowMultiRowSelection="true"

 

 

OnItemDataBound="rgT_ItemDataBound" OnItemCommand="rgT_ItemCommand" Width="1093px"

 

 

Height="500px">

 

 

<MasterTableView CommandItemDisplay="Top" EditMode="InPlace">

 

 

<Columns>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn DataField="FIELD1" HeaderText="" UniqueName="FIELD1"

 

 

ReadOnly="True" Display="false">

 

 

</telerik:GridBoundColumn>

 

 

 

</Columns>
<

CommandItemTemplate>

 

 

<div id="DivUA" runat="server" style="padding-top: 5px; padding-bottom: 5px">

 

 

<table>

 

 

<tr>

 

 

<td>

 

 

<asp:Button runat="server" ID="btnUA" Text="Save" ToolTip="Save all changes you've made to the data"

 

 

Width="70px" CommandName="UpdateAll" CssClass="CommandButton" /></td>

 

 

<td style="padding-left:15px">

 

 

<asp:Button runat="server" ID="btnCGC" Text="Cancel Edits" ToolTip="Cancel all unsaved edits made to the data and reload the original data"

 

 

Width="100px" CommandName="CancelAll" CssClass="CommandButton" /></td>

 

 

<td align="right" style="padding-left:15px">

 

 

<asp:Button runat="server" ID="btnEditSelected" Text="Edit Selected" ToolTip="Place all selected grid rows into edit mode."

 

 

Width="100px" CommandName="EditSelected" CssClass="CommandButton" />

 

 

</td>

 

 

<td align="right" style="width: 120px">

 

 

<asp:CheckBox ID="cbToggleApproved" runat="server" Text="Hide Approved" CssClass="Normal"

 

 

OnCheckedChanged="hideAllApproved" AutoPostBack="True" /></td>

 

 

<td align="right" style="width: 100px">

 

 

<asp:CheckBox ID="cbApproveAll" runat="server" Text="Approve All" AutoPostBack="True"

 

 

OnCheckedChanged="approveAllCheckChanged" CssClass="Normal" /></td>

 

 

</tr>

 

 

</table>

 

 

</div>

 

 

</CommandItemTemplate>

 

Princy
Top achievements
Rank 2
 answered on 13 Nov 2013
7 answers
639 views
Hi All,

I am using RadCalender.

I have added 3 radcalender control.
First calendar show the current month.
I want to set second calendar to next month from current month
and third calendar to net to next month from current month.

From serveside how can i set the month.

Thanks
Nilima
Top achievements
Rank 1
 answered on 13 Nov 2013
1 answer
114 views
Hello.  Can someone explain to me why the below line of code works fine in version 2011.2.712.35 of Telerik DLL, but doesn't work in version 2013.3.1015.35?  The error that I'm getting with version 2013.3 is "Specified argument was out of the range of valid values". 
Is version 2013.3 not completely backward compatible with version 2011.2 when it comes to RadDock??
HtmlTable obj = (HtmlTable)((System.Web.UI.Control)(this.plcHolderFltControl)).FindControl("fltUserControl").FindControl("plcHolderFilterControl").FindControl("DockLayout1").FindControl("DockZone1").FindControl("RadDock1").Controls[0].Controls[1].Controls[1].Controls[0].Controls[0];

Mathew
Top achievements
Rank 1
 answered on 12 Nov 2013
2 answers
94 views
So I have an address popup and I want to display some different wording or hide some textboxes based on what radGrid has called it.  Whats the best way to do this?
<MasterTableView EditMode="PopUp" CommandItemDisplay="Top"  DataKeyNames="AddressId">
 
                   <EditFormSettings  UserControlName="~/AddressEdit.ascx" EditFormType="WebUserControl" InsertCaption="Add new Address" PopUpSettings-Width="800px"
        FormStyle-BackColor="AliceBlue" FormStyle-BorderWidth="5px" FormStyle-BorderColor="Turquoise" CaptionFormatString="Edit Address ID: {0}"
        CaptionDataField="AddressId">
             <EditColumn UniqueName="EditCommandColumnAddr"/>
    </EditFormSettings>
danparker276
Top achievements
Rank 2
 answered on 12 Nov 2013
1 answer
217 views
Hi, 

We have a long running process on the server end of our ASP.NET Application Running on IIS 7 Integrated Windows Authentication.
This process can take up to 2 hours and 45 minutes. we wanted the user to be able to view the progress of this action, so we setup a radwindow to open with a radprogressarea/progressmanager to keep the session alive while the process is running. 

The Progress Area is updating successfully for about the first 5 minutes of elapsed time.

Then one of two things happen:
the Page will Ask for credentials
-> when entering crediential correctly will cause a new request to occur on the server, so a new job is created automatically using the old post request. Progress starting at 0%
-> when canceling we getting 401 error. The job is still running in the background but the client can no longer see the progress.
Or
the page goes straight to an error saying can not display page. then after refreshing the server serves the initial page where you could submit a new job. 

OS:Windows 2008 Server edition
IIS: version 7
Authentication: Windows Integrated (Domain Active Directory)
browser: Internet Explorer 8
telerik (UI/Skin) version: 2012.2.912.40 
language: C#


My questions are:
Is the Rad Progress Area/Manager not keeping the session alive on the server end?
Is there something special we need to do for the Ajax requests have the automated authentication per request be run?
Is there something that telerik is doing that may reset the authentication for the ajax requests?
Is there something on the client side that is killing the connection to the server if the main page isn't requesting new information since the ajax progress area is using a different socket path.
any ideas on what could be causing this issue?



Hristo Valyavicharski
Telerik team
 answered on 12 Nov 2013
2 answers
248 views
I have RadGrid in which I need to only bind a UserControl in Item_Created Event,when the I try to expand the NestedViewTemplate.
Right now,it is also binding the UserControl even when the I bind the RadGrid.
Is there a property to identify if the NestViewTemplate is Expand,like how when have it in GridEditFormItem,where we say e.Item.IsInEditMode.

    <telerik:RadGrid ID="radGridQuestionnaire" runat="server" 
                    Width="100%"   
                    PageSize="20"    
               AutoGenerateColumns="False" 
                    GridLines="None" 
                    AllowSorting="True" 
               AllowPaging="True" 
                    OnNeedDataSource="radGridQuestionnaire_NeedDataSource"
                    OnItemCreated="radGridQuestionnaire_ItemCreated"
                    OnItemDataBound="radGridQuestionnaire_ItemDataBound"
                    OnItemCommand="radGridQuestionnaire_ItemCommand">
        <PagerStyle Mode="NextPrevNumericAndAdvanced"/>
   <MasterTableView EnableViewState="true" DataKeyNames="Form.DisplayFormName,Question.QuestionNumber,Question.QuestionId,ReviewId" Width="100%">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
   <ExpandCollapseColumn>
   <HeaderStyle Width="20px"></HeaderStyle>
   </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn HeaderText="Form" UniqueName="FormName" DataField="Form.DisplayFormName" HeaderStyle-Width="40%" />
                <telerik:GridBoundColumn HeaderText="Question #" UniqueName="QuestionNumber" DataField="Question.QuestionNumber" HeaderStyle-Width="15%" />
                <telerik:GridBoundColumn HeaderText="Status" UniqueName="QuestionnaireStatusName" DataField="QuestionnaireStatus.QuestionnaireStatusName" HeaderStyle-Width="15%" />
                <telerik:GridBoundColumn HeaderText="Submitted By" UniqueName="SubmittedBy" DataField="Questionnaire.SubmittedBy" HeaderStyle-Width="15%" />
                <telerik:GridBoundColumn HeaderText="Submitted On" UniqueName="SubmittedOn" DataField="Questionnaire.SubmittedOn" HeaderStyle-Width="15%" />
            </Columns>
            <NestedViewTemplate>
                <div id="divChoiceMain" class="pad10">
                    <div class="divChoiceTextSection">
                        <div class="divChoiceTextLeftSection">Form:</div>
                        <div class="divFloatLeft">
                            <asp:Label ID="lblFormName" runat="server" Text='<%# Eval("Form.DisplayFormName")%>'/>
                        </div>
                    </div>
                    <div class="divChoiceTextSection">
                        <div class="divChoiceTextLeftSection">Question #:</div>
                        <div class="divFloatLeft">
                            <div>
                                <asp:Label ID="lblQuestionNumber" runat="server" Text='<%#Eval("Question.QuestionNumber")%>'/>
                            </div>
                        </div>
                    </div>
                    <div class="divChoiceTextCorrectiveActionSection">
                        <div class="divFloatLeft padtop5" style="margin-left:100px;">
                            <ar:ReviewConfigurationToolTipUC ID="reviewConfigurationToolTipUC" runat="server" />
                        </div>
                    </div>
                </div>
                <div class="clearfix pad10">
                    <div class="divChoiceTextSection">
                        <div class="divFloatLeft padRight10">
                            <asp:LinkButton ID="lnkBtnSave" runat="server" Text="Save" CommandName="Save" CommandArgument='<%#Eval("Question.QuestionId")%>'></asp:LinkButton>
                        </div>
                        <div class="divFloatLeft padRight10">
                            <asp:LinkButton ID="lnkSaveAndSubmit" runat="server" Text="Save & Submit" CommandName="Submit" CommandArgument='<%#Eval("Question.QuestionId")%>'></asp:LinkButton>
                        </div>
                        <div class="divFloatLeft">
                            <asp:LinkButton ID="lnkBtnCancel" runat="server" Text="Cancel" CommandName="Cancel"></asp:LinkButton>
                        </div>
                    </div>
                </div>
            </NestedViewTemplate>
        </MasterTableView>
    </telerik:RadGrid>



protected void radGridQuestionnaire_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                GridNestedViewItem gridNestedViewItemObj = e.Item as GridNestedViewItem;
                if (gridNestedViewItemObj == null)
                {
                    return;
}

                if (gridNestedViewItemObj.OwnerTableView.DataKeyValues != null)
                {
                    int? questionId = gridNestedViewItemObj.OwnerTableView.DataKeyValues[0]["Question.QuestionId"].ToNullableInt32();
                    if (questionId.HasValue)
                    {
                        ReviewConfigurationToolTipUC reviewConfigurationToolTipUCObj = gridNestedViewItemObj.FindControl("reviewConfigurationToolTipUC") as ReviewConfigurationToolTipUC;
                        
                        if (reviewConfigurationToolTipUCObj != null)
                        {
                            //Create FormQuestion Obj.
                            FormQuestion formQuestionObj = new FormQuestion { QuestionId = questionId };
                            reviewConfigurationToolTipUCObj.BuildToolTip(string.Empty, formQuestionObj, null);

                        }
                    }
                }
            }
        }
Jignesh
Top achievements
Rank 1
 answered on 12 Nov 2013
9 answers
263 views
So this is really simple.  I want to load the same ascx 'x' number of times.  And based on the Session Information, load the page a certain way.  And I have that functionality working perfectly.

However, what happens is while clicking on the tabs.  The radpageviews will no longer load, or be stuck on a previous page. Also, I noticed sometimes when the page renders the multipage it's a child of an already existing multipage.

Below is code for the entire project.  Any help or a way to work with this idea would be fantastic.  Thanks.


All the code I got to load the dynamic pages comes from the online demo.   Thanks!

default.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<!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>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        function onTabSelecting(sender, args) {
            if (args.get_tab().get_pageViewID()) {
                args.get_tab().set_postBack(false);
            }
        }
    </script>
    <telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" Skin="MetroTouch">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" EnablePageHeadUpdate="true">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStrip1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStrip1"></telerik:AjaxUpdatedControl>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadMultiPage1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadMultiPage1"></telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1"
        Skin="MetroTouch" Align="Justify" Orientation="VerticalLeft" OnTabClick="RadTabStrip1_TabClick"
        Width="1000" OnClientTabSelecting="onTabSelecting">
    </telerik:RadTabStrip>
    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" OnPageViewCreated="RadMultiPage1_PageViewCreated">
    </telerik:RadMultiPage>
    <div>
    </div>
    </form>
</body>
</html>

default.aspx.cs
using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Session["RSession"] = new RSession.UserSession();
            RadTabStrip_Populating();
        }
    }

    protected void RadTabStrip_Populating()
    {
        string[] tabValues = { "String|A M A|ApplePumpkinButter|MyChoices", "Decimal|Base Happy Go Lucky turtle|BaseHappyGoLuckyturtle|MyHappyFunDay", "Decimal|Base Mountain Slopes|BaseMountainSlopes|MyFunWithTabs", "Decimal|Base Ski Slopes|BaseSkiSlopes|MyFunWithTabs", "Decimal|BaseSkiSlopeAdjustedHight|BaseSkiSlopeAdjustedHight|MoreFunWithTabs" };
        foreach (string tv in tabValues)
        {
            RadTab RT = new RadTab();
            RT.Text = tv.Split('|')[1];
            RT.Value = tv;
            RT.Width = Unit.Pixel(300);
            RadTabStrip1.Tabs.Add(RT);
        }
    }

    protected void RadMultiPage1_PageViewCreated(object sender, RadMultiPageEventArgs e)
    {
        string userControlName = "dynamicbuilder.ascx";

        Control userControl = Page.LoadControl(userControlName);
        userControl.ID = e.PageView.ID.Replace(" ", "").Replace("|", "") + "_userControl";

        e.PageView.Controls.Add(userControl);
    }

    private void AddPageView(RadTab tab)
    {
        RadPageView pageView = new RadPageView();
        pageView.ID = tab.Text.Replace(" ", "");
        RadMultiPage1.PageViews.Add(pageView);
        tab.PageViewID = pageView.ID;
    }

    protected void RadTabStrip1_TabClick(object sender, RadTabStripEventArgs e)
    {
        ((RSession.UserSession)Session["RSession"]).CurrentParameterDT = e.Tab.Value.ToString().Split('|')[0].ToString();
        ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH = e.Tab.Value.ToString().Split('|')[1].ToString();
        ((RSession.UserSession)Session["RSession"]).CurrentParameterFName = e.Tab.Value.ToString().Split('|')[2].ToString();
        ((RSession.UserSession)Session["RSession"]).CurrentParameterTName = e.Tab.Value.ToString().Split('|')[3].ToString();
        AddPageView(e.Tab);
        e.Tab.PageView.Selected = true;
    }
}

dynamicbuilder.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="dynamicbuilder.ascx.cs"
    Inherits="dynamicbuilder" %>
<asp:Panel ID="Panel_Dec" runat="server" Visible="false">
    <div style="padding-top: 10px;">
        <div style="float: left; padding-left: 15px;">
            <asp:Label runat="server" ID="Label_NumericStartingValue"></asp:Label>
        </div>
        <br />
        <div style="padding-top: 10px;">
            <div style="float: left; padding-left: 15px;">
                <asp:Label runat="server" ID="Label_NumericEndingValue"></asp:Label>
                 
            </div>
</asp:Panel>
<asp:Panel ID="Panel_NV" runat="server" Visible="false">
    <asp:Label runat="server" ID="Label2" Text="nvarchar"></asp:Label>
</asp:Panel>
<asp:Panel ID="Panel_DT" runat="server" Visible="false">
    <div style="padding-top: 10px;">
        <div style="float: left; padding-left: 15px;">
            <asp:Label runat="server" ID="Label_StartDate"></asp:Label>
        </div>
        <br />
        <br />
        <div style="float: left; padding-left: 15px;">
            <asp:Label runat="server" ID="Label_EndDate"></asp:Label>
        </div>
    </div>
</asp:Panel>
<asp:Panel ID="Panel_SP" runat="server" Visible="false">
    <asp:Label runat="server" ID="Label4" Text="Special"></asp:Label>
</asp:Panel>

dynamicbuilder.ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
public partial class dynamicbuilder : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
        HidePanels();
        string casestatement = ((RSession.UserSession)Session["RSession"]).CurrentParameterDT.ToLower();
        switch (casestatement)
        {
            case ("string"):
                if (SpecialFields.Contains(((RSession.UserSession)Session["RSession"]).CurrentParameterFName.ToLower()))
                {
                    Process_Special();
                }
                else
                {
                    Process_NVarChar();
                }
                break;
            case ("integer"):
                Process_Decimal();
                break;
            case ("decimal"):
                Process_Decimal();
                break;
            case ("datetime"):
                Process_DateTime();
                break;
 
        }
    }
 
    protected void HidePanels()
    {
        string casestatement = ((RSession.UserSession)Session["RSession"]).CurrentParameterDT.ToLower();
        switch (casestatement)
        {
            case ("string"):
                if (SpecialFields.Contains(((RSession.UserSession)Session["RSession"]).CurrentParameterFName.ToLower()))
                {
                    Panel_NV.Visible = false;
                    Panel_DT.Visible = false;
                    Panel_Dec.Visible = false;
                    Panel_SP.Visible = true;
                }
                else
                {
                    Panel_NV.Visible = true;
                    Panel_DT.Visible = false;
                    Panel_Dec.Visible = false;
                    Panel_SP.Visible = false;
                }
                break;
            case ("integer"):
 
                Panel_NV.Visible = false;
                Panel_DT.Visible = false;
                Panel_Dec.Visible = true;
                Panel_SP.Visible = false;
                break;
            case ("decimal"):
                Panel_NV.Visible = false;
                Panel_DT.Visible = false;
                Panel_Dec.Visible = true;
                Panel_SP.Visible = false;
                break;
            case ("datetime"):
                Panel_NV.Visible = false;
                Panel_DT.Visible = true;
                Panel_Dec.Visible = false;
                Panel_SP.Visible = false;
                break;
        }
 
    }
 
    protected void Process_NVarChar()
    {
 
 
    }
    protected void Process_DateTime()
    {
        Label_StartDate.Text = ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH + ": Starting Date";
        Label_EndDate.Text = ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH + ": Ending Date";
    }
    protected void Process_Decimal()
    {
 
        Label_NumericStartingValue.Text = ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH + ": Starting Value";
        Label_NumericEndingValue.Text = ((RSession.UserSession)Session["RSession"]).CurrentParameterFLH + ": Ending Value";
    }
    protected void Process_Special()
    {
 
 
    }
 
    protected string[] SpecialFields = { "mn", "ve" };
}

SessionControl.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
 
public static class RSession
{
 
    public class UserSession
    {
 
        public string CurrentParameterTName
        {
            get;
            set;
        }
 
        public string CurrentParameterFName
        {
            get;
            set;
        }
 
        public string CurrentParameterFLH
        {
            get;
            set;
        }
        public string CurrentParameterDT
        {
            get;
            set;
        }
 
    }
}


Dimitar Terziev
Telerik team
 answered on 12 Nov 2013
7 answers
320 views
Hi,

Currently, I am referencing http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/batchediting/defaultcs.aspx

But I have no idea how to get the red angle dirty mark after changing.

Thank you so much.
Allen
Top achievements
Rank 1
 answered on 12 Nov 2013
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?