Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
141 views

We are using the RadScheduler with Web Services binding. On inserting a new appointment, we would like to retrieve the ID of the appointment on the client side after the Web Service request is complete. Can we retrieve this in the result sent back from the service call in the OnClientRequestSuccess method? If so, what is the best approach for doing this? We noticed that the Insert method is passing back IEnumerable<AppointmentData>. How can this data be used?

If the OnClientRequestSuccess method is not the best approach, what other options are there?

By the way, we noticed that it is possible to return a SchedulerResult object with the GetAppointments method. Can that be done with the InsertAppointment method? If so, that would solve our problem.
Jose Granja
Top achievements
Rank 1
 answered on 09 Dec 2010
3 answers
133 views
I have a stored procedure that selects two columns from a single table - size (int) and date.  All I want to do is plot a line graph with the size, and have the X axis item labels show the dates recorded.

So, the data looks like this:
 
size | date 
224 | 1-5-10 
250 | 1-10-10 
156 | 1-22-10 

And this is what I ended up with when I tried to use the Wizard (bound to a SqlDataSource):

 <telerik:RadChart ID="RadChart1" runat="server" DataSourceID="SqlDataSource1"  
                    DefaultType="Line" Skin="Default"
                    <Series> 
                        <telerik:ChartSeries Name="Size" DataYColumn="size" Type="Line"  
                            DataXColumn="size"
                            <Appearance> 
                                <FillStyle MainColor="213, 247, 255"
                                </FillStyle> 
                            </Appearance> 
                        </telerik:ChartSeries> 
                    </Series> 
                    <PlotArea> 
                        <XAxis AutoScale="False" DataLabelsColumn="size"
                            </XAxis> 
                    </PlotArea> 
                </telerik:RadChart> 

What I want is to have the dates as the X axis labels, but I can't figure out how to do it.  It seems like this should be incredibly simple, but I just find the chart syntax really confusing.  Any help would be very much appreciated.



Ves
Telerik team
 answered on 09 Dec 2010
2 answers
152 views
Style issue here:

I've got a radGrid with a Template column that contains an ASP.NET RadioButtonList (simply Yes/No radio buttons). I've turned on AllowHoverStyle in the ClientSettings of the radGrid. The entire row does hover, EXCEPT when I hover over the RadioButtonList, in which case the hover style goes away.

I'm usually pretty good with styling issues, but I'm at a loss on this one. The strange thing is I have other columns that some have buttons, images, dropdown, and hovering over any of these items does NOT make the row hover style go away; it stays and is great. It only disappears when it's over the RadioButtonList. Well technically since the RadioButtonList control renders with a table w/radio buttons inside table cells, the radGrid's hover style appears to disappear when the mouse hovers over this RadioButtonList rendered radio button or radio button's label (still works if Only over the table containing the buttons and labels)

I've already tried setting z-index on the radios and labels to inherit, but that didn't work. not sure what else would cause the full row's hover style to go away?

Any ideas are greatly appreciated. Thanks.

Paul J
Top achievements
Rank 1
 answered on 09 Dec 2010
8 answers
171 views
Hi,

I have designed a multicolumn RADGrid which displays labels. However, when I export it to PDF, it displays only in single column.
Here is the code snippet for your reference--

<telerik:RadGrid ID="grdReport" runat="server" AllowSorting="True" GridLines="None"
                                AllowPaging="True" Font-Names="Arial" Font-Size="10pt" Skin="Outlook"
                                AllowFilteringByColumn="true" PageSize="30" ShowHeader="false" EnableViewState="true"
                                OnPreRender="grdReport_PreRender" OnNeedDataSource="grdReport_NeedDataSource"
                                OnItemCommand="grdReport_ItemCommand" OnItemCreated="grdReport_ItemCreated">
                            <ExportSettings IgnorePaging="True" OpenInNewWindow="True">
                                <Pdf PageWidth="210mm" PageHeight="297mm" Author="VoltTrack" Creator="VoltTrack"
                                    Producer="VoltTrack" PageLeftMargin="0.5in" PageRightMargin="0.5in" />
                            </ExportSettings>
                            <PagerStyle Position="Top"/>
                            <MasterTableView CommandItemDisplay="Top" EnableViewState="true" TableLayout="Fixed">
                                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                <CommandItemSettings ShowExportToPdfButton="True" ShowAddNewRecordButton="False" />
                                    <ItemTemplate>
                                        <%# (((GridItem)Container).ItemIndex != 0)? "</td></tr></table>" : "" %>
                                        <asp:Panel ID="ItemContainer" CssClass='<%# (((GridItem)Container).ItemType == GridItemType.Item)? "item" : "alternatingItem" %>'
                                            runat="server">
                                            <b><%# Eval("C_Name")%></b>
                                            <br />
                                            SSN:
                                            <b><%# Eval("SSN")%></b>
                                            W/E:
                                            <b><%# Eval("Weekend_Date")%></b>
                                            <br />
                                            Branch:
                                            <b><%# Eval("Branch")%></b>
                                            Job#:
                                            <b><%# Eval("Job_Number")%></b>
                                            <br />
                                            <b><%# Eval("Cust_Name")%></b>
                                        </asp:Panel>
                                    </ItemTemplate>
                            </MasterTableView>
                            <HeaderStyle HorizontalAlign="Center" />
                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                                <Scrolling EnableVirtualScrollPaging="True" />
                            </ClientSettings>
                        </telerik:RadGrid>

