Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
111 views
Hi,

I really didn't know where to post this, as this account that i'm using doesn't have support access, and I was not able to do a Feature request.  I get Telerik from my Client that does have an account.  Well, I've been playing around with creating WebControls that inherit from RadWebControl, and wanted the ability to extend Skins to our new product.  I will try to explain this as best as i could.  In order to get this to work properly I need to modify 2 files within the telerik assembly and am curious if this would be possible to get put in the release code.

First let me I'll paste some code from one of my classes.

[assembly: WebResource("RossPc.Web.UI.Skins.Default.RossForm.Default.css", "text/css", PerformSubstitution = true)]
[assembly: WebResource("RossPc.Web.UI.Skins.Vista.RossForm.Vista.css", "text/css", PerformSubstitution = true)]
[assembly: WebResource("RossPc.Web.UI.Skins.RossForm.css", "text/css", PerformSubstitution = true)]
 
namespace RossPc.Web.UI
{
 
    /// <summary>
    /// RossPc Form control
    /// </summary>
    ///
    [EmbeddedSkin("RossForm", typeof(RossForm), "RossPc.Web.UI.Skins")]
    [EmbeddedSkin("RossForm", "Default", typeof(RossForm), "RossPc.Web.UI.Skins")]
    [EmbeddedSkin("RossForm", "Vista", typeof(RossForm), "RossPc.Web.UI.Skins")]

As you can see here what i'm doing is using your EmbededSkin attribute, with a modification, I added the namespace to the EmbededSkinAtribute.  The following is the modification I did to that file.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
public sealed class EmbeddedSkinAttribute : Attribute
{
    public EmbeddedSkinAttribute(string shortControlName, Type type) :
        this(shortControlName, null, type)
    {
    }
 
    public EmbeddedSkinAttribute(string shortControlName, Type type, string nameSpace) :
        this(shortControlName, null, type, nameSpace)
    {
    }
     
    public EmbeddedSkinAttribute(string shortControlName) :
        this(shortControlName, null, typeof(EmbeddedSkinAttribute))
    {
    }
 
    public EmbeddedSkinAttribute(string shortControlName, string skin) :
        this(shortControlName, skin, typeof(EmbeddedSkinAttribute))
    {
    }
 
    public EmbeddedSkinAttribute(string shortControlName, string skin, string nameSpace) :
        this(shortControlName, skin, typeof(EmbeddedSkinAttribute), nameSpace)
    {
    }
 
    public EmbeddedSkinAttribute(string shortControlName, string skin, Type type)
    {
        _shortControlName = shortControlName;
        _skin = skin;
        _type = type;
    }
 
    public EmbeddedSkinAttribute(string shortControlName, string skin, Type type, string nameSpace)
    {
        _shortControlName = shortControlName;
        _skin = skin;
        _type = type;
        _namespace = nameSpace;
    }
 
    public Type Type
    {
        get
        {
            return _type;
        }
    }
 
    public string Skin
    {
        get
        {
            return _skin;
        }
    }
 
    public string NameSpace
    {
        get
        {
            return _namespace;
        }
    }
     
    public string ShortControlName
    {
        get
        {
            return _shortControlName;
        }
    }
 
 
    public bool IsCommonCss
    {
        get
        {
            return _skin == null;
        }
    }
 
    public string CssResourceName
    {
        get
        {
            if (IsCommonCss)
            {
                return string.Format(NameSpace + ".{0}.css", ShortControlName);
            }
            return string.Format(NameSpace + ".{0}.{1}.{0}.css", Skin, ShortControlName);
        }
    }
 
    private string _skin;
    private string _shortControlName;
    private Type _type;
    private string _namespace = "Telerik.Web.UI.Skins";
}


What these changes to is allow us to use the EmbededSkinAttribute in our own controls that inherit from RadWebControl.

Well this is where i ran into my first issue, Everyting work perfectly "IF" i set EnableStyleSheetCombine="false" on the RadStyleSheetManager.  So, I started to dig a bit and found that if i change the following line 95 of StyleSheetManager.cs to the following.

StyleSheets.Add(new StyleSheetReference(skin.CssResourceName, control.GetType().Assembly.FullName));

Which now loads the skins perfectly.

I have not tested these changes with CDN support or anything, not sure if there might be other places to make changes, but as of now, everything seems to work very nicely.

So what i've done here is added the ability to specify built in skins, and added my own css files to match these skin in my own project.  Once you look more into the sample project you should see what i'm doing and how it works.  It would be very nice if you could add this to the release code, so that I would not have to recompile everytime i needs to release a new version.

Just so you know why we wanted to do this, we wanted to make is easy for us to make our controls follow the same styles you do for all of you skins.

The project was too big to attach below, If you send me a special place to upload it i can, as i won't make the download public as it does contain all source code(telerik, and mine).  I would like to have created a support ticket, but as i said, this account didn't have access.  I would like to get your feedback on this.

Thanks,
Andrew Ross
Dimo
Telerik team
 answered on 27 Oct 2010
3 answers
117 views

I have a usercontrol that has 3 RadPanelBar and each RadPanelBar has 7 RadPanelItem that loads dynamic others usecrontols with RadComboBox

 

<telerik:RadComboBox id="rcbSize" runat="server" width="289px" onselectedindexchanged="rcbSize_SelectedIndexChanged" autopostback="true"

