Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
1.3K+ views
Hi,

I have the following script file.  In the text I am entering the \\n to display a new line but when the alert opens the text is not on a new line.  I have tried \n, \\n and \\n\r but none of these creates a new line.  How do I get a new line to display in the rad alert.

/*This function displays a confirm dialog box when the user clicks the delete button */
function DeleteOnClientClickingExternal(sender, args, radGrid) {   
    var MasterTable = radGrid.get_masterTableView();
    var selectedRows = MasterTable.get_selectedItems();
    if (selectedRows.length > 0) {
        var callBackFunction = Function.createDelegate(sender, function(argument) {
            if (argument) {
                this.click();
            }
        });
        var text = "This process CANNOT be un-done.\\nAre you sure you want to delete this record?.";
        radconfirm(text, callBackFunction, 500, 100, null, "Delete Record");
        args.set_cancel(true);

    }
    else {
        alert('You must select a row to be deleted.');
        args.set_cancel(true);
    }
}

Thank you for you help.

Tracy
Shinu
Top achievements
Rank 2
 answered on 14 May 2012
1 answer
89 views
Hello!

I would like to know if there is a way to find all the ComboBoxes contained in a div and set their value attribute to "-1".

Actually I have several Rad Controls (ComboBox, NumericalTextBox, TextBox) contained in a div and I would like to find them all and set them to initial values as the div is hidden, using Javascript.
I can do this server-side but client-side is the new requirement.

Any Ideas?
Dimitar Terziev
Telerik team
 answered on 14 May 2012
1 answer
115 views
Is it possible to have a node styled like panel bar item in the treeview, in such a way that the expand collapse icons comes on the right hand side of the text instead of left side. I wanted some nodes to behave like panel bar and child nodes under it like normal treeview.
Plamen
Telerik team
 answered on 14 May 2012
3 answers
113 views
Hi,
I have a RadTree in User Control A & RadioButtonList in another User Control B under my main aspx page. When I check a node in RadTree in User Control A., I want to get selected index of RadioButtonList 
in User Control B. How i'm i supposed to get the output.??

Regards,
Aditya
Kate
Telerik team
 answered on 14 May 2012
1 answer
248 views
I have some radtextboxes on my website with maximum character limits such as 50 chars, because this is the size of the database field that the control is saved to. Now it has happened that users have tried to enter more text but the ui won't let them. So they phone up and complain that the website is broken. Is there a way to fire an event if they try to type more chars than the field allows? Then i could pop up an explanatory warning message to tell them that 50 chars is the limit. I don't want to clutter the ui with on-screen labels saying "this box accepts 50 chars max" when 99% of people will never exceed this limit. Any suggestions? Thanks
Princy
Top achievements
Rank 2
 answered on 14 May 2012
11 answers
465 views
1.I have used required field validators for some input in my edit form of Radgrid. When I click cancel button it fires the validation event first and the Popup form gets closed.

2.When I click 'Update' with some fields left empty it causes validation.If I click cancel when the validation message exists, nothing is happening. On second click only the Pop up form gets closed. I have used the AutoGenerated EditFormType. Because of this I cant get the button id for 'cancel' and make the CausesValidation false.

I am not sure why the validation happening for cancel button ? I think because of this Problem 2 might have happened.

Thanks in Advance.

Regards,
VIjay
Vasil
Telerik team
 answered on 14 May 2012
1 answer
153 views
Hello,
I have a problem with RadFormDecorator, using CreateUserWizard does not apply to the element of style elements TexBox and Button.

