Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
79 views
My project uses a heavy collection of RadControls including the AJAX, Menu, Panel, Tabs, etc.  They are literally embedded into every corner of the application.  However, they no longer work when deployed to the Azure cloud.  Everything works fine on localhost.  However, once deployed, all of the controls render (see screenshot) but they aren't functional.  For example:

1) The menu won't pull down to show sub-items
2) The panel won't expand to show the collection of items
3) The tab won't let you move between tabs

There are more examples but in essence, they are all broken in Azure.  They render but lose 100% of functionality.  Any ideas on how to fix?  
Helen
Telerik team
 answered on 02 Aug 2011
1 answer
93 views
Hi,

Will you please let me know if the below code uses flash to upload the file? tats coz I mainly want a method to upload files without flash or silverlight..

I did not get ny samples for FileApi or IFrame.. so was just thinking if I can use this..


.aspx 


<telerik:RadStyleSheetManager id="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
<Scripts>
<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>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" />

<div>

     <telerik:RadAsyncUpload ID="RadAsyncUpload1" AutoAddFileInputs="true"  TargetFolder="Files" OnFileUploaded="RadAsyncUpload1_FileUploaded" MultipleFileSelection="Automatic" runat="server">
         
         </telerik:RadAsyncUpload>

        <asp:Button ID="Button1" runat="server" Text="Upload" OnClick="UploadFiles" />

</div>
</form>
</body>
</html>




.aspx.cs

public partial class Default : System.Web.UI.Page 
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }


    protected void RadAsyncUpload1_FileUploaded(object sender, Telerik.Web.UI.FileUploadedEventArgs e)
    {
        // e.IsValid = !CheckUploadedFileValidity();
        if (e.IsValid)
        {
            byte[] buffer = new byte[e.File.ContentLength];
            using (Stream str = e.File.InputStream)
            {
                str.Read(buffer, 0, e.File.ContentLength);

            }
        }
    }


    protected void UploadFiles(object sender, EventArgs e)
    {
// code
    }
}


Helen
Telerik team
 answered on 02 Aug 2011
1 answer
72 views

I created a RadGrid programmatically, and i use the following lines:

 

 

     RadGrid2.NeedDataSource += new GridNeedDataSourceEventHandler(RadGrid2_NeedDataSource);

 

instead of  --->   

RadGrid2.DataSourceID = "SqlDataSource1";

 

 

 

i want to create a GridTableView like the above line

 


GridTableView
tableViewOrders = new GridTableView(RadGrid2);

 

¿¿ what should be the declaration to replace ----> tableViewOrders.DataSourceID = "SqlDataSource2"; ???

 

i think somesthing like --->

 

tableViewOrders.NestedViewSettings.DataSourceID += new GridNestedViewSettings(RadGrid3_NeedDataSource);

 

 

but it is incorrect.



tableViewOrders.DataKeyNames =

new string[] { "idCodigos" };

 

 

GridRelationFields relationFields = new GridRelationFields();

 

relationFields.MasterKeyField =

"idCodigo";

 

relationFields.DetailKeyField =

"idCodigoSubGrupo";

 

tableViewOrders.ParentTableRelation.Add(relationFields);

RadGrid2.MasterTableView.DetailTables.Add(tableViewOrders);

 


protected

 

void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e)

 

{

 

 

ConnectionStringSettings connectionString = ConfigurationManager.ConnectionStrings["NorthwindConnectionString"];

 

_connection =

DbProviderFactories.GetFactory(connectionString.ProviderName).CreateConnection();

 

_connection.ConnectionString = connectionString.ConnectionString;

 

IDataReader reader;

 

 

using (IDbCommand command = _connection.CreateCommand())

 

{

command.CommandText =

"SpName";

 

command.CommandType =

CommandType.StoredProcedure;

 

_connection.Open();

reader = command.ExecuteReader();

}

((

RadGrid)source).DataSource = reader;

 

}

 

protected void RadGrid2_DataBound(object sender, EventArgs e)

 

