Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
82 views
I've got some conditional logic to hide items (row) on item databound. When I do this, the rows are successfully hidden but the item count is not adjusted to reflect this.

If there any way to only count visible rows for the item count?
Brian
Top achievements
Rank 1
 answered on 28 Oct 2013
6 answers
217 views
<EditFormSettings EditFormType="Template">
<FormTemplate>
......
Active:
<
asp:CheckBox ID="CheckBox11" runat="server" Checked='<%# Eval("active") == DBNull.Value? false: Convert.ToBoolean(Eval("active")) %>' />

    protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
       

        if (e.CommandName == RadGrid.InitInsertCommandName)
        {

            GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn");

           editColumn.Visible = false;

           GridEditableItem editedItem = e.Item as GridEditableItem;

            e.Canceled = true;
            //Prepare an IDictionary with the predefined values 

            System.Collections.Specialized.ListDictionary newValues = new System.Collections.Specialized.ListDictionary();

            //set initial checked state for the checkbox on init insert 

            newValues["active"] = true;

            //Insert the item and rebind 

            e.Item.OwnerTableView.InsertItem(newValues);

        }

        else if (e.CommandName == RadGrid.RebindGridCommandName && e.Item.OwnerTableView.IsItemInserted)
        {

            e.Canceled = true;

        }

        else
        {

            GridEditCommandColumn editColumn = (GridEditCommandColumn)RadGrid1.MasterTableView.GetColumn("EditCommandColumn");

            if (!editColumn.Visible)

                editColumn.Visible = true;

        }


protected void ObjectDataSource1_Inserting(object sender, ObjectDataSourceMethodEventArgs e)
 
{
 
e.InputParameters["active"] = ??????
 
}

 

Somehow when I tried to save the value of checkbox after click in edit mode or insert mode. It won't take that value. Please help.

Thanks

Q
Top achievements
Rank 1
 answered on 28 Oct 2013
2 answers
120 views
Hello!
i have attached my code below.


 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
        <UpdatedControls>
       <telerik:AjaxUpdatedControl ControlID="panel1" />
      <telerik:AjaxUpdatedControl ControlID="samplediv" />
        </UpdatedControls>
        </telerik:AjaxSetting>
        </AjaxSettings>
       <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="Timer1" >
        <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="samplediv" />
        <telerik:AjaxUpdatedControl ControlID="ajaxbtn" />
        </UpdatedControls>
        </telerik:AjaxSetting>
        </AjaxSettings>
        </telerik:RadAjaxManager>
        <br />
         <asp:Panel ID="panel1" runat="server">
        <asp:Timer ID="Timer1" runat="server" Interval="2000" ontick="Timer1_Tick" Enabled="false">
        </asp:Timer></asp:Panel>
        <div id="samplediv" runat="server" style="border:solid 1px grey;height:180px;width:250px;overflow:scroll;" />  
<telerik:RadCodeBlock ID="radblk" runat="server">
 <script type="text/javascript">
function chattext()
{
    var ajaxmagr = $find("<%=RadAjaxManager1.ClientID%>");
    alert(ajaxmagr);
    ajaxmagr.ajaxRequest("chat");
}

</script>       
        </telerik:RadCodeBlock>


cs code..


protected void Timer1_Tick(object sender, EventArgs e)
    {
        string s = "chattext();";
        RadScriptManager.RegisterStartupScript(this, this.GetType(), "s", s, true);
    }
    protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)
    {
        if (e.Argument == "chat")
        {
            
            samplediv.InnerHtml += " sample text <br/>";
           
        }
    }






i want to call a js funtion in timer tick.  but i got ajaxmgr as null in js alert.
whats wrong in my code? 

thanks.
priya.

Prashant Nandha
Top achievements
Rank 1
 answered on 28 Oct 2013
2 answers
38 views
Hello there,

Here is the code I'm using to redirect the user to a new page:

