Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
164 views
Hello,
I have a RadNumeric textbox with the spinbuttons enabled.  When I change the value of the RadNumericTextBox using the spin buttons, the

window.onbeforeunload event fires.  Is there a way to prevent this from happening?

siva
Top achievements
Rank 1
 answered on 10 Jan 2011
1 answer
63 views

Hi
I use this code for invisibling components in grid when I click on "Add New Record" but in running program the error "Object reference not set to an instance of an object." occured. how can I write this code that not cause this error?

 

 

 

 

 

 

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

 

 

 

 

 

{

 

 

protected void Page_Load(object sender, EventArgs e)

 

{

rwmSuccessPM.Visible =

 

false;

 

}

 

 

private void InitalizeGroupGrid()

 

{

 

 

IQueryable<CDS.Savin.DataAccess.tS000Group> groups = CDS.Savin.Logic.BusinessObjects.UI.Groups.RetriveAll();

 

 

 

this.grdGroups.DataSource = groups;

 

 

 

this.grdGroups.DataBind();

 

}

 

 

protected void grdGroups_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

 

 

IQueryable<CDS.Savin.DataAccess.tS000Group> groups = CDS.Savin.Logic.BusinessObjects.UI.Groups.RetriveAll();

 

 

 

this.grdGroups.DataSource = groups;

 

}

 

 

protected void grdGroups_EditCommand(object source, GridCommandEventArgs e)

 

{

 

 

 

 

 

 

 

GridDataItem item = (GridDataItem)e.Item;

 

rowindex = item.ItemIndex;

 

 

String id = item.GetDataKeyValue("GroupID").ToString();

 

Session[

 

"GroupID"] = id;

 

 

 

 

 

 

 

}

 

 

int rowindex = -1;

 

 

 

 

protected void grdGroups_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

 

//GridEditFormInsertItem editItem = (GridEditFormInsertItem)grdGroups.MasterTableView.GetInsertItem();

 

 

 

 

 

 

 

// System.Web.UI.UserControl userControl = (System.Web.UI.UserControl)editItem.FindControl(GridEditFormItem.EditFormUserControlID);

 

 

 

 

 

 

 

//if (e.CommandName == RadGrid.EditCommandName)

 

 

 

 

 

 

 

//{

 

 

 

 

 

 

 

// GridDataItem item = (GridDataItem)e.Item;

 

 

 

 

 

 

 

// rowindex = item.ItemIndex;

 

 

 

 

 

 

 

//}

 

 

 

 

 

 

 

switch (e.CommandName)

 

{

 

 

case RadGrid.InitInsertCommandName:

 

{

 

 

 

 

System.Web.UI.

 

UserControl userControl = (System.Web.UI.UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);

 

 

 

 

 

 

 

RadGrid Grid1 = (RadGrid)userControl.FindControl("PermissionGrid");

 

Grid1.Visible =

 

false;

 

 

 

CheckBox chkWrite = (CheckBox)userControl.FindControl("chkWrite");

 

chkWrite.Visible =

 

false;

 

 

 

CheckBox chkRead = (CheckBox)userControl.FindControl("chkRead");

 

chkRead.Visible =

 

false;

 

 

 

CheckBox chkModify = (CheckBox)userControl.FindControl("chkModify");

 

chkModify.Visible =

 

false;

 

 

 

CheckBox chkDelete = (CheckBox)userControl.FindControl("chkDelete");

 

chkDelete.Visible =

 

false;

 

 

 

break;

 

}

 

 

 

case "Delete":

 

{

 

 

 

 

}

 

 

protected void grdGroups_PreRender(object sender, EventArgs e)

 

{

 

 

if (grdGroups.MasterTableView.IsItemInserted)

 

{

 

 

GridEditFormInsertItem editItem = (GridEditFormInsertItem)grdGroups.MasterTableView.GetInsertItem();

 

System.Web.UI.

 

UserControl userControl = (System.Web.UI.UserControl)editItem.FindControl(GridEditFormItem.EditFormUserControlID);

 

 

 

TextBox txtbox = (TextBox)userControl.FindControl("txtGroupName");

 

 

 

RadGrid Grid1 = (RadGrid)userControl.FindControl("PermissionGrid");

 

 

 

 

 

}

 

 

if (rowindex > -1)

 

{

 

 

GridEditFormItem editItem = (GridEditFormItem)grdGroups.MasterTableView.GetItems(GridItemType.EditFormItem)[rowindex];

 

 

 

GridDataItem item = (GridDataItem)editItem.ParentItem;

 

System.Web.UI.

 

UserControl userControl = (System.Web.UI.UserControl)editItem.FindControl(GridEditFormItem.EditFormUserControlID);

 

 

 

TextBox txtbox = (TextBox)userControl.FindControl("txtGroupName");

 

 

 

 

 

rowindex = 1;

 

 

IQueryable<CDS.Savin.DataAccess.tS000Group> GroupName = CDS.Savin.Logic.BusinessObjects.UI.Groups.RetriveGroupName(int.Parse(item.Cells[3].Text));

 

txtbox.Text = GroupName.First().GroupName;

 

 

RadGrid Grid1 = (RadGrid)userControl.FindControl("PermissionGrid");

 

Grid1.DataSource = CDS.Savin.Logic.BusinessObjects.UI.

 

GroupPermissions.Retrieve(int.Parse(item.Cells[3].Text));

 

Grid1.DataBind();

 

 

 

 

 

 

 

 

 

 

 

 

rowindex = -1;

}

 

 

 

 

}

 

}

 

