Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
178 views
I am trying to connect to a cube using C#.    When I connect it through my aspx page it works without any issues.  But I would like to do it using code. I tried this code - but I am not able to do it.   Please let me know what I should fix..

 This is my aspx page 

 <tlrk:RadPivotGrid AllowFiltering="true" AllowSorting="true" ID="RadPivotGrid1"  Width="100%" 
       RowTableLayout="Tabular" FieldsPopupSettings-AggregateFieldsMinCount="2" AllowPaging="true"
       PageSize="20" runat="server" EnableConfigurationPanel="true" EnableZoneContextMenu="true"
       AggregatesPosition="Rows"  EnableToolTips ="true" Skin="Vista">
    <PagerStyle AlwaysVisible="true" />
    <OlapSettings ProviderType="Adomd"> </OlapSettings>      
    <RowHeaderCellStyle Width="100%" />
    <ConfigurationPanelSettings Position="left" LayoutType="Stacked" DefaultDeferedLayoutUpdate="true"  />
    <ClientSettings EnableFieldsDragDrop="true"><Scrolling AllowVerticalScroll="false" ScrollHeight="1000px" /> </ClientSettings>
   </tlrk:RadPivotGrid>

And in my c# I did this  - 

protected void Page_Load(object sender, System.EventArgs e)
 {
   SetupAdomdConnection();
 }
private void SetupAdomdConnection()
 {
  AdomdDataProvider provider = new AdomdDataProvider();
  AdomdConnectionSettings settings = new AdomdConnectionSettings();
  settings.Cube = "cubeName";
  settings.Database = "DBName";
  settings.ConnectionString = "Provider=MSOLAP;Data Source=XXXXX;Initial Catalog=DBName;";
  provider.ConnectionSettings = settings;
 }




Kostadin
Telerik team
 answered on 03 Sep 2014
3 answers
203 views
Hi,

I have a RadDockLayout control with 2 zones and 4 dock and I want to remember the positions and states of the docks. The Built-In Dock State Persistence works for me (other examples change the size of the docks when loading).

However, I would like to implement a 'Reset Layout' button. How do you clear the built-in dock states?

Thanks in advance,
Matt
Danail Vasilev
Telerik team
 answered on 03 Sep 2014
6 answers
419 views
I want to be able to download any file in the FileExplorer, so when i click on a file it does not need to be opened in a Window.
How can I manage this? I tried to use the handler.ashx but i don't know how i can manage it, and when i click on a folder to switch to that folder it raises an error.

Pleas help, many thanx!
Vessy
Telerik team
 answered on 03 Sep 2014
4 answers
536 views
Hello,

I am working on a project with a RadGrid and a RadTreeView.
Each time the user clicks on a node it fills a RadGrid with data.
The controls work in an Ajax environment.
Pressing on a RadTreeView node influences the RadGrid.
Sometimes it takes time to load data into the RadGrid.

The project requirement is that when user clicks on a node in the RadTreeView during an AJAX request/postback, show a JS alert to the user to wait for the reply and only then make another request.

How to perform this?

Thank,
Daniel.
Daniel
Top achievements
Rank 1
 answered on 03 Sep 2014
1 answer
79 views
I have a HeaderTemplate for a RadPanelItem that contains a LinkButton. In the template constructor I pass an ID value that I need the LinkButton to use. The idea is that the PanelBar grows dynamically based on a query. That works fine using the template.

My issue comes in when I try to click the LinkButton to update the RadGrid. Since the template is a class of its own, it cannot directly reference the RadGrid for passing it a new DateTable based on the ID value, stored within the template.

I've tried passing a callback function to the template constructor using System.Action<string>. I then try to attach the callback as an EventHandler to the LinkButton's Click event. So far this hasn't done anything for me.

Template:
public class TelerikTemplates
{
    public class PanelTemplate : ITemplate
    {
        private readonly Label title;
        private readonly LinkButton totalButton;
 
        public PanelTemplate(string pTitle, int pTotal, string pId, System.Action<string> callback)
        {
            title = new Label();
            title.CssClass = "panelTitle";
            title.Text = pTitle;
 
            totalButton = new LinkButton();
            totalButton.CssClass = "totalButton";
            totalButton.Text = pTotal.ToString();
            totalButton.Click += delegate(object sender, System.EventArgs e) { callback(pId); };
        }
 
        public void InstantiateIn(Control pContainer)
        {
            pContainer.Controls.Add(title);
            pContainer.Controls.Add(totalButton);
        }
    }
}

WebForm Code Behind
protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
    }
 
    using (DataTable data = GetData())
    {
        foreach (DataRow dr in data.Rows)
        {
            RadPanelItem titlePanel = new RadPanelItem();
            titlePanel.HeaderTemplate = new TelerikTemplates.PanelTemplate((string)dr["RuleName"], (int)dr["AccountTotal"], (string)dr["RuleId"], populateGrid);
            RadPanelItem subPanel = new RadPanelItem();
            subPanel.ContentTemplate = new TelerikTemplates.ChartAndTableTemplate(dr);
            titlePanel.Items.Add(subPanel);
            panelBar.Items.Add(titlePanel);
        }
    }
}
 
public void populateGrid(string pId)
{
    grid.DataSource = GetGridData(pId);
    grid.Rebind();
}