<telerik:RadButton ID="buttonProcessing" runat="server" ButtonType="LinkButton" Text="Modify" SingleClick="true" NavigateUrl='the web address goes here' SingleClickText="Please wait..." />

On any version of FireFox it works very well, however on IE9 the button launches the refresh of the current page.

Do you have any idea why this behavior?

I'm using Telerik.Web.UI v.4.0.30319

Thanks in advance!
Titus
Top achievements
Rank 1
 answered on 28 Oct 2013
0 answers
44 views
In Q3 2013 there are changes in the RadSplitter related to HTML5 validation. They include specific selectors, which affect the content inside the control.

This issue will be fixed in the upcoming 2013 Q3 SP1 release of RadControls for ASP.NET AJAX.

For the time being the problem can be avoided via both of the following steps: 

  1. We had to remove cellpadding and cellspacing attributes. The following styles are the correct CSS equivalent of the HTML attributes and should be added in the problematic page:
    .RadSplitter {
        border-spacing: 0;
    }
    .rsPane,
    .rspPaneHorizontal {
        padding: 0;
    }
  2. The CSS class rsHTML5ValidationFixer affects the stylization of the splitter's content. The appearance of the content will be fixed after removing this class, however the page will no longer pass HTML5 validation. This can be achieved by placing the following JavaScript code after the ScriptManager control:
    Sys.Application.add_load(function() {
        var $ = $telerik.$;
      
        $(".rsHTML5ValidationFixer").removeClass("rsHTML5ValidationFixer");
    });
Telerik Admin
Top achievements
Rank 1
Iron
 asked on 28 Oct 2013
5 answers
396 views
I have an application that is using the 2.0 framework and we have tried to use the AsyncUpload.  It works fine on local host but not when it is moved to our test environment.  When we run it we get the error 
System.Exception: RadAsyncUpload does not have permission to write files in the TemporaryFolder. In Medium Trust scenarios, the TemporaryFolder should be a subfolder of the Application Path

I have set the tempory folder to be located in a folder called Filemanger that the original Radupload used with no issues.  I have give Authenticated  user full controll and tried giving everyone full control, which I don't want to do, and still get this error.  I have set UseApplicationPoolImpersonation to true and still the same error.


Also since this is an internal app it has full trust in IIS 
Wired_Nerve
Top achievements
Rank 2
 answered on 28 Oct 2013
4 answers
275 views
Howdy all.

So, I have a RadMenu where the user clicks a button that opens a RadWindow.  Then the user can click anywhere else but on the window itself and close said window.  That works beautifully.

I now have a RadGrid with a GridTemplateColumn that has a LinkButton.  LinkButton goes to the code behind, figures stuff out, and if all is good, redirects to another page in the project.  If something is awry and it can't for some reason, it instead pops up a default RadAlert that says 'Something's wrong'.  The RadAlert is Modal and appears over the RadWindow, not letting the user have any interaction on the page under it.  THAT works.

Here's where I'm going cross-eyed: Once I hit Ok, I want the RadWindow with the grid to stay open, and the RadAlert to close.  However, my code for 'Click Anywhere and close' is tripping, and I'm not sure how to let it know that the click on the RadAlert is ok.

This is also, adding shades of complexity, part on a master page, and part on the content page.  I'll mark which bit is where.

Here's my code.

First, menu and window I want to stay up - this is on the Content page:
<telerik:RadMenu id="menuEmp" ClientIDMode="Static" runat="server" flow="Vertical" OnClientItemClicked="MenuOpenWindow" Width="100%"
    BackColor="#37495D">
    <Items>
      <telerik:RadMenuItem ImageUrl="../Images/button1.png" Value="EmpProj" />
    </Items>
</telerik:RadMenu>
 