 height="200px"    emptymessage="Search for Size">

 </telerik:RadComboBox>

 

I’m able to load the combo fine but when I select a item on the combo box the RadPanelItem closes and the and the onselectedindexchanged is not trigger.

I’m following the http://www.telerik.com/community/forums/aspnet-ajax/panelbar/radpanelbar-with-load-on-demand-items.aspx example, but I remove the

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

    <AjaxSettings> 

    <telerik:AjaxSetting AjaxControlID="RadPanelBar1">  

        <UpdatedControls> 

        <telerik:AjaxUpdatedControl ControlID="RadPanelBar1" /> 

        </UpdatedControls> 

    </telerik:AjaxSetting> 

    </AjaxSettings> 

</telerik:RadAjaxManager> 

 

Because when I had that on the control the combo would not load, can anyone help me please.

Nikolay Tsenkov
Telerik team
 answered on 27 Oct 2010
1 answer
275 views
Hi,
I have the following 2 methods in my ObjectDataSource constucted class

public virtual IList<TEntity> ODSFindAll(int startRow, int pageSize, string sortExpression, string filterExpression) 
  
public virtual int ODSCountAll(string sortExpression, string filterExpression)

Both these methods are called fine by the ObjectDataSource connected to the RadGrid when 'sorting columns' however when filtering the ODSFindAll method is called with pageSize = 2147483647. It shouldn't be as I can see ODSCountAll being called and returning the correct count for the filter.

Without filtering in RadGrid the pageSize value is 10 and RadGrid lets the ODSFindAll method sort the data return just the 10 rows. It calls the ODSCountAll method to find out how many page rows there actually are.

With sorting & filtering  in RadGrid the pageSize value jumps to 2147483647 - which is wasteful and unessesary because I can see it correctly passing both the sortorder and filterexpression correctly. Why is it doing this??


In another posting you suggest setting MaximumRows on the datasource but this causes problems on the 'page summary' where it incorrectly states "500 items in 32 pages" (where 500 is maximumrows and not the count returned by ODSCountAll when filtering.

The other post I refer to is :

 

http://www.telerik.com/community/forums/aspnet/grid/filtering-and-paging-simultaneously-in-objectdatasource.aspx


Regards, Darren

<UPDATE>
I also found this post http://www.telerik.com/community/forums/aspnet-ajax/grid/maximum-rows-parameter-with-filtering.aspx with no clear outcome..


Iana Tsolova
Telerik team
 answered on 27 Oct 2010
1 answer
149 views
Hello Team,

I have a Radpanelbar on a aspx and 5 items, and when clicked on item, a usercontrol is displayed in the div (that is made visible in the event OnItemClick).

The issue that is occuring is, when I click on one item, the entire is refreshed and all the usercontrol's pageload event is fired on the page.

I am looking at an approach where only the one user control to be loaded on click of one item instead of entire page refresh.

Radpanel looks like:

<telerik:RadPanelBar ID="pnlNav" runat="server" Width="180" OnItemClick="pnlNav_ItemClick"
                        EnableEmbeddedSkins="false" >
                        <Items>
                            <telerik:RadPanelItem Text="UserControl1" Value="UserControl1" Expanded="true"
                                PreventCollapse="true" ExpandedImageUrl="">
                            </telerik:RadPanelItem>
                            <telerik:RadPanelItem Text="UserControl2" BackColor="#608DC8" Value="UserControl2" />
                            <telerik:RadPanelItem Text="UserControl3" Value="UserControl3" />
                            <telerik:RadPanelItem Text="UserControl4" Value="UserControl4" />
                                                   </Items>
                    </telerik:RadPanelBar>


 protected void pnlNav_ItemClick(object sender, RadPanelBarEventArgs e)
    {

 switch (e.Item.Value)
            {

                case "UserControl1":
                    this.UserControl1.Visible = true;
                    break;
                case "UserControl2":
                    this.divUserControl1.Visible = true;
                    this.ucUserControl1.Load();//public method
                    break;
                case "UserControl3":
                  ----//same code
                case "UserControl4":
                   same code
                    break;
}

Please provide any pointers if i am missing anything

Nikolay Tsenkov
Telerik team
 answered on 27 Oct 2010
1 answer
77 views
Hi,

I want to customize the layout of the TabStrip according my requirement but when i try to change the css i am not able to do so.

So Is there any way that i can fulfill my requirements.


Thanks
Yana
Telerik team
 answered on 27 Oct 2010
1 answer
111 views
Hi All,

I have used RadGrid in that i have used Frozen column. It Works fine but when i use scroll it shows well and again i want to go to the actual position at that time scroll disappears and it show only frozen column and the Last Column of the Grid.

Please any one help me out from this problem..

Thanks in advance..
Pavlina
Telerik team
 answered on 27 Oct 2010
1 answer
49 views
I'm using the RadDateInput and after I keyin a invalid date and do a postback the invalid date is getting cleared. Is there a way to prevent this from happening on both the RadDateInput and the RadDatePicker?

Thanks,
Maria Ilieva
Telerik team
 answered on 27 Oct 2010
1 answer
112 views
hi. I am trying to use the url rewriter.net module and it works fine. However when I try to use my radwindow / radwindow manager it essentially tries to load the parent page into the popup. Weird. As soon as i disable the rewriter in the config the functionality is exactly as expected. Any thoughts on how to fix this issue?

code: 
   <script type="text/javascript">
        function OpenPositionedWindow(oButton, url, windowName)
        {
            var oWnd = window.radopen(url,windowName);
        }
    function openRadWindow(CustomerID)
        {
            var oWnd = radopen("ImageManager.aspx?PageID=" + CustomerID, "RadWindow1" );
            oWnd.center();
        }
        </script>

 

 

<telerik:RadWindowManager ReloadOnShow="true" ShowContentDuringLoad="false" AutoSize="true"

 

 

 

EnableShadow="true" ID="RadWindowManager1"

 

 

 

Width="900px" Height="200px" runat="server">

 

 

 

</telerik:RadWindowManager>

 

 

<a href="#"

 

 

 

onclick="openRadWindow('<%# DataBinder.Eval(Container.DataItem, "PageID") %>'); return false;">Image Manager </a>

 

Georgi Tunev
Telerik team
 answered on 27 Oct 2010
1 answer
107 views
Hi,

I would like to know if there is any way to skip the plotting of graph for missing data. My x-axis is of shortdate and y-axis is numeric. The values on the x-axis range from 9/1 to 10/9. my step value on x-axis is 1 day so it plots 1 gridline for each point(1 day). Now, my dataset does not have any items with values for certain dates but it still gets plotted on the x-axis because of the min and max values given to x=axis. Is there any way to suppress the plotting of this x-axis label, if the data set doesn't contain the data? Also, the labels overlap. The date range is 9/5 - 10/9 Attaching chart for your ref.

Thanks.
Evgenia
Telerik team
 answered on 27 Oct 2010
1 answer
175 views
Hi. 

I have a problem with the RadPanelBar when I try to bind it to an OpenAccessDataSource. I have a single level list of data that I try to bind. The problem is that when I bind the control the items are not collapsible. The markup that I use is: 

<telerik:RadPanelBar ID="rpbContainers" runat="server" DataTextField="Name" DataSourceID="oadsContainers" DataValueField="ID" Width="100%" Skin="Windows7" ExpandMode="MultipleExpandedItems"
    AppendDataBoundItems="true" >
    <Items>
        <telerik:RadPanelItem Text="New Container" Value="-1" Expanded="true">
            <ContentTemplate>
                Create new container
            </ContentTemplate>
        </telerik:RadPanelItem>
    </Items>
    <ItemTemplate>
        <telerik:RadPanelItem>
            <Items>
                <telerik:RadPanelItem>
                    <ContentTemplate>
                        <%# Eval("Name") %>
                    </ContentTemplate>
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelItem>
    </ItemTemplate>
</telerik:RadPanelBar>

I also want to have a default element binded to the PanelPar, such as in a drop down's default element. 

Kind regards,
Krasi.
Nikolay Tsenkov
Telerik team
 answered on 27 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?