WebForm Markup
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="author" content="">
    <meta name="description" content="Demo site for home page.">
    <title>Demo: Home (PanelBar)</title>
    <link href="~/Content/less/css/styles.css" rel="stylesheet" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:Label ID="lblTest" runat="server" Text="Test"></asp:Label>
    <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>
    <script type="text/javascript">
        //Put your JavaScript code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
              <UpdatedControls>
                  <telerik:AjaxUpdatedControl ControlID="grid" />
              </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grid">
              <UpdatedControls>
                  <telerik:AjaxUpdatedControl ControlID="grid" />
              </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <section>
        <div>
            <telerik:RadPanelBar Runat="server" Width="100%" ExpandMode="SingleExpandedItem" ID="panelBar">
                <Items>
                </Items>
            </telerik:RadPanelBar>
        </div>
        <div>
            <telerik:RadGrid ID="grid" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" />
        </div>
    </section>
    </form>
</body>
</html>

Thanks for any possible help!
Viktor Tachev
Telerik team
 answered on 03 Sep 2014
1 answer
77 views
I have a RadMenu on my page that I am having problem styling.
The attached snapshot shows how it looks currently. The Quick Links is a menu, The child item keeps wrapping and looks wierd.

I have custom css and I am not using any Telerik base styling. When the width is 100px, the rSlide div is set to 0px width (the container that creates the sliding animation). when the slider is set to 100%, the rSlide is like 14px wide, which is way smaller then the full size of the RadMenu and we are unable to figure this out.

.upper_nav .RadMenu li {
  border: none;
  padding: 0;
  position: relative;
}
.upper_nav .RadMenu .rmHorizontal,
.upper_nav .RadMenu .rmVertical {
  padding: 0;
}
.upper_nav .RadMenu .rmRootLink {
  font-size: 12px;
}
.upper_nav .RadMenu .rmRootLink:link,
.upper_nav .RadMenu .rmRootLink:visited {
  color: #536ba2;
}
.upper_nav .RadMenu .rmRootLink:hover,
.upper_nav .RadMenu .rmRootLink:active,
.upper_nav .RadMenu .rmRootLink:focus {
  color: #3c3d5e;
  background: none;
  border: none;
}
.upper_nav .RadMenu .rmSlide {
  position: absolute;
  display: none;
}
.upper_nav .RadMenu .rmVertical .rmItem {
  display: block;
}
.upper_nav .RadMenu .rmVertical .rmItem span {
  width: 100% !important;
}
Magdalena
Telerik team
 answered on 03 Sep 2014
2 answers
235 views
Hi everyone, 

When I deployment asp.net 4.0 web site on IIS 6.0 server I have error:

[TypeInitializationException: The type initializer for 'Telerik.Web.RenderModesCache' threw an exception.]
Telerik.Web.RenderModesCache.GetViewDescriptors() +0
Telerik.Web.UI.RadDataBoundControl.GetViewScriptReference() +81
Telerik.Web.UI.RadDataBoundControl.GetScriptReferences() +80
Telerik.Web.UI.RadDataBoundControl.System.Web.UI.IScriptControl.GetScriptReferences() +13
System.Web.UI.ScriptControlManager.AddScriptReferenceForScriptControl(List`1 scriptReferences, IScriptControl scriptControl) +41
System.Web.UI.ScriptControlManager.AddScriptReferencesForScriptControls(List`1 scriptReferences) +92
System.Web.UI.ScriptManager.RegisterScripts() +129
System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +122
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +8897866
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2716

web.config has next configuration:

    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="Telerik.Web.UI"/>
      </assemblies>
    </compilation>

     <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <controls>
        <add tagPrefix="telerik" namespace="Telerik.Web.UI" assembly="Telerik.Web.UI"/>
      </controls>
    </pages>

With IIS Express 7.0 the web site working correctly.

What may be cause of the problem?
Viktor
Top achievements
Rank 1
 answered on 03 Sep 2014
8 answers
189 views
With Q3 2013 SP1(2013.3.1114) you may experience JavaScript errors thrown in Internet Explorer 9. This problem may be observed on a machine that does not have audio services started and no audio drivers installed (e.g., MS Windows 2008 Server with no audio device).

The problem lies within the HtmlAudioElement implementation in Internet Explorer – since the OS is unable to play any sound the canPlayType method of the HtmlAudioElement throws Not Implemented exception that breaks further executions of RadControls’ scripts.

We have already handled this problem and the fix will be available in the upcoming internal builds (since 2013.3.1210) and official release (Q1 2014). In case this issue is a showstopper for your current project and you cannot wait for the next official release and / or cannot use an internal build, you can use the following temporary workaround:

Place the following script in the <head> section of the page:
if(typeof(HTMLAudioElement) !== 'undefined' && HTMLAudioElement.prototype && HTMLAudioElement.prototype.canPlayType) {
    var org = HTMLAudioElement.prototype.canPlayType;
    HTMLAudioElement.prototype.canPlayType = function(typeString) {
        var result = "";
        try{
            result = org(typeString);
        }
        catch(e) { }
 
        return result;
    }
}

Marin Bratanov
Telerik team
 answered on 03 Sep 2014
1 answer
51 views
When trying to Login on this Forum coming from a "Reply" button, it gives me an error on the returnUrl Eg.

https://www.telerik.com/login/v2/telerik?ReturnUrl=http%3a%2f%2fwww.telerik.com%2fforums%2fradgrid-inside-radtooltip%3factionMode%3dreplyPost%26postId%3d28fe5a89-c1d4-4b17-b581-8813071c6e99

Marc
Kristina
Telerik team
 answered on 03 Sep 2014
3 answers
134 views
I have a field above my RadDatePicker that has validation requirements and when there is an error the DatePicker button is showing up over the error message. There is no z-index settings setup for any of the items on the page.

How would I go about fixing this issue for just the DatePicker button?

Thanks,
Galin
Telerik team
 answered on 03 Sep 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?