Princy
Top achievements
Rank 2
 answered on 10 Jan 2011
8 answers
171 views
Dear Telerik hello,

i have a problem with the values, in Stacked Bar (Horizontal orientation). See Attached image.
Can i change the position of the values to the end of the second bar (with different color), like the example in the image??

How can i fix this??
ASAP please.

Thank you in advance for your time.

Best Regards,
George.
Navarino Technology Dept.
Technology
Top achievements
Rank 1
 answered on 10 Jan 2011
1 answer
64 views
I am trying to click a submit button after loading and pre-populating and pre-selecting a value of two radcomboboxes.

If I try it with this code: (the setting for the second radcombobox is: EnableAutomaticLoadOnDemand="True" )

<tr>
                    <td colspan="2"> <b> Supervisor Name </b></td>
                    <td colspan="3">
                        <asp:HiddenField ID="CRAFT_CODE_Textbox" runat="server" value="H" />
                        <asp:HiddenField ID="SUPV_ID_TextBox" runat="server" />
                        <br />
                        <telerik:RadComboBox ID="wcOfficerName" Runat="server" 
                            DataSourceID="sdsOfficer" DataTextField="FULL_NAME" 
                            DataValueField="SUPV_ID" EnableAutomaticLoadOnDemand="False" 
                            EnableItemCaching="True" EnableLoadOnDemand="False" 
                            EnableVirtualScrolling="False" Filter="StartsWith" ItemsPerRequest="-1" 
                            MarkFirstMatch="False" Width="279px" ShowMoreResultsBox="False" 
                            Skin="Office2007" LoadingMessage="Loading Please Wait..." EmptyMessage="Please Select Supervisor">
                        </telerik:RadComboBox>
                    </td>
                    </tr>
                    <tr>
                    <td colspan="2"> <b> Employee Name</b></td>
                    <td colspan="3">
                        <asp:HiddenField ID="EMPL_ID_TextBox" runat="server" />
                        <br />                   
                        <telerik:RadComboBox ID="wcEmployeeName" Runat="server" 
                            DataSourceID="sdsEmployees" DataTextField="FULL_NAME" 
                            DataValueField="PERSON_ID" EnableAutomaticLoadOnDemand="True" 
                            EnableItemCaching="True" EnableLoadOnDemand="False" 
                            EnableVirtualScrolling="False" Filter="StartsWith" ItemsPerRequest="-1" 
                            MarkFirstMatch="False" Width="279px" ShowMoreResultsBox="False" 
                            Skin="Office2007" LoadingMessage="Loading Please Wait..." EmptyMessage="Please Select Employee">
                        </telerik:RadComboBox>
                       <br />
                    </td>
                </tr>
