Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
141 views
Hi
i have a script there then you select 2 days in 2 RadDatePicker
updates a table with timepickers
    Protected Sub RadDatePicker2_SelectedDateChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.Calendar.SelectedDateChangedEventArgs) Handles RadDatePicker2.SelectedDateChanged  
        Dim Days As Integer 
        If RadDatePicker2.SelectedDate.Value.Subtract(RadDatePicker1.SelectedDate.Value).Days >= 0 Then 
            Days = RadDatePicker2.SelectedDate.Value.Subtract(RadDatePicker1.SelectedDate.Value).Days  
            For i = 0 To Days Step 1  
                Dim row As New TableRow  
                Dim cell As New TableCell  
                cell.Text = RadDatePicker1.SelectedDate.Value.AddDays(i)  
                row.Cells.Add(cell)  
                cell = New TableCell  
                Dim timePicker As New Telerik.Web.UI.RadTimePicker  
                timePicker.ID = "TimePickerA" & i  
                timePicker.Skin = "Black" 
                cell.Controls.Add(timePicker)  
                row.Cells.Add(cell)  
                timePicker = New Telerik.Web.UI.RadTimePicker  
                timePicker.ID = "TimePickerB" & i  
                timePicker.Skin = "Black" 
                cell.Controls.Add(timePicker)  
                row.Cells.Add(cell)  
                EventDates.Rows.Add(row)  
            Next 
        End If 
    End Sub 

the problem is then i use a button to submit the form how do i get access to my RadTimePicker  controls
then i look in the table it is emtry
the dynamic create rows disapers
Sebastian
Telerik team
 answered on 17 Sep 2009
1 answer
129 views
Hi All,

Is there a way to get the usercontrol within the radgrid on client side? I have searched everywhere and i can't find a way to do it.

Here is the scenario, I have a Radgrid with WebUserControl as the EditMode. Within the usercontrol I call a popup with dropdown on it where the user will be able to select some data. The data that was selected from the popup should be passed to the Editfrom User control Textbox.

I tried using radwindow but it still cannot find the usercontrol. I really need suggestions.

Thank you so much.
Mira
Telerik team
 answered on 17 Sep 2009
3 answers
147 views

Hello,

I have a page which contains a grid (1000 cells).
When the page called for the first time, it load in about 0.05 sec, which is good.
Now I need to update the grid every period of time.
I've done so by using radajaxmanager.ajaxrequest. It works fine, but the grid rendering takes about 2 sec, which is bad.
Can any one suggest me how to imporve the grid render time (the period of time browser need to draw the grid ) (grid view state is disabled,I am using paging and cannot go under 10 items, and bandwidth in no factor)?

10x guys.


code behind:
  public partial class _Default : System.Web.UI.Page  
    {  
        protected void Page_Load(object sender, EventArgs e)  
        {  
            setGridDesign();  
            this.RadGrid1.DataSource = GetDataFromDB();  
        }  
        private void setGridDesign()  
        {  
            this.RadGrid1.AutoGenerateColumns = false;  
            this.RadGrid1.Columns.Clear();  
            this.RadGrid1.Enabled = true;  
            for (int i = 0; i < 100; i++)  
            {  
                GridCheckBoxColumn flightColumn = new GridCheckBoxColumn();  
 
                flightColumn.HeaderText = i.ToString();  
                flightColumn.UniqueName = i.ToString();  
                flightColumn.ReadOnly = false;  
                this.RadGrid1.Columns.Add(flightColumn);  
            }  
        }  
 
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)  
        {  
            GridDataItem dataItem = e.Item as GridDataItem;  
            if (dataItem != null)  
            {  
                for (int i = 0; i < 100; i++)  
                {  
                    (dataItem[i.ToString()].Controls[0] as CheckBox).Checked = true;  
                    (dataItem[i.ToString()].Controls[0] as CheckBox).Enabled = true;  
                }  
            }  
        }  
 
        private string[] GetDataFromDB()  
        {  
            string[] dataSource = null;  
 
            return (dataSource = new string[20]);  
        }  
 
        protected void RadAjaxManager1_AjaxRequest(object sender, AjaxRequestEventArgs e)  
        {  
            setGridDesign();  
            this.RadGrid1.DataSource = GetDataFromDB();  
            this.RadGrid1.DataBind();  
        }  
 
        DateTime m_ResponseStart = DateTime.Now;  
        DateTime m_ResponseEnd;  
 
        protected void LabelActionTime_Unload(object sender, EventArgs e)  
        {  
            this.m_ResponseEnd = DateTime.Now;  
 
            (sender as Literal).Text += (this.m_ResponseEnd - this.m_ResponseStart).TotalSeconds;  
        }  
 
    } 
aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication7._Default" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!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 runat="server">  
    <title></title>  
</head> 
<body> 
 
    <form id="form1" runat="server">  
        <script language="javascript" type="text/javascript">  
            var g_RenderingStartTime = new Date();  
            var g_RenderingEndTime = null;  
    </script> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">  
    </telerik:RadScriptManager> 
    <telerik:RadAjaxManager OnAjaxRequest="RadAjaxManager1_AjaxRequest"   
    ClientEvents-OnRequestStart="RadAjaxManager1_AjaxRequest_RequestStart"   
    ClientEvents-OnResponseEnd="RadAjaxManager1_AjaxRequest_ResponseEnd"   
    ID="RadAjaxManager1"   
    runat="server"   
    DefaultLoadingPanelID="RadAjaxLoadingPanel1">  
    <AjaxSettings > 
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">  
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                  
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
    </telerik:RadAjaxManager> 
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">  
    </telerik:RadAjaxLoadingPanel> 
    <div> 
           <telerik:RadGrid EnableViewState="false" AllowSorting="false"  PageSize="10"   
                AllowPaging="true"   ID="RadGrid1"   
                runat="server" style="margin-left:auto;margin-right:auto;" 
                 Width="100%" OnItemDataBound="RadGrid1_ItemDataBound" 
                HeaderStyle-Wrap="false"  > 
                <HeaderStyle Width="60px"  /> 
                <PagerStyle  Mode="NextPrev" AlwaysVisible="true" /> 
                <MasterTableView TableLayout="Fixed">  
                </MasterTableView> 
                <PagerStyle Mode="NextPrev" /> 
            </telerik:RadGrid> 
    </div> 
    <telerik:RadCodeBlock runat="server">  
           <asp:Literal runat="server" EnableViewState="false" ID="LabelActionTime" Text="Page cycle: "   
        OnPreRender="LabelActionTime_Unload"></asp:Literal>    
        Client Render time: <div id="clientRenderTime"></div> 
 
    <script language="javascript" type="text/javascript">  
 
        function RadAjaxManager1_AjaxRequest_ResponseEnd(i_sender, i_args) {  
           
            g_RenderingEndTime = new Date();  
            writeclientRenderTime()  
        }  
 
        function RadAjaxManager1_AjaxRequest_RequestStart(i_sender, i_args) {  
            g_RenderingStartTime = new Date();  
        }  
 
        function MillisecondsToDuration(n) {  
            var hms = "";  
            var dtm = new Date();  
            dtm.setTime(n);  
            var h = "000" + Math.floor(n / 3600000);  
            var m = "0" + dtm.getMinutes();  
            var s = "0" + dtm.getSeconds();  
            var cs = "0" + Math.round(dtm.getMilliseconds() / 10);  
            hhms = h.substr(h.length - 4) + ":" + m.substr(m.length - 2) + ":";  
            hms += s.substr(s.length - 2) + "." + cs.substr(cs.length - 2); return hms;  
        }  
 
 
        function writeclientRenderTime() {  
             
            var div = $get("clientRenderTime");  
            div.innerHTML = MillisecondsToDuration(g_RenderingEndTime.getTime() - g_RenderingStartTime.getTime());  
        }  
 
        function updateGrid() {  
        
            var grid = $get("<%= RadGrid1.ClientID %>");  
            grid.disabled = true;  
            var ajaxManager = $find("<%= RadAjaxManager1.ClientID %>");  
            ajaxManager.ajaxRequest( "Refresh");  
 
        }  
 
        var g_IntervalID = null;  
          
        function setRefreshTableIntrval() {  
            g_IntervalID = setInterval("updateGrid()", 6000);  
        }         
 
        function clearRefreshTableIntrval() {  
            clearInterval(g_IntervalID);  
        }  
 
        // setaddNewUserIntrval();  
 
        setRefreshTableIntrval();  
       // setaddNewFlightIntrval();  
 
        g_RenderingEndTime = new Date();  
 
        writeclientRenderTime();  
          
    </script> 
      
        </telerik:RadCodeBlock> 
    </form> 