{

 

if (_connection.State == ConnectionState.Open)

 

{

_connection.Close();

}

}


thanks in advance

Cristian.-

Tsvetina
Telerik team
 answered on 02 Aug 2011
7 answers
196 views
Hi:

I have just gone live on an application that ports data from a legacy system.  I am getting an exception on editing existing data.  Essentially, the case is different.  So, SQL is happy with the foreign key data, but the RadComboBox is not and causes an exception.  Any suggestions?

Phil
Dimitar Terziev
Telerik team
 answered on 02 Aug 2011
1 answer
105 views

Hi,

      My requirement is to generate PDF while clicking on image button in the grid.In the same page I have one search button(btnSearch). I have implemented OnNeedDataSource event.While clicking on search button I want to rebind the radgrid but I am getting this error “ErrorDetails : System.ArgumentException: Cannot unregister UpdatePanel with ID 'upnlPdf' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported. Parameter name: updatePanel at System.Web.UI.PageRequestManager.UnregisterUpdatePanel(UpdatePanel updatePanel) at System.Web.UI.ScriptManager.System.Web.UI.IScriptManagerInternal.UnregisterUpdatePanel(UpdatePanel updatePanel) at System.Web.UI.UpdatePanel.OnUnload(EventArgs e) at System.Web.UI.Control.UnloadRecursive(Boolean dispose) at System.Web.UI.Control.UnloadRecursive(Boolean dispose) at System.Web.UI.Control.UnloadRecursive(Boolean dispose) at System.Web.UI.Control.UnloadRecursive(Boolean dispose) at System.Web.UI.Control.RemovedControl(Control control) at System.Web.UI.ControlCollection.RemoveAt(Int32 index) at System.Web.UI.ControlCollection.Clear() at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) at System.Web.UI.WebControls.DataBoundControl.PerformSelect() at Telerik.Web.UI.GridTableView.PerformSelect() at System.Web.UI.WebControls.BaseDataBoundControl.DataBind() at Telerik.Web.UI.GridTableView.DataBind() at Telerik.Web.UI.RadGrid.DataBind() at Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) at Telerik.Web.UI.RadGrid.Rebind() at btnSearch_Click(Object sender, EventArgs e)”.

In aspx Page

===================================================================

<%@ Page Language="C#" MasterPageFile="~/ATMaster.Master" AutoEventWireup="true">

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <asp:UpdatePanel runat="server" ID="upnlSecurityDoc" UpdateMode="Conditional">

        <ContentTemplate>

<telerik:RadGrid ID="RadGrid1" runat="server" Width="1050px" TabIndex="5" Height="350px"

                                        AutoGenerateColumns="False" ForeColor="#333333" PageSize="10" AllowFilteringByColumn="false"

                                        Skin="Outlook" AllowPaging="true" OnNeedDataSource=" RadGrid1_NeedDataSource"

                                        BorderWidth="1px" BorderColor="#cccccc" OnItemCommand=" RadGrid1_ItemCommand"

                                        >

                                        <HeaderContextMenu EnableAutoScroll="True">

                                        </HeaderContextMenu>

                                        <GroupingSettings CaseSensitive="false" />

                                        <MasterTableView PagerStyle-AlwaysVisible="true">

                                            <CommandItemSettings ExportToPdfText="Export to Pdf" />

                                            <Columns>

                                                <telerik:GridTemplateColumn HeaderText="SlNo" AllowFiltering="false">

                                                    <HeaderStyle HorizontalAlign="Left" Font-Bold="true" Width="50px" />

                                                    <ItemStyle HorizontalAlign="Left" Width="50px"></ItemStyle>

                                                    <ItemTemplate>

                                                        <%# this.gvPendingOrder.CurrentPageIndex * this.gvPendingOrder.PageSize + Container.ItemIndex + 1%>

                                                    </ItemTemplate>

                                                </telerik:GridTemplateColumn>

                                               