It works.

However if I change the second radcombobox setting to EnableAutomaticLoadOnDemand="False"  then it errors out when I click the "submit" button.

For the error please see attached "error.jpg"

To set the selectedvalue of each rad box I use the following code in the page load event:
Me.wcEmployeeName.SelectedValue = dataset.Tables(0).Rows(0)(4)
 Me.wcOfficerName.SelectedValue = dataset.Tables(0).Rows(0)(3)

Please help!
Simon
Telerik team
 answered on 10 Jan 2011
2 answers
196 views

I currently am using a Repeater (below) and I want to replace it with a RadGrid control.  

Can I create multi-row headers with a RadGrid control? 

I have other more complex header that span rows etc., are they supported? 
   
     
<asp:Repeater ID="Repeater1" runat="server" EnableViewState="False">  
            <HeaderTemplate> 
                <p> 
                <table width="95%" border="1" cellpadding="3" cellspacing="0">  
                <thead> 
                    <tr class="colTitle">  
                        <th colspan="5" align="center">  
                            <br/> 
                            <%# title%> 
                            <br/> 
                            <br/> 
                            For: <%# reportMonthHeader%> 
                            <br/> 
                            <br/> 
                            Process Date: <%# processDateHeader %> 
                            <br/> 
                            <br/> 
                        </th> 
                    </tr> 
                    <tr class="colTitle">  
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            Contract ID  
                        </th> 
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            Contract Name  
                        </th> 
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            Total Number of Transactions Sent  
                        </th> 
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            Total Number of Transactions Received on Time  
                        </th> 
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            Percent of Transactions Received on Time  
                        </th> 
                    </tr> 
                    <tr class="colTitle">  
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            A  
                        </th> 
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            B  
                        </th> 
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            C  
                        </th> 
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            D  
                        </th> 
                        <th style="font-size: xx-small;" align="center" valign="bottom">  
                            E  
                        </th> 
                    </tr> 
                </thead> 
                <tbody>                      
            </HeaderTemplate> 
            <ItemTemplate> 
                <tr class="<%# Container.ItemIndex % 2 == 0 ? "tblalt" : "" %>">  
                    <td width="15%" style="font-size: xx-small;" align="center" valign="middle">  
                        <%# DataBinder.Eval(Container.DataItem, "ContractId")%> 
                    </td> 
                    <td width="40%" style="font-size: xx-small;" align="center" valign="middle">  
                        <%# DataBinder.Eval(Container.DataItem, "ContractName")%> 
                    </td> 
                    <td width="15%" style="font-size: xx-small;" align="center" valign="middle">  
                        <%# DataBinder.Eval(Container.DataItem, "TotEnrollSent")%> 
                    </td> 
                    <td width="15%" style="font-size: xx-small;" align="center" valign="middle">  
                        <%# DataBinder.Eval(Container.DataItem, "TotRcvdOnTime")%> 
                    </td> 
                    <td width="15%" align="center" valign="middle" style='<%#  (bool)(DataBinder.Eval(Container.DataItem, "HighlightPctRcvdOnTime"))?"font-size:xx-small;font-weight:bold;color:red;text-decoration:underline;":"font-size: xx-small;"%>'>  
                         <%# DataBinder.Eval(Container.DataItem, "PctRcvdOnTime")%> 
                    </td> 
                </tr> 
            </ItemTemplate> 
            <FooterTemplate> 
                </tbody> 
                </table> 
                </p> 
            </FooterTemplate> 
        </asp:Repeater> 
 
Saranya
Top achievements
Rank 1
 answered on 10 Jan 2011
3 answers
55 views
In attempting to make the enter key simulate a click on a button I used the following as a reference: http://www.telerik.com/community/forums/aspnet-ajax/ajax/defaultbutton-and-radajaxpanel.aspx