<form id="form1" runat="server">
    <telerik:RadScriptManager ID="RpScriptManager" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <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">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RpAjaxManager" runat="server">
    </telerik:RadAjaxManager>
    <telerik:RadSkinManager ID="RpSkinManager" runat="server" Skin="Black">
    </telerik:RadSkinManager>
    <div>
        <!-- Logo & Navigation -->
        <div class="logo">
            <div style="float: right; width: 150px; margin: 40px 10px 10px 10px">
                <asp:ImageButton runat="server" ID="loginBtn" ImageUrl="../styles/images/login.png"
                    Width="30px" Height="30px" ToolTip="Login" OnClick="loginBtn_Click" />
                <asp:ImageButton runat="server" ID="registerBtn" ImageUrl="../styles/images/signIn.png"
                    Width="30px" Height="30px" ToolTip="Create new account" Style="margin-left: 10px"
                    OnClick="registerBtn_Click" />
                <asp:ImageButton runat="server" ImageUrl="~/styles/images/logout.png" ID="logoutBtn"
                    Width="30px" Height="30px" ToolTip="Log Out" Visible="false" OnClick="logoutBtn_Click" />
                <asp:Label runat="server" ID="userNameLbl" Font-Size="18px" ForeColor="White" Visible="false" />
            </div>
            <div id="navigation">
                <telerik:RadMenu ID="MainMenu" runat="server" Skin="Bond" EnableEmbeddedBaseStylesheet="False"
                    EnableEmbeddedSkins="False" EnableTextHTMLEncoding="true">
                    <Items>
                        <telerik:RadMenuItem runat="server" Text="Main" NavigateUrl="~/Default.aspx">
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" Text="Investment Scheme" NavigateUrl="~/Pages/InvestScheme.aspx">
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" NavigateUrl="~/Pages/Products.aspx" Text="Products">
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" NavigateUrl="~/Pages/Help.aspx" Text="Need help">
                        </telerik:RadMenuItem>
                        <telerik:RadMenuItem runat="server" NavigateUrl="~/Pages/Support.aspx" Text="Support">
                        </telerik:RadMenuItem>
                    </Items>
                </telerik:RadMenu>
            </div>
        </div>
        <!-- Content -->
        <telerik:RadFormDecorator ID="RpFormDecorator" runat="server" Skin="Black" DecorationZoneID="displayWizard" DecoratedControls="LoginControls" />
        <div id="regZone" style="width: 900px; margin: 0 auto" align="center">
            <asp:Image runat="server" ID="newUserImg" ImageUrl="~/styles/images/Actions-list-add-user-icon.png"
                Width="256px" Height="256px" Style="float: left; margin: 5px 20px 5px 60px" />
            <div id="displayWizard" style="padding-top: 50px">
                <asp:CreateUserWizard ID="CreateUserWizard1" runat="server" FinishDestinationPageUrl="~/Pages/User/Profile.aspx"
                    ContinueDestinationPageUrl="~/Pages/User/Profile.aspx">
                    <WizardSteps>
                        <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server">
                        </asp:CreateUserWizardStep>
                        <asp:CompleteWizardStep ID="CompleteWizardStep1" runat="server">
                        </asp:CompleteWizardStep>
                    </WizardSteps>
                </asp:CreateUserWizard>
            </div>
        </div>
        <!-- Footer -->
        <br class="cleared" />
        <div class="footer">
        </div>
    </div>
    </form>


Thanks for any advice...
Bozhidar
Telerik team
 answered on 14 May 2012
2 answers
136 views
Hey all,