protected void grdReport_PreRender(object sender, EventArgs e)
        {
            int itemCount = (sender as RadGrid).MasterTableView.GetItems(GridItemType.Item).Length + (sender as RadGrid).MasterTableView.GetItems(GridItemType.AlternatingItem).Length;
            foreach (GridItem item in (sender as RadGrid).Items)
            {
                if (item is GridDataItem && item.ItemIndex < itemCount - 1)
                {
                    ((item as GridDataItem)["C_Name"] as TableCell).Controls.Add(new LiteralControl("<table style='display:none;width: 730px'><colgroup><col /><col /><col /></colgroup><tr><td>"));
                }
            }
        }


Can you please help?

Regards,
Krunal
Daniel
Telerik team
 answered on 09 Dec 2010
5 answers
110 views
Previous verison of the control if DecimalDigits is not set it will not force any decimal places with AllowRounding="false".
Now by default it is rounded to 2 decimal places per regional setting.

I hard coded 6 decimal places...

Pavel
Telerik team
 answered on 09 Dec 2010
0 answers
98 views
My fault. I had a javascript error on the page.

When I add the attribute OnClientSelectedIndexChanged to a RadComboBox, the pull down functionality is disabled. Unfortunately, when I create a simple example, the combo box continues to work. Something on my page is interacting with the RadComboBox.

Any Ideas?
Richard
Top achievements
Rank 1
 asked on 09 Dec 2010
4 answers
1.2K+ views
Hi

is possible to check the minimum size of uploaded file in radexplore?
Because when i upload a txt file empty 0 byte and try to open/download with Handler.ashx method:
<%@ WebHandler Language="C#" Class="Telerik.Web.Examples.FileExplorer.FilterAndDownloadFiles.Handler" %>   
  
using System;   
using System.Data;   
using System.Configuration;   
using System.Web;   
using System.Text;   
using Telerik.Web.UI;   
  
namespace Telerik.Web.Examples.FileExplorer.FilterAndDownloadFiles   
{   
    [RadCompressionSettings(HttpCompression = CompressionType.None)] // Disable RadCompression for this page ;   
    public class Handler : IHttpHandler   
    { 
        #region IHttpHandler Members   
  