<telerik:RadWindow id="winEmpProj" runat="server" Top="0" Left="0" Style="z-index: 8000" EnableEmbeddedSkins="false" OffsetElementID="divEmpHeader"
    ShowContentDuringLoad="false" VisibleStatusbar="false" VisibleTitlebar="false" AutoSize="true">
    <ContentTemplate>
        <div id="divProjListList" runat="server" style="width: 400px;">
            <div>Projects</div>
            <div style="width: 400px">
                <telerik:RadGrid ID="grdEmp" runat="server" AutoGenerateColumns="False"
                    Skin="" EnableLinqExpressions="False" CellSpacing="0" EnableViewState="False">
                    <ClientSettings Selecting-AllowRowSelect="false" EnablePostBackOnRowClick="true" />
                    <MasterTableView DataKeyNames="KeyColumn" ShowHeader="true" HeaderStyle-HorizontalAlign="Center" EnableViewState="false">
                        <Columns>
                            <telerik:GridTemplateColumn UniqueName="EmpNo" HeaderText="EmpNo" ItemStyle-HorizontalAlign="Left">
                                <ItemTemplate>
                                    <asp:LinkButton ID="btnEmpNo" runat="server" OnClick="LoadEmp"><%# DataBinder.Eval(Container.DataItem, "EmpNo")%></asp:LinkButton>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="Department" />
                            <telerik:GridBoundColumn DataField="Project" />
                            <telerik:GridBoundColumn DataField="Supervisor" />
                            </telerik:GridBoundColumn>
                        </Columns>
                        <HeaderStyle HorizontalAlign="Center" />
                    </MasterTableView>
                    <FilterMenu EnableImageSprites="False">
                    </FilterMenu>
                </telerik:RadGrid>
            </div>
        </div>
    </ContentTemplate>
</telerik:RadWindow>

Now, the Menu specific Javascript, also on the Content page.
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        function MenuOpenWindow(windowTitle) {
            var oWindow;
            var offsetElementBounds;
            var menu = $find("<%=menu.ClientID%>");
            var menuItem = menu.findItemByValue(windowTitle).get_element();
  
            //Closes the last window opened
            if (lastOpenedWindow) {
                lastOpenedWindow.close();
                lastOpenedWindow = null;
            }
             
            if (windowTitle == "EmpProj") {
                if (lastWindowTitle != "EmpProj") {
                    oWindow = $find("<%=winEmpProj.ClientID%>");
                    oWindow.show();
                    if (oWindow.get_offsetElementID()) {
                        offsetElementBounds = $telerik.getBounds($get(oWindow.get_offsetElementID()));
                        var x = offsetElementBounds.x + (menuItem.offsetWidth / 3);
                        var y = menuItem.offsetTop + offsetElementBounds.y - (menuItem.offsetHeight / 3);
                        oWindow.moveTo(x, y);
                    }
                    lastOpenedWindow = oWindow;
                    lastWindowTitle = "EmpProj";
                    return false;
                } else {
                    lastWindowTitle = null;
                }
            }
        }
    </script>
</telerik:RadScriptBlock>


Now, the VB code behind of the Content page.  First method is where the window is opened, and the second is where the RadAlert is generated.
Private Sub menuEmp_ItemClick(sender As Object, e As Telerik.Web.UI.RadMenuEventArgs) Handles menuEmp.ItemClick
    Select Case e.Item.Value
        Case "Endorsed"
            grdEndorsed.DataSource = Nothing
            grdEndorsed.Rebind()
    End Select
    Dim scriptstring As String = "function f(){{MenuOpenWindow('" & e.Item.Value & "');;Sys.Application.remove_load(f);}};Sys.Application.add_load(f);"
    ScriptManager.RegisterStartupScript(Me, Me.[GetType](), "showWindow", scriptstring, True)
End Sub
 
Private Function LoadEmp()
    'Stuff done
    If {stuff true} Then
        'Do stuff
    Else
        Dim winManger As RadWindowManager = Master.FindControl("RadWindowManager1")
        winManger.RadAlert("Something's Wrong", 50, 100, "Project", "message")
        Exit Sub
    End If
End Function