I put the javascript in a RadCodeBlock and set the body's onkeydown event to call it.  Now the form just keeps loading and never completes.
Here is the entire code (it isn't very large)  The button is on a RadAjaxPanel in the referenced SearchControl.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="HeadSearch" runat="server">
    <title>General Search</title>
    ...
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">  
    <script type="text/javascript">  
    function keyDown(e)  
    {  
        if(e.keyCode == 13)  
        {  
            var ajaxPanel = $find("<%= RadAjaxPanelSearch.ClientID %>");
            var searchButton = $find("<%= ButtonSearch.ClientID %>");
            searchButton.click();
        }  
    }  
    </script>
    </telerik:RadCodeBlock>
</head>
<body onkeydown="keyDown(event);" onload="hideLoading();">
    <form id="FormSearch" runat="server">
    <telerik:RadScriptManager ID="RadScriptManagerPage" runat="server" OnAsyncPostBackError="RadScriptManagerPage_AsyncPostBackError"
        EnableScriptCombine="true" OutputCompression="AutoDetect" EnablePageMethods="true">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/M5.js" NotifyScriptLoaded="true" />
            <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>
    <asp:Panel ID="PanelGeneralSearch" runat="server" CssClass="headingPanel" TabIndex="-1"
        BorderWidth="0" BorderStyle="None">
        <asp:Label ID="HeadingLabel" runat="server" CssClass="headingLabel" TabIndex="-1"></asp:Label>
        <table class="pageContainer">
            <tr>
                <td valign="top">
                    <uc1:SearchControl ID="SearchControl" runat="server" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    </form>
</body>
</html>

old code:
    ...
    <script type="text/javascript">
        function CheckKey() {
            if (event.keyCode == 13) {

                return false;
            }
            return true;
        }

    </script>
    ...
<body onkeydown="return CheckKey(event);" onload="hideLoading();">
Maria Ilieva
Telerik team
 answered on 10 Jan 2011
1 answer
60 views
Hi,

Scenario:
7 Rad Doc Zones and Panels on Master Page
RadMenu on Master Page
One .Net Dropdown List on Master Page

Browser IE 7 +

Issue
Rad Doc Panels gets dissappeard (Stays on the page but are not visible) when we click or do roll over on RadMenu or Drop down list in Runtime.
There is no code written on Click or Roll over events of the RadMenu or Dropdown list.

This problem is not reproduced on any other browsers like Google Chrome, Mozzila, but is Internet Explorer Browser Specific.

What could be the problem.
Pero
Telerik team
 answered on 10 Jan 2011
1 answer
262 views
hello
I am trying to reduce the bandwidth used by my web application. A couple of month ago, i noticed that MicrosoftAjax.js was sent to the client browser in for all pages. I prevent that by publishing my web application in release mode and specify in the web.config/compilation debug=false. But since i upgrade to Telerik 2010 Q3, MicrosoftAjax.js is send again. Do you use this javascript file in telerik components? and is it possible not to include it in the pages sent to the client web browser ?


thanks for your help
sebastien 
Simon
Telerik team
 answered on 10 Jan 2011
1 answer
75 views
I have button on a page in a user control that captures the current screen html, converts it to PDF format and pops up an asp.net form that simulates a new email form with the PDF document attached allowing the user to email a screen print of the current page. This is done by rendering the page twice, once for the PDF creation and then again to rerender the page to the screen. This works fine with non ajax controls, and with ajax controls I simply need to register the script control with the RadScriptManager in the OnPreRender event.

However when I try to do this with a page that has a RadGrid on it I get an issue that I have been unable to resolve. I have enabled ContextFilterMenu oand FilteringByColumn for the grid. One of the columns in the grid is called Order_Qty with a unique name of ColOrder_Qty.

When I try to render the RadGrid For the PDF creation I get the following error:-
Script control 'RNTBF_ColOrder_Qty' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors(). Parameter name: scriptControl

So my question is, What is this RNTBF_ColOrder_Qty script control, and mores to the point how do I get a reference to it in order to be able to register it with the RadScriptManger prior to rendering?

Stuart Watton
Nikolay Rusev
Telerik team
 answered on 10 Jan 2011
3 answers
312 views
Hi ,

    i am using rad chart control in my application.it is working fine when developement
but after given the build in IIS i am getting error- HTTP 404.0 -Not Found
please refer screen shot and let me know the solution
Vladimir Milev
Telerik team
 answered on 10 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?