we are localizing the radgrid and so far we are doing fine with the global resources approach. We took the resx file which came with the installation and translated all the labels. Though 1 seems to be missing. It's the one from the pager which says:
english:            Page 1 of 4, items 1 to 30 of 91 (see also from Telerik demo site: http://www.telerik.com/help/aspnet-ajax/grid-basic-paging.html)
translates into: Page 1 van 4, items 1 tot 30 van 91

I am missing the 'Page' part, which label is it?

Thanks in advance



RR SoftSol
Top achievements
Rank 1
 answered on 14 May 2012
12 answers
354 views
On "page 1" of a project I have a radgrid bound to a datasource. After selecting a record from the list and navigating to "page 2" then changing record values. Upon returning to "page 1" - I need to rebind the grid to show changes. I have researched and tried many different options with no luck.

Thanks,

Steve O

Page 1
----------------------------------------------------------------------------------------------

 

<telerik:radgrid id="RadGrid1"

 

 

runat="server"

 

 

AllowAutomaticDeletes="True"

 

 

AllowSorting="True"

 

 

AllowPaging="True"

 

 

PagerStyle-HorizontalAlign="Center"

 

 

AllowMultiRowEdit="false"

 

 

AllowMultiRowSelection="false"

 

 

OnItemDataBound="RadGrid1_ItemDataBound"

 

 

OnItemUpdated="RadGrid1_ItemUpdated"

 

 

OnUpdateCommand="RadGrid1_ItemUpdate"

 

 

OnSelectedIndexChanged="RadGrid1_SelectedIndexChanged"

 

 

OnNeedDataSource="RadGrid1_NeedDataSource"

 

 

GridLines="None">

 

 

 

<ClientSettings EnablePostBackOnRowClick="true" >

 

 

<Selecting AllowRowSelect="True" />

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

</ClientSettings>

 

 

<MasterTableView runat="server"

 

 

DataKeyNames="CaseNbr, Article, Item"

 

 

AllowSorting="true"

 

 

CommandItemDisplay="Top"

 

 

AutoGenerateColumns="false">

 

 

 

<EditFormSettings EditFormType="Template">

 

 

<EditColumn UniqueName="EditColumn"></EditColumn>

 

 

<FormTemplate>

 

 

<table>

 

 

<tr>

 

 

</tr>

 

 

</table>

 

 

</FormTemplate>

 

 

</EditFormSettings>

 

 

<CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="true" />

 

 

 

<Columns>

 

 

 

<telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderText="Select" HeaderStyle-HorizontalAlign="Left" ItemStyle-Width="20px"></telerik:GridClientSelectColumn>

 

 

<telerik:GridBoundColumn DataField="RecCode" UniqueName="RecCode" Visible="false"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="CaseNbr" HeaderText="Case Nbr" HeaderStyle-Font-Bold="true" HeaderStyle-Wrap="true" UniqueName="CaseNbr" SortExpression="CaseNbr" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Vic1" HeaderText="Victim" HeaderStyle-Font-Bold="true" HeaderStyle-Wrap="true" UniqueName="Vic1" SortExpression="Vic1" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Item" HeaderText="Item" HeaderStyle-Font-Bold="true" UniqueName="Item" SortExpression="Item" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Article" HeaderText="Art" HeaderStyle-Font-Bold="true" UniqueName="Article" SortExpression="Article" HeaderStyle-HorizontalAlign="Center"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ArticleType" HeaderText="Art Type" HeaderStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" HeaderStyle-Wrap="true" UniqueName="ArticleType" SortExpression="ArticleType" Visible="true"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="ArticleName" HeaderText="Art Name" HeaderStyle-Font-Bold="true" HeaderStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" UniqueName="ArticleName" SortExpression="ArticleName" Visible="true" ></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="SerialNbr" HeaderText="Serial #" HeaderStyle-Font-Bold="true" HeaderStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" UniqueName="SerialNbr" SortExpression="SerialNbr" Visible="true"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="Location" HeaderText="Loc" HeaderStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" UniqueName="Location" SortExpression="Location"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="NextAct" HeaderText="NextAct" HeaderStyle-Font-Bold="true" HeaderStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" UniqueName="NextAct" SortExpression="NextAct"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="NextActDate" HeaderText="Next Date" HeaderStyle-Font-Bold="true" HeaderStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" UniqueName="NextActDate" SortExpression="NextActDate"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="FinalAct" HeaderText="FinalAct" HeaderStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" UniqueName="FinalAct" SortExpression="FinalAct" ItemStyle-Width="50px"></telerik:GridBoundColumn>

 

 

<telerik:GridBoundColumn DataField="FinalActDate" HeaderText="Final Date" HeaderStyle-Font-Bold="true" HeaderStyle-Wrap="true" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" ItemStyle-Wrap="true" UniqueName="FinalActDate" SortExpression="FinalActDate"> </telerik:GridBoundColumn>

 

 

 

</Columns>

 

 

<EditFormSettings>

 

 

<EditColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"

 

 

CancelImageUrl="~/Images/filterCancel.png"

 

 

UpdateImageUrl="~/Images/selecttag.png"

 

 

InsertImageUrl="~/Images/selecttag.png">

 

 

</EditColumn>

 

 

 

<FormTemplate>

 

 

<table>

 

 

<tr>

 

 

</tr>

 

 

</table>

 

 

</FormTemplate>

 

 

</EditFormSettings>

 

 

<CommandItemTemplate>

 

 

 

<table>

 

 

 

<tr>

 

 

<td style="width:30%">&nbsp;</td>

 

 

 

<td>

 

 

<asp:LinkButton ID="LinkButton8" OnClick="Gang_Update_Click" Text="Gang Update" Runat="server" Font-Size="Large" ForeColor="DarkRed" Font-Underline="true" Font-Bold="true" ToolTip="Update Selected Item"></asp:LinkButton>

 

 

</td>

 

 

 

<td style="width:28%; text-align:right;">

 

 

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Images/Refresh.gif" CommandName="Rebind" ToolTip="Refresh" />

 

 

</td>

 

 

<td style="width:1%; text-align:right; vertical-align:top">

 

 

<asp:LinkButton ID="LinkButton1" Text="Refresh" CommandName="Rebind" Runat="server"></asp:LinkButton>

 

 

</td>

 

 

<td style="width:1%">&nbsp;</td>

 

 

 

</tr>

 

 

 

</table>

 

 

 

</CommandItemTemplate>

 

 

 

</MasterTableView>

 

 

 

<ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">

 

 

<Scrolling AllowScroll="True" UseStaticHeaders="True" />

 

 

<Selecting AllowRowSelect="True" />

 

 

</ClientSettings>

 

 

<FilterMenu EnableImageSprites="False">

 

 

</FilterMenu>

 

 

</telerik:radgrid>

 


---------------------------------------------------------------------------------------------------------------

namespace

 

Evidence.Forms

 

{

 

public partial class Results : System.Web.UI.Page

 

{

 

private string gridMessage = null;

 

 

string status = "";

 

 

string qType = "";

 

 

string casenbr = "";

 

 

string item = "";

 

 

string art = "";

 

 

string article = "";

 

 

string name = "";

 

 

string arttype = "";

 

 

string artname = "";

 

 

string sernbr = "";

 

 

string fdate;

 

 

string tdate;

 

 

string uName = "";

 

 

//DateTime fdate;

 

 

//DateTime tdate;

 

 

static string prevPage = String.Empty;

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

 

if (!Page.IsPostBack)

 

{

 

string userName = HttpContext.Current.User.Identity.Name;

 

Session[

"Name"] = userName.Substring(userName.LastIndexOf('\\') + 1);

 

uName = userName.Substring(userName.LastIndexOf(

'\\') + 1);

 

 

Evidence_UserCollection records = new Evidence_UserCollection().Where("UserName", uName).Load();

 

Session[

"Access"] = "";

 

 

RadMenu menu = (RadMenu)Master.FindControl("RadMenu1");

 

 

RadMenuItem admin = menu.FindItemByText("Administration");

 

 

RadMenuItem delete = menu.FindItemByText("Delete");

 

 

//admin = menu.FindItemByText("Access");

 

 

// configure access prive based on role assigned

 

 

if (records.Count() > 0)

 

{

 

//GridItem cmdItem = RadGrid1.MasterTableView.GetItems(GridItemType.CommandItem)[0];

 

 

Evidence_User record = records.First();

 

 

switch (record.RoleId)

 

{

 

case 1:

 

admin.Visible =

true;

 

 

//cmdItem.FindControl("LinkButton2").Visible = true;

 

 

//cmdItem.FindControl("LinkButton3").Visible = true;

 

 

break;

 

 

case 2:

 

admin.Visible =

false;

 

 

//cmdItem.FindControl("LinkButton2").Visible = false;

 

 

//cmdItem.FindControl("LinkButton3").Visible = false;

 

 

break;

 

 

default:

 

admin.Visible =

false;

 

 

//cmdItem.FindControl("LinkButton2").Visible = false;

 

 

//cmdItem.FindControl("LinkButton3").Visible = false;

 

 

break;

 

}

}

 

Evidence_UserCollection users = new Evidence_UserCollection().Where("UserName", uName).Load();

 

Session[

"Access"] = "";

 

 

if (users.Count() > 0)

 

{

RadGrid1.MasterTableView.Columns[11].Visible =

true;

 

}

 

else

 

{

RadGrid1.MasterTableView.Columns[11].Visible =

false;

 

}

 

// first retrieve the query type and values and run the stored proc

 

 

//status = Request.QueryString["status"].ToUpper();

 

qType = Request.QueryString[

"qType"].ToUpper();

 

name = Request.QueryString[

"name"].ToUpper();

 

casenbr = Request.QueryString[

"casenbr"].ToUpper();

 

item = Request.QueryString[

"item"].ToUpper();

 

art = Request.QueryString[

"art"].ToUpper();

 

arttype = Request.QueryString[

"arttype"].ToUpper();

 

artname = Request.QueryString[

"artname"].ToUpper();

 

sernbr = Request.QueryString[

"sernbr"].ToUpper();

 

 

if (string.IsNullOrEmpty(name))

 

{

name =

null;

 

}

 

if (string.IsNullOrEmpty(casenbr))

 

{

casenbr =

null;

 

}

 

if (string.IsNullOrEmpty(item))

 

{

item =

null;

 

}

 

if (string.IsNullOrEmpty(art))

 

{

art =

null;

 

}

 

if (string.IsNullOrEmpty(arttype))

 

{

arttype =

null;

 

}

 

if (string.IsNullOrEmpty(artname))

 

{

artname =

null;

 

}

 

if (string.IsNullOrEmpty(sernbr))

 

{

sernbr =

null;

 

}

fdate = Request.QueryString[

"fDate"];

 

tdate = Request.QueryString[

"tDate"];

 

Session[

"status"] = status;

 

Session[

"qtype"] = qType;

 

Session[

"name"] = name;

 

Session[

"casenbr"] = casenbr;

 

Session[

"item"] = item;

 

Session[

"art"] = art;

 

Session[

"arttype"] = arttype;

 

Session[

"artname"] = artname;

 

Session[

"sernbr"] = sernbr;

 

Session[

"fdate"] = fdate;

 

Session[

"tdate"] = tdate;

 

 

if (!string.IsNullOrEmpty(fdate))

 

{

fdate = fdate.Substring(1, fdate.IndexOf(

" ") - 1);

 

}

 

if (!string.IsNullOrEmpty(tdate))

 

{

tdate = tdate.Substring(1, tdate.IndexOf(

" ") - 1);

 

}

 

if (RadGrid1.Items.Count > 0)

 

{

RadGrid1.DataBind();

}

}

}


 

protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)

 

{

 

//status = Request.QueryString["status"].ToUpper();

 

qType = Request.QueryString[

"qType"].ToUpper();

 

name = Request.QueryString[

"name"].ToUpper();

 

casenbr = Request.QueryString[

"casenbr"].ToUpper();

 

item = Request.QueryString[

"item"].ToUpper();

 

art = Request.QueryString[

"art"].ToUpper();

 

arttype = Request.QueryString[

"arttype"].ToUpper();

 

artname = Request.QueryString[

"artname"].ToUpper();

 

sernbr = Request.QueryString[

"sernbr"].ToUpper();

 

fdate = Session[

"fdate"].ToString();

 

tdate = Session[

"tdate"].ToString();

 

 

DataSet ds = SPs.Get_Evidence(qType, name, casenbr, item, art, arttype, artname, sernbr, fdate, tdate, status).GetDataSet();

 

RadGrid1.VirtualItemCount = ds.Tables[0].Rows.Count;

RadGrid1.DataSource = ds;

}

Shinu
Top achievements
Rank 2
 answered on 14 May 2012
4 answers
199 views
I try to use RadWindow component in developement of some kind of report designer having scrollable div set as restriction zone for on client side dynamically created window components. But even if i pine current window on needed location, any upwards scroll operation on RestrictionZoneID element results that window are getting over bottom visible bound of that scrollable div. (see attached screenshot)
Is there any way how to solve this problem ?

Nanda
Top achievements
Rank 1
 answered on 14 May 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?