<telerik:GridTemplateColumn HeaderText="PDF">

                                                    <HeaderStyle Width="50px" />

                                                    <ItemStyle Width="50px" />

                                                    <ItemTemplate>

                                                        <asp:UpdatePanel runat="server" ID="upnlPdf">

                                                            <ContentTemplate>

                                                                <asp:ImageButton runat="server" ID="imgbtnPdf" AlternateText="Security Document Print"

                                                                    CommandArgument='<%# Eval("OrderId") %>' ImageUrl="../Images/pdf_icon.gif" ImageAlign="Middle"

                                                                    CommandName="Generate" ToolTip='<%# "Document" + Eval("OrderNo") + "." %>' />

                                                            </ContentTemplate>

                                                            <Triggers>

                                                                <asp:PostBackTrigger ControlID="imgbtnPdf" />                                                            </Triggers>

                                                        </asp:UpdatePanel>

                                                    </ItemTemplate>

                                                </telerik:GridTemplateColumn>

                                            </Columns>

                                        </MasterTableView>

                                        <ClientSettings EnableRowHoverStyle="true">

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

                                            </Scrolling>

                                        </ClientSettings>

                                    </telerik:RadGrid>

</ContentTemplate>

    </asp:UpdatePanel>

</asp:Content>

In code behind

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)

        {

            try

            {

                if (e.CommandName == "Generate")

                {

                    string strOrderId = string.Empty;

                    strOrderId = e.CommandArgument.ToString();

                    LocalReport localReport = new LocalReport();

                localReport.ReportPath = Server.MapPath("~/Reports/report1.rdlc");

                localReport.EnableHyperlinks = true;

                localReport.EnableExternalImages = true;

                DataSet dataset1 = new DataSet();

                DataTable datatable1 =GetDetails(strOrderId);

                datatable1.TableName = "Document";

                dataset1.Tables.Add(datatable1.Copy());

                ReportParameter[] @params = new ReportParameter[4];

                localReport.SetParameters(@params);

                //A method that returns a collection for our report Note: A report can have multiple data sources

                localReport.DataSources.Add(new ReportDataSource("dataset", dataset1.Tables[0]));

                string reportType = "pdf";

                string mimeType = string.Empty;

                string encoding = string.Empty;

                string fileNameExtension = string.Empty;

                string deviceInfo = "<DeviceInfo>" + " <OutputFormat>pdf</OutputFormat>" + "</DeviceInfo>";

                Warning[] warnings = null;

                string[] streams = null;

                byte[] renderedBytes = null;

                //Render the report

                renderedBytes = localReport.Render(reportType, deviceInfo, out mimeType, out encoding, out fileNameExtension, out streams, out warnings);

                //Clear the response stream and write the bytes to the outputstream

                //Set content-disposition to "attachment" so that user is prompted to take an action on the file (open or save)

                Response.Clear();

                Response.ContentType = mimeType;

                strOrderId = "Doc" + strOrderId;

                Response.AddHeader("content-disposition", ("attachment; filename=" + strOrderId + ".pdf"));

                Response.BinaryWrite(renderedBytes);

                Response.End();                }

            }

            catch (Exception ex)

            {

                lblMessage.Text = objUtl.GetErrorMessage(ex, this);

                lblMessage.Visible = true;

            }

        }

Daniel
Telerik team
 answered on 02 Aug 2011
1 answer
85 views
Hi,
I am using fully clickable telerik rad chart in my application...
I can drill down up to 3 levels in chart. When clicking on the bar on main chart, a grid will be displayed and in the grid we have given links to another pages...
Now here the issue is, when value of one bar is too small as compared to another then the bar with too small values is not clickable so I'm unable to drill down to that bar...
I guess this is technical limitation of the control when one bar is having higher values(say in lacs) as compared to another...
So, is there any solution or work around for this??

Thanks in advance...
Vladimir Milev
Telerik team
 answered on 02 Aug 2011
11 answers
339 views
Hi,

I have a few  questions with regards to filtering in RadGrid.
1)
Is there anyway for me to set these filtering settings by default so that I dun have to type this for every columns?
  <telerik:GridBoundColumn DataField="FieldName" HeaderText="1st WS" HeaderStyle-Width="20px"
                    HeaderTooltip="Something" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">