        private HttpContext _context;   
        private HttpContext Context   
        {   
            get  
            {   
                return _context;   
            }   
            set  
            {   
                _context = value;   
            }   
        }   
  
  
        public void ProcessRequest(HttpContext context)   
        {   
            Context = context;   
            string filePath = context.Request.QueryString["path"];   
            filePath = context.Server.MapPath(filePath);   
  
            if (filePath == null)   
            {   
                return;   
            }   
  
            System.IO.StreamReader streamReader = new System.IO.StreamReader(filePath);   
            System.IO.BinaryReader br = new System.IO.BinaryReader(streamReader.BaseStream);   
  
            byte[] bytes = new byte[streamReader.BaseStream.Length];   
  
            br.Read(bytes, 0, (int)streamReader.BaseStream.Length);   
  
            if (bytes == null )   
            {   
                return;   
            }   
  
            streamReader.Close();   
            br.Close();   
            string extension = System.IO.Path.GetExtension(filePath);   
            string fileName = System.IO.Path.GetFileName(filePath);   
  
            if (extension == ".jpg")   
            { 
                WriteFile(bytes, fileName, "image/jpeg jpeg jpg jpe", context.Response);   
            }   
            else if (extension == ".gif")   
            { 
                WriteFile(bytes, fileName, "image/gif gif", context.Response);   
            } 
            else if (extension == ".png"
            { 
                WriteFile(bytes, fileName, "image/x-png", context.Response); 
            } 
            else if (extension == ".tif"
            { 
                WriteFile(bytes, fileName, "image/tiff", context.Response); 
            }             
            else if (extension == ".pdf")   
            { 
                WriteFile(bytes, fileName, "application/pdf", context.Response);   
            }           
            else if (extension == ".png"
            { 
                WriteFile(bytes, fileName, "image/x-png", context.Response); 
            } 
 
            else if (extension == ".txt"
            { 
                WriteFile(bytes, fileName, "text/plain", context.Response); 
            } 
 
            else if (extension == ".zip"
            { 
                WriteFile(bytes, fileName, "application/zip", context.Response); 
            }  
  
        }   
  
        /// <summary>   
        /// Sends a byte array to the client   
        /// </summary>   
        /// <param name="content">binary file content</param>   
        /// <param name="fileName">the filename to be sent to the client</param>   
        /// <param name="contentType">the file content type</param>   
        private void WriteFile(byte[] content, string fileName, string contentType, HttpResponse response)               
        { 
 
                response.Buffer = true
                response.Clear(); 
                response.ContentType = contentType; 
 
                response.AddHeader("content-disposition""attachment; filename=" + fileName); 
 
                response.BinaryWrite(content); 
                response.Flush(); 
                response.End(); 
             
                            
        }   
  
        public bool IsReusable   
        {   
            get  
            {   
                return false;   
            }   
        } 
        #endregion   
    }   
}     
i receive this exeption:

Argomento specificato non compreso nell'intervallo.
Nome parametro: offset

Descrizione: Eccezione non gestita durante l'esecuzione della richiesta Web corrente. Per ulteriori informazioni sull'errore e sul suo punto di origine nel codice, vedere l'analisi dello stack.

Dettagli eccezione: System.ArgumentOutOfRangeException: Argomento specificato non compreso nell'intervallo.
Nome parametro: offset

Errore nel codice sorgente:

Riga 109:                response.AddHeader("content-disposition", "attachment; filename=" + fileName);
Riga 110:
Riga 111: response.BinaryWrite(content);
Riga 112: response.Flush();
Riga 113: response.End();

File di origine: z:\Inetpub\wwwroot\MOweb\Handler.ashx    Riga: 111


Thanks

Fabio
Fiko
Telerik team
 answered on 09 Dec 2010
3 answers
235 views
Hi,

I have used UseStaticHeaders property (i.e. by setting it to "True") to ensure that grid headers don't move when one scrolls the grid upwards or downwards and users are able to tell which kind of data they are reading since the column headers are always visible and this works well.

But when I have a grid with many columns than can't fit on the screen and the horizontal scroll bar is activated, scrolling to the left or right, the headers do not move with the data columns thereby mixing up column headers as shown in the attached images.

1. grid before scrolling down.jpg: It shows the grid when "UseStaticHeaders" property is set to "true" and the grid has not been scrolled. Column headers are visible, but when one scrolls down the column headers are no longer visible as shown by "grid after scrolling down.jpg" image.

2. grid before scrolling right.jpg : It shows the grid when "UseStaticHeaders" property is set to "false" before scrolling to the right. Column headers and data columns are well aligned. But when one scrolls to the right, column headers and data are not properly aligned as shown by "grid after scrolling right.jpg " image.

How can I fix this issue such that when a user scrolls up or down, the headers always remain visible and when one scrolls to the right or left, the column headers move with their respective column headers?
Pavlina
Telerik team
 answered on 09 Dec 2010
3 answers
270 views
Hi,

I have a number of RadGrid controls which edit detail records using RadWindow.  This all works great until I change the Grid so that it is not paged, and the grid displays enough rows to require scrolling down through the window.

When this happens and I used the Edit link on the grid, the RadWindow opens in modal form but it is displayed somewhere off the page and so the system hangs.  If I edit a record without scrolling down the window opens as expected.

I have tried modifying css with in my App_Themes\Stylesheet.css file:
.RadWindow {top: 0px!important; left: 0px!important;}

I have also tried adding the following javascript after window open:

ow.autoSize();

 

ow.moveTo(0, 0);

ow.Minimize();

ow.Maximize();

In all cases the window fails to appear and the page becomes locked.

I am using ther 2010 Q3 release, but this behavour also showed in previous releases.  Any help appreciated.

David Penny

David Penny
Top achievements
Rank 2
 answered on 09 Dec 2010
3 answers
236 views
No idea what I'm doing wrong, but whenever I enable enableautomaticloadondemand, I get this error:

Line: 3747
Error: Sys.InvalidOperationException: '_lodIsAutomatic' is not a property or an existing field.

My code:
   <telerik:RadComboBox ID="RadComboBoxProviders" Runat="server" height="200px" EnableAutomaticLoadOnDemand="true"
        DataSourceID="LinqDataSourceProviders" DataTextField="Name" EmptyMessage="Select Provider" ItemsPerRequest="10" EnableVirtualScrolling="true"
        DataValueField="ProviderId" Skin="Web20">
    </telerik:RadComboBox>
  
<asp:LinqDataSource ID="LinqDataSourceProviders" runat="server" ContextTypeName="ClinicalDataContext"
    EntityTypeName="" Select="new (Name, Street1, City, State, ProviderId)" TableName="ExternalProviders">
</asp:LinqDataSource>
Dan
Top achievements
Rank 2
 answered on 09 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?