</body> 
</html> 
 
Sebastian
Telerik team
 answered on 17 Sep 2009
3 answers
137 views
When I double-click on a file to download it, an empty RadWindow appears.  How to I either prevent this from appearing, or close if after the download begins/finishes?

Thanks,
Ada,
Tervel
Telerik team
 answered on 17 Sep 2009
1 answer
154 views
I want to resize the windows automatically .........................The Window contain the Radgrid. When i click ADd it will add in radgrid and open in the RAdgrid inside the RAdwindows. I want to it will resize automatically ?

How to resize the windows ?

Urgentttttttttttttt
Shinu
Top achievements
Rank 2
 answered on 17 Sep 2009
2 answers
165 views
I'd like to limit the expand depth that users can see in the treeview. Is there a way to do that?

Eric
Tervel
Telerik team
 answered on 17 Sep 2009
1 answer
232 views
In my applicatin i use button column for confirmatin of delete some product , i want change it height and width and forecolor of the text .. It wil takes black automatically

My code is

<telerik:GridButtonColumn ButtonType="ImageButton" HeaderText="Remove" ImageUrl="images/Delete.gif"
                                                    ConfirmText="Delete this Proposal?" UniqueName="DeleteColumn" ConfirmDialogType="RadWindow" 
                                                     CommandName="Delete" Text="Delete" ConfirmTitle="Delete">
                                                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                                                    <ItemStyle HorizontalAlign="Center" V
erticalAlign="Middle" />
                                                </telerik:GridButtonColumn>

How to change rad confirm height width color ?


Shinu
Top achievements
Rank 2
 answered on 17 Sep 2009
1 answer
125 views
I have an Ajaxified grid wired up to the AjaxLoadingPanel.  I am using a command item template in which I have a "Print" option link button.  The link calls a client-side script to run a report.  The server side event for this link does the following:

Dim myReport As ReportServer.PendingReport = New ReportServer.PendingReport
Dim reportProcessor As New Telerik.Reporting.Processing.ReportProcessor()
Dim result As Telerik.Reporting.Processing.RenderingResult = reportProcessor.RenderReport("PDF", myReport, Nothing)
Dim fileName As String = result.DocumentName + ".pdf"
Response.Clear()
Response.ContentType = "Application/pdf"
Response.Cache.SetCacheability(HttpCacheability.Private)
Response.Expires = -1
Response.Buffer = False
Response.AddHeader("Content-Disposition", String.Format("{0};FileName=""{1}""", "attachment", fileName))
Response.OutputStream.Write(result.DocumentBytes, 0, result.DocumentBytes.Length)
Response.End()

Firing this event causes the following error:

Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed.
Common causes for this error are when the response is modified by calls to Response.Write(), response filters,
httpModules, or server trace is enabled.  Details: Error parsing near '%PDF-1.6
%
1 0 obj'

Anyone have any idea of how to avoid this other than removing Ajax Manager for the grid? 

 

Princy
Top achievements
Rank 2
 answered on 17 Sep 2009
1 answer
117 views
Is it possible to define this via JavaScript?  I havent been able to find anything in the documentation anywhere.  I am reusing the same window manager and need some windows to show content and others to show the loading panel and would like to be able to set this in my js script if possible?
Fiko
Telerik team
 answered on 17 Sep 2009
6 answers
765 views
There appears to be a bug in the way that the RadAjaxManager is updating UpdatePanels, plus the EventName attribute of the AjaxSetting element is not filtering events.  If an UpdatePanel named by an AjaxUpdatedControl element is triggered for an update by the RadAjaxManager, and you also execute the .Update() method of that UpdatePanel in your code, the entire contents of the update panel will be removed on the CallBack.

I have been bending over backwards to work around this, but it really needs to be fixed.  In my code, I can execute the .Update() method of a single UpdatePanel as many times as I wish without any issues, so it is something in the way that the RadAjaxManager is handling this.  As for the EventName not filtering, there is no work-around.
Mira
Telerik team
 answered on 17 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?