Because this Javascript is used throughout the project on multiple pages, it's on the Master page.
<telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
    <script type="text/javascript">
        //Global Variables
        var lastOpenedWindow;
        var lastWindowTitle;
        var alertWindowUp;
 
        function message(args) {
            //This is here to give RadWindow serverside a place to go.
            if (lastWindowTitle == "EmpProj" && args == true) {
                alertWindowUp = true;
            }
        }
 
        function pageLoad() {
            $addHandler(document, "click", onClickHandler);
        }
 
        function onClickHandler(e) {
            var targedNodeName = e.target;
 
            if (lastOpenedWindow) {
                // If the RadWindow is clicked then do nothing ;
                if ($telerik.isMouseOverElementEx(lastOpenedWindow.get_popupElement(), e)) return;
 
                lastOpenedWindow.close();
                lastOpenedWindow = null;
                lastWindowTitle = null;
 
                if (alertWindowUp == true) {
                    lastWindowTitle = null;
                    MenuOpenWindow("EmpProj");
                    alertWindowUp = false;
                }
            }
        }
    </script>
</telerik:RadScriptBlock>

And finally, the RadWindowManager on the Master.  Not much too it, but it is there!
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Style="z-index: 8000" />

Any ideas?  Thanks all!
Amanda
Top achievements
Rank 1
Iron
 answered on 28 Oct 2013
8 answers
331 views
Hi,

I am using RadMenu in one of my aspx pages. I have some javascript on the "OnClientItemClicked". which sets some JS varaibles . After a postback, I am loosing all values of the variables, which has to be set based on the currently selected radmenu. Is there way to trigger the "OnClientItemClicked" for the currently selected RadMenu?

Thanks,
Tony
Princy
Top achievements
Rank 2
 answered on 28 Oct 2013
25 answers
537 views
We've got a project in which there is heavy use of the radscheduler component, which is great.  Now, however, the client wishes to be able to print the schedule in a monthly view and weekly view.  I started looking at a reporting services plugin that had a calendar control but the bottom line is that I want it to look exactly like the radscheduler on the page.  I have thought of trying to make a bigger version that would fill a portrait or landscape page and just thell the user to print.  Obviously the background colors are going to be lost, etc... and good luck telling them to switch those settings.

What's really needed here is a way to export the RadScheduler to a printable format.  For example:

RadScheduler1.ExportAsPDF("portrait");

That is a simplified parameter but if there was a way we could basically get the control to "render itself" into a PDF or even an image then printing can be achieved.  What would be best about feeding out a PDF bytestream is that we could save the PDF and use those PDFS to provide nice snapshots of the calendar in various times.

The two areas would be month view and week view.... eventually you could do it for all of the other views.

How tough would this be to implement?  Is there a workaround to achieve this that I'm not thinking of?  I would rather not use any other thirt party calendar controls/products, Telerik has it looking perfect I just need to print it! :-)


Boyan Dimitrov
Telerik team
 answered on 28 Oct 2013
16 answers
327 views
Hello,
  I am adding below tag <ExportSettings in the <telerik:RadScheduler runat="server" ID="RadScheduler1" .........> Tag
<
ExportSettings OpenInNewWindow="true" FileName="SchedulerExport">
                <Pdf PageTitle="Schedule" Author="Telerik" Creator="Telerik" Title="Schedule" />
            </ExportSettings>

there is button to export pdf:

protected void btnExportPdf_Click(object sender, EventArgs e)
    {
        RadScheduler1.ExportToPdf();
    }
but the problem is no pdf open to download. It's resize the radScheduler control in small size when i click in Export button and no download popup page. I see in demo page path:http://demos.telerik.com/aspnet-ajax/scheduler/examples/pdfexport/defaultcs.aspx.

How is the problem I can't understand.

Please help me as soon as possible.


Thanks

Jiten Mutum
Boyan Dimitrov
Telerik team
 answered on 28 Oct 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?