Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
74 views

TreeList Expand in server side on from open .




Thanks Advance,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 22 Dec 2012
1 answer
50 views
hi there...
i have aspx in my web application that contain RadTabStrip & RadMultiPage that open diffrent UserControl by selecting diffrent tabs...
i want to create dynamicaly RadTab by clicking on a bottun in my UserControl ascx  that open into RadMultiPage but I don't know how.
PLZ help me. If more info needed tell me.
Regards...
Ashkan
Top achievements
Rank 1
 answered on 22 Dec 2012
1 answer
52 views
if (e.Item is TreeListEditableItem && (e.Item as TreeListEditableItem).IsInEditMode)           
            {
                TreeListEditableItem item = (TreeListEditableItem)e.Item;
                RadNumericTextBox Quantity = (RadNumericTextBox)item.FindControl("Quantity");
                RadNumericTextBox Rate = (RadNumericTextBox)item.FindControl("Rate");
                RadNumericTextBox Amount = (RadNumericTextBox)item.FindControl("Amount");

If i going to edit these values are come null

Thanks Advance,
Mohamed.
mohamed
Top achievements
Rank 1
 answered on 22 Dec 2012
1 answer
149 views
Thanks,

Vlad
Stefani Tacheva
Telerik team
 answered on 21 Dec 2012
2 answers
54 views

I have an odd issue I cannot resolve and hoping for the experts there to please assist.

Using Telerik AJAX tools, I have a vertically oriented slide-out menu which works perfectly on IE, Chrome, Safari, Opera - but on Firefox the slide-out menu appears at the far right just beyond the available browser width so it's mostly not visible off to the right side. 

It used to work on Firefox perhaps a year ago but I've upgraded the latest Telerik AJAX tools and it doesn't seem to work anymore.  For what it's worth, I'm using Firefox v12.x but haven't upgraded, as far as I can recall, from an earlier version.
 
It's complicated to give you a working code example so I've attached a simple graphic which illustrates the issue visually.

My code, taken some time ago from one of your forums, is this:

<telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" VisibleDuringInit="False"
  Orientation
="Vertical" Height="700px" BorderSize="0" >

   <telerik:RadPane ID="RadPane1" Runat="server" Width="25px" BackColor="#CCCCFF">

      <telerik:RadSlidingZone ID="RadSlidingZone1" runat="server" BackColor="#CCCCFF" Width="22px" >

         <telerik:RadSlidingPane ID="RadSlidingPane1" runat="server" Title=" SYSTEM MENU " Width="185px"
          BackColor
="#CCCCFF" ResizeText="None" Scrolling="None" EnableDock="False">

                  ' Now we have some simple LinkButtons for menu items here...

         </telerik:RadSlidingPane>                                    

      </telerik:RadSlidingZone>

   </telerik:RadPane>

 </telerik:RadSplitter>

I am hoping there is a simple solution which I can use to adjust for this or rectify it.  I have looked for a week through the forums and couldn't find an exact match to my issue.

Please advise, thanks,
Steve
 

Steve
Top achievements
Rank 1
 answered on 21 Dec 2012
1 answer
112 views
hi,
i've created this radmenu:




<telerik:RadMenu ID="RadMenu1" Runat="server" Flow="Vertical"
    Skin="Sunset">
    <Items>
        <telerik:RadMenuItem runat="server" Text="load iamge profile">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem runat="server" Text="change password">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem runat="server" Text="delete account">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem IsSeparator="True" />
        <telerik:RadMenuItem runat="server" Text="Exit">
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>

now how do start i click on item for example Load image profile this function java?
"openRadWindowProfile(); return false;"

or how do start this code behind when i click on item exit?
Protected Sub Logout_Click(sender As Object, e As System.EventArgs) Handles Logout.Click
    Session.Clear()
    Session.Abandon()
    Page.Response.Redirect("indexprova.aspx")
End Sub

Bye










Boyan Dimitrov
Telerik team
 answered on 21 Dec 2012
1 answer
118 views
Hello,

I try to integrate the Telerik libraries, replacing my asp:gridview by a RadGrid, and I have a problem on an update. Here is my case:

I have a page with an update panel containing a grid (asp:gridview).
On page load, I add dynamically some user controls in an asp place holder. These user controls contain their own update panel with buttons or drop down lists inside (not always the some control). When the button or the drop down list of the UC is selected, it calls some code of the business layer, and the business layer raises an event. The page (which has subscribed to this event), load a datatable, set the datatable as datasource of the grid, and bind it. I update the update panel containing the grid to refresh it. It works correctly.

I want to replace the asp:gridview by a RadGrid.

I keep the update panel containing the RadGrid, because I can't use the RadAjaxManager (even dynamically) because the controls of the user controls are not always the same (button or drop down list).

It seems to work. When I click on a user control button, the gridview is correctly displayed. If a click ONE TIME on a header, the sort is done. BUT if a click again, I obtain the following error message (same error on each action):
Microsoft JScript runtime error: Sys.InvalidOperationException: Impossible de trouver UpdatePanel avec l'ID 'RadGrid1Panel'. S'il est mis à jour dynamiquement, il doit se trouver dans un autre UpdatePanel.

To avoid the update panel problem, I tried to remove the UpdatePanel around the RadGrid and add a RadAjaxPanel (referencing a AjaxLoadingPanel) around all the page. But this time, I see the loading panel but the RadGrid is not updated after the binding. Should I do something to trigger the update ?

Thanks by advance.

Damien
Damien
Top achievements
Rank 1
 answered on 21 Dec 2012
2 answers
102 views
I have data that relates values assigned to discrete date ranges.  Each range is identified by a combination of up to 6 different fields that need to be displayed with the range.

These are all in the primary datasource for the scehduler.  The obvious way would seem to be to simply group the rows by the additional fields so that I get something like,

field1value    field2value    field3value    field4value    __________ timeline ___________
field1value    field2value    field3value    field4value    __________ timeline ___________
field1value    field2value    field3value    field4value    __________ timeline ___________

However, I don't see any straightforward way to accomplish this.  The only thing I can see to do would be to take a roundabout way and create a second data source with the same data and a composite key formed from those additional fields and a foreign key back to the primary.  Add that as a resource, then group by the composite key.

Of course this would dump it all into a single column and leave it without proper headers, not exactly ideal.

Is there a better way to accomplish that?
Marbry
Top achievements
Rank 1
 answered on 21 Dec 2012
3 answers
165 views

Hi,

We use Telerik AJAX ASP.NET extensively. On one page the page response time is very critical. On this page we are using RadGrid and RadComboBox. We have included RadScriptManager too.

One issue we are facing is that when user accesses this page for first time then Telerik.Web.UI.WebResource.js file is downloaded. This file is about 0.7 MB is size! This is creating major performance issues due to which we are being forced to re-write the page without Telerik.

Is there a way to reduce this size? On this particular page we are just using the RadGrid and RadComboBox- is there a way that we include the js for just these two controls? Or is there some other way?

Note: Using Telerik CDN is not going to help as using this yet on first visit the js file size would remain the same. Using RadCompression is not going to help as main problem is the 0.7 MB size of Telerik.Web.UI.WebResource.js.

I googled a bit but did not find a solution. PLEASE HELP, else its bye bye Telrik for us!

Thanks,
- Manoj

Dimitar Terziev
Telerik team
 answered on 21 Dec 2012
1 answer
207 views
Hello
I created custom control to list some data from database. I used radgrid for this. Now everything works fine, except exporting.
When I click export button GvExpertise_ItemCommand is triggered and columns are set hidden. But after that exception is triggered:

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).]
   System.Web.UI.ControlCollection.Add(Control child) +9601391
   Telerik.Sitefinity.Web.SitefinityRequiredControls.Page_PreRenderComplete(Object sender, EventArgs e) +521
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +121
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1155


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.17929