2) When I use CurrentFilterFunction="Contains", how I specify case insensitive matching?

3) Is there anyway to apply the filter without a flicker on the page due to AutoPostBackOnFilter="true" ?


Thanks
Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Aug 2011
8 answers
243 views
Remove 'Add New Record' command bar color in Telerik Grid

hi ,

i am using a TeleriK grid - Skin = Vista
i have a command bar for adding more records - "Add New Record"
All the functionality is working fine...

My issue is related to look and feel

I want the same look of Grid Headder for the command bar

i want command bar color alos in light blue, as the same of Grid headder
Dilip
Top achievements
Rank 1
 answered on 02 Aug 2011
3 answers
304 views
Hi,

  1. Can we customize the Add/Edit Appointments popup with some additional controls like listbox, fileupload etc.?

  2. How to manage snooze and dismiss/dismiss All buttons of Reminder Popup?

    Actual problem is, even if we have dismiss the reminder it will alert, so how to handle it.

     

Find the Attachment of Appointment Add/Edit Popup we requires - is it possible to create?.

Plamen
Telerik team
 answered on 02 Aug 2011
2 answers
84 views
Hi,

I have a GridTemplateColumn that contains an IMG. I have JS code that runs whenever the client side OnRowClick event is fired. This code works fine except for when I click on the IMG.

My grid definition
<telerik:RadGrid ID="grdTicket" runat="server" AutoGenerateColumns="False" Width="946px"
    Font-Names="Verdana" Font-Size="X-Small" AllowSorting="True"
    AllowPaging="True" OnNeedDataSource="grdTicket_NeedDataSource"
    OnPreRender="grdTicket_PreRender"
    OnSelectedIndexChanged="grdTicket_SelectedIndexChanged" CellSpacing="0"
    GridLines="None">
    <ClientSettings>
        <ClientEvents OnRowClick="handleRowClick" />
        <Selecting AllowRowSelect="True" />
    </ClientSettings>
    <MasterTableView Width="100%" NoDetailRecordsText="No Records To Display">
        <Columns>
            <telerik:GridBoundColumn HeaderText="User ID" DataField="UserId" UniqueName="UserID">
            </telerik:GridBoundColumn>
            <telerik:GridTemplateColumn UniqueName="ReplyColumn" AllowFiltering="false">
                <ItemTemplate>
                    <img alt="reply" src="ico_reply_green.png" title="Reply"/>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>
    <PagerStyle Mode="NextPrevNumericAndAdvanced" ShowPagerText="true" />
</telerik:RadGrid>

My JS
<script type="text/javascript">
    function getHeaderRow(sender) {
        var masterTable = sender.get_masterTableView();
        return masterTable.HeaderRow == null ? sender.get_masterTableViewHeader().get_element() : masterTable.HeaderRow;
    }
 
    function handleRowClick(sender, args) {
        var masterTable = sender.get_masterTableView();
        var cellIndex = args.get_domEvent().target.cellIndex;
        var cellText = args.get_domEvent().target.innerHTML;
        var colName = masterTable.getColumnUniqueNameByCellIndex(getHeaderRow(sender), cellIndex)
        alert("Unique name: " + colName + "\nText: " + cellText);
    
</script>

My code behind
protected void grdTicket_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
    DataSet ds = new DataSet();
    DataTable dt = new DataTable();
    dt.Columns.Add("UserId");
 
    for (int i = 0; i < 15; i++)
    {
        DataRow dr = dt.NewRow();
        dr["UserId"] = "XYZ" + i.ToString();
        dt.Rows.Add(dr);
    }
 
    ds.Tables.Add(dt);
    grdTicket.DataSource = ds;
}

What do I need to do to get the OnRowClick event to fire when I click on the IMG?  I'd like to do this without resorting to server side code.

Thanks,

David
Mark
Top achievements
Rank 1
 answered on 02 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Jesse
Top achievements
Rank 2
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?