Codefile:
public class ExpertiseListView : SimpleView
   {
       #region control info
       public static Guid GroupPageGuid = new Guid("6743bffb-7cce-4e5c-9d9e-fc7ff1fa5e73");
       public static Guid PageGuid = new Guid("f0608080-5054-48b7-8218-a72ac6842e40");
       public static string TemplateName = "ContactsFormModule.Resources.Backend.ExpertiseListView.ascx";
       protected override string LayoutTemplateName { get { return TemplateName; } }
       #endregion
 
       #region controls
       protected virtual ITextControl LblTitle { get { return base.Container.GetControl<ITextControl>("LblTitle", true); } }               
       protected virtual HyperLink BtnAdd { get { return base.Container.GetControl<HyperLink>("BtnAdd", true); } }     
       protected virtual RadGrid GvExpertise { get { return base.Container.GetControl<RadGrid>("GvExpertise", true); } }
       #endregion
 
       public static string FieldName(bool isGeneral, bool isCompany)
       {
           if (isGeneral && isCompany)
               return "...";
           else if (isGeneral)
               return "..";
           else if (isCompany)
               return ".";
           else
               return string.Empty;
       }
 
       protected override void InitializeControls(GenericContainer container)
       {
           LblTitle.Text = "Expertise";
           LblAdd.Text = "Dodaj";
           //BtnAdd.NavigateUrl = App.WorkWith().Page(ExpertiseEditView.PageGuid).Get().GetFullUrl();
         
           GvExpertise.NeedDataSource += GvExpertise_NeedDataSource;
            
           GvExpertise.ItemCommand += GvExpertise_ItemCommand;
           GvExpertise.ItemDataBound += GvExpertise_ItemDataBound;
       }
 
       void GvExpertise_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
       {
           GvExpertise.DataSource = new ContactsManager().Expertises;
       }
 
       void GvExpertise_ItemDataBound(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridDataItem)
           {
               ((LinkButton)((GridDataItem)e.Item)["DeleteColumn2"].Controls[0]).Text = ((Expertise)e.Item.DataItem).IsVisible ? "skrij" : "prikaži";
               ((Literal)((GridDataItem)e.Item)["Field"].Controls[0]).Text = FieldName(((Expertise)e.Item.DataItem).General,((Expertise)e.Item.DataItem).Company);
           }
       }
 
       void GvExpertise_ItemCommand(object sender, GridCommandEventArgs e)
       {
           if (e.CommandName == "hide")
           {
               int iId = (int)((GridDataItem)e.Item).GetDataKeyValue("Id");
               ContactsManager dataContext = new ContactsManager();
               Expertise expertise = dataContext.Expertises.FirstOrDefault(x => x.Id == iId);
               expertise.IsVisible = !expertise.IsVisible;
               dataContext.SaveChanges();
               GvExpertise.DataSource = new ContactsManager().Expertises;
               this.GvExpertise.DataBind();
           }
           else if (e.CommandName == RadGrid.ExportToCsvCommandName || e.CommandName == RadGrid.ExportToExcelCommandName || e.CommandName == RadGrid.ExportToPdfCommandName)
           {
               GvExpertise.MasterTableView.Columns[3].Visible = false;
               GvExpertise.MasterTableView.Columns[4].Visible = false;
 
           }
       }
   }


Template:
<div class="sfWorkArea">
                <div class="sfMessage sfGridViewMessage"><asp:Literal id="LblMessage" runat="server"></asp:Literal></div>
                <div>
                    <div class="RadGrid RadGrid_Sitefinity rgTopOffset" tabindex="0">
                        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                            <AjaxSettings>
                                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                                    <UpdatedControls>
                                        <telerik:AjaxUpdatedControl ControlID="GvExpertise" />
                                    </UpdatedControls>
                                </telerik:AjaxSetting>
                            </AjaxSettings>
                        </telerik:RadAjaxManager>
                        <telerik:RadGrid ID="GvExpertise" runat="server" AllowPaging="True"
                            AllowSorting="True" AutoGenerateColumns="False" CellPadding="0" Width="100%"
                            DataKeyNames="Id"
                            GridLines="None" PageSize="30" EnableModelValidation="True" Skin="Sitefinity">
                            <ExportSettings ExportOnlyData="True" IgnorePaging="True" OpenInNewWindow="True" HideStructureColumns="true">
                                <Excel Format="Biff"></Excel>
                                <Csv ColumnDelimiter="Semicolon" RowDelimiter="NewLine" EncloseDataWithQuotes="true" FileExtension=".csv" />
                            </ExportSettings>
                            <MasterTableView DataKeyNames="Id" CommandItemDisplay="Top">
                                <CommandItemSettings ShowAddNewRecordButton="false" ShowExportToExcelButton="true" ShowExportToCsvButton="true"/>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="Id" HeaderText="Id" SortExpression="Id" />
                                    <telerik:GridBoundColumn DataField="Description" HeaderText="Strokovno znanje" SortExpression="Description" />                                    
                                    <telerik:GridTemplateColumn DataField="Company,General" SortExpression="Company,General" UniqueName="Field"><ItemTemplate><asp:Literal runat="server" ID="LblField" /></ItemTemplate></telerik:GridTemplateColumn>
                                    <telerik:GridHyperLinkColumn DataNavigateUrlFields="Id" /> 
                                    <telerik:GridButtonColumn Text='' ButtonType="LinkButton" CommandName="hide"  UniqueName="DeleteColumn2"><HeaderStyle Width="20px"></HeaderStyle></telerik:GridButtonColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                    </div>
                </div>
            </div>

ViewState is on, and radscriptmanager exists on page.
Kostadin
Telerik team
 answered on 21 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?