Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
69 views
when i enabled the View state compression using Browser.browserfile it compresses the Data (Sent/Received)
Scenario:
I have modal dialogs  where some Searches are done and selections are made on telerik grid.
On closing the dialog window the Selected data are returned back from the dialog window using javascript.
But after this step is done when we do a postback on the Parent page the view state is lost and when the Page loads back the Hidden text boxes/dropdowns which were not visible initially comes back on the screen.

Does doing view state compression cause any issues for the whole website?
Anantharaman
Top achievements
Rank 1
 asked on 19 Apr 2012
1 answer
460 views
I am trying to upload files via a RadGrid that is Ajaxified.  Based on the demos, I am trying to disable Ajax when the "Insert" button is clicked when trying to add a new row to the grid.  The ClientEvents-OnRequestStart event is never firing.

Does anyone have any ideas what I might be doing wrong?

Here is the code for my aspx page:

<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="radScriptManager" runat="server" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function conditionalPostback(sender, args) {
 
                alert('ConditionalPostBack');
 
                var theRegexp = new RegExp("\.RadButtonInsert$", "ig");
 
                if (args.get_eventTarget().match(theRegexp)) {
                    var upload = $find(window['RadUpload1']);
 
                    if (upload.GetFileInputs()[0].value != "") {
                        args.set_enableAjax(false);
                    }
                }
            }
        </script>
 
    </telerik:RadCodeBlock>
 
 
        <telerik:RadAjaxManager ID="radAjaxManager" runat="server" ClientEvents-OnRequestStart="conditionalPostback">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="radButtonEdit">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelToolbar" />
                        <telerik:AjaxUpdatedControl ControlID="panelContent" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="radButtonSave">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="panelToolbar" />
                        <telerik:AjaxUpdatedControl ControlID="panelContent" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
 
        <asp:Panel runat="server">
            <asp:Panel ID="panelToolbar" runat="server">
                <telerik:RadButton ID="radButtonEdit" runat="server" Text="Edit" CausesValidation="false" OnClick="radButtonEdit_Click" />
                <telerik:RadButton ID="radButtonSave" runat="server" Text="Save" CausesValidation="true" OnClick="radButtonSave_Click" />
            </asp:Panel>
 
            <asp:Panel ID="panelContent" runat="server">
 
                <telerik:RadPanelBar ID="radPanelBarAttachments" runat="server" Width="100%">
                    <Items>
                        <telerik:RadPanelItem Text="Attachments" Expanded="true">
                            <ContentTemplate>
 
                                <telerik:RadGrid ID="radGridAttachments" runat="server" AutoGenerateColumns="false" OnNeedDataSource="radGridAttachments_NeedDataSource" OnInsertCommand="radGridAttachments_InsertCommand" OnDeleteCommand="radGridAttachments_DeleteCommand" OnItemCommand="radGridAttachments_ItemCommand">
                                    <MasterTableView CommandItemDisplay="Top" DataKeyNames="ID">
                                        <CommandItemTemplate>
                                            <telerik:RadButton ID="radButtonAdd" runat="server" Text="Add New Record" CommandName="InitInsert" Visible='<%# !radGridAttachments.MasterTableView.IsItemInserted %>' ButtonType="LinkButton">
                                            </telerik:RadButton>
                                        </CommandItemTemplate>
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="ID" HeaderText="ID" ReadOnly="true" />
                                            <telerik:GridBoundColumn UniqueName="FileName" DataField="FileName" HeaderText="File Name" ReadOnly="true" />
                                            <telerik:GridTemplateColumn HeaderText="Attachment (LinkButton)">
                                                <ItemTemplate>
                                                    <asp:LinkButton ID="ViewAttachmentLinkButton" runat="server" CommandName="ViewAttachment">View</asp:LinkButton>
                                                </ItemTemplate>
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="PushButton" Text="Delete" CommandName="Delete" />                             
                                        </Columns>
                                        <EditFormSettings EditFormType="Template">
                                            <FormTemplate>
                                                <telerik:RadUpload ID="RadUpload1" runat="server" InitialFileInputsCount="1" MaxFileInputsCount="1" ControlObjectsVisibility="None" />                                              
                                                <telerik:RadButton ID="RadButtonInsert" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' />
                                                <telerik:RadButton ID="RadButtonCancel" runat="server" Text="Cancel" CausesValidation="false" CommandName="Cancel" />
                                            </FormTemplate>
                                        </EditFormSettings>
                                    </MasterTableView>
                                </telerik:RadGrid>
 
                            </ContentTemplate>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelBar>
            </asp:Panel>
                
        </asp:Panel>
 
    </form>
</body>
</html>


Chad Johnson
Top achievements
Rank 1
 answered on 19 Apr 2012
0 answers
45 views
Using meyer's reset, I get the browser's scrollbars in both IE and Chrome... 

Chrome looks correct (no scrollbars) without reset.
IE has scrollbars with or without reset.

To reproduce it... comment out the reset.css href in the page... and view in chrome and ie.

How can I get it to display without browser scrollbars in both IE and Chrome with the reset css?

meyer's reset.css
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
    display: block;
}
body {
    line-height: 1;
}
ol, ul {
    list-style: none;
}
blockquote, q {
    quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
    content: '';
    content: none;
}
table {
    border-collapse: collapse;
    border-spacing: 0;
}

Schedule.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Schedule.aspx.cs" Inherits="SchedulerDemo.Schedule" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
   <title></title>
   <link href="Styles/reset.css" rel="stylesheet" type="text/css" />
   <style type="text/css">
      html, body, form
      {
         height: 100%;
         margin: 0;
         padding: 0;
      }
   </style>
</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>
         <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
         </asp:ScriptReference>
         <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
         </asp:ScriptReference>
      </Scripts>
   </telerik:RadScriptManager>
   <telerik:RadSplitter ID="RadSplitter1" runat="server" Orientation="Horizontal" Width="100%"
      Height="100%">
      <telerik:RadPane ID="ApplicationNavigationPane" runat="server" Height="100px">
         ApplicationNavigationPane
      </telerik:RadPane>
      <telerik:RadPane ID="ApplicationPane" runat="server">
         <telerik:RadSplitter ID="RadSplitter2" runat="server" Orientation="Vertical">
            <telerik:RadPane ID="LeftPane" runat="server" Width="100px">
               PageNavigationPane
            </telerik:RadPane>
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server">
            </telerik:RadSplitBar>
            <telerik:RadPane ID="RightPane" runat="server">
               <telerik:RadScheduler ID="RadScheduler1" runat="server" Height="100%" DataKeyField="Key"
                  DataDescriptionField="Description" DataStartField="Start" DataSubjectField="Subject"
                  DataEndField="End" MinutesPerRow="5" TimeLabelRowSpan="3">
               </telerik:RadScheduler>
            </telerik:RadPane>
         </telerik:RadSplitter>
      </telerik:RadPane>
   </telerik:RadSplitter>
   </form>
</body>
</html>

Schedule.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace SchedulerDemo
{
    public partial class Schedule : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
 
        }
    }
}

Jeff
Top achievements
Rank 1
 asked on 19 Apr 2012
1 answer
90 views
Been checking the different demos out there, especially in the combobox area, but not having any luck with getting project to build when I put the comboboxes in the inline template and try to load data for the dependent combo. It was working with the combos in the InlineInsertTemplate before I tried to filter them. I'm thinking it's because the controls don't really exist within the template to the code behind environment, or the complier until after the telerik stuff is built. So, also getting errors on the clientid references in the javascript section. Scenario is location for an event, they need to pick the site, then the buildings that are available at that site. Similar to the continent, country scenario.
here's the javascript client side, adapted from demo, with additional function from a forum posting:
<script type="text/javascript">
   //Put your JavaScript code here.
   // global variables for connected comboboxes
   var bldgCombo;
   function pageLoad() {
      bldgCombo = $find("<%= RcbBldg.ClientID %>"); //errors on this line
   }
   function loadBldg(sender, eventArgs) {
      var item = eventArgs.get_item();
      bldgCombo.set_text("Loading...");
      // if a site is selected
      if (item.get_index() > 0) {
         bldgCombo.requestItems(item.get_value(), false);
      }
      else {
         bldgCombo.set_text(" ");
         bldgCombo.clearItems();
      }
   }
   function onBldgRequesting(sender, eventArgs) {
      var cboSite = $find("<%= RcbSite.ClientID%>"); //errors on this line
      eventArgs.get_context()["SiteVal"] = cboSite.get_value();
   }
   function ItemsLoaded(sender, eventArgs) {
      if (sender.get_items().get_count() > 0) {
         // pre-select the first item
         sender.set_text(sender.get_items().getItem(0).get_text());
         sender.get_items().getItem(0).highlight();
      }
      sender.showDropDown();
   }
</script>

This is the aspx code:
   <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <AjaxSettings>
         <telerik:AjaxSetting AjaxControlID="RadScheduler1">
            <UpdatedControls>
               <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
            </UpdatedControls>
         </telerik:AjaxSetting>
      </AjaxSettings>
   </telerik:RadAjaxManager>
   <div>
      <telerik:RadScheduler ID="RadScheduler1" runat="server" DataDescriptionField="EventDescription"
         DataEndField="EventEnd" DataKeyField="EventId" DataRecurrenceField="EventRecurRule"
         DataRecurrenceParentKeyField="EventRecurParentId" DataSourceID="SqlDataSourceEvents"
         DataStartField="EventStart" DataSubjectField="EventSubject" EnableDescriptionField="True"
         Height="650px" Width="900px" WorkDayStartTime="07:30:00" DayStartTime="07:00:00"
         SelectedView="MonthView" CustomAttributeNames="ModifiedBy,LastUpdated,EventRoomLoc"
         Style="margin-bottom: 2" EnableCustomAttributeEditing="True">
         <AdvancedForm EnableCustomAttributeEditing="True" />
         <ResourceTypes>
            <telerik:ResourceType DataSourceID="SqlDataSourceEventCategories" ForeignKeyField="EventCategory"
               KeyField="EvntCatId" Name="Category" TextField="EvntCategoryName" />
            <telerik:ResourceType DataSourceID="SqlDataSourcePOCList" ForeignKeyField="EventPOC"
               KeyField="UserGuid" Name="POC" TextField="UserNameDisplay" />
            <telerik:ResourceType DataSourceID="SqlDataSourceSiteList" ForeignKeyField="EventSiteLoc"
               KeyField="Site_PK" Name="Site" TextField="FullSiteName" />
            <telerik:ResourceType DataSourceID="SqlDataSourceBldgList" ForeignKeyField="EventBldgLoc"
               KeyField="Bldg_PK" Name="Building" TextField="BldgDesc" />
         </ResourceTypes>
         <MultiDayView DayStartTime="07:00:00" />
         <AppointmentTemplate>
            <div class="rsAptSubject">
               <%# Eval("Subject") %>
            </div>
            <%# If(Container.Appointment.Resources.GetResourceByType("POC") Is Nothing, _
           "", "POC: " & Container.Appointment.Resources.GetResourceByType("POC").Text & "<br /> ")%>
            <%# If(Container.Appointment.Resources.GetResourceByType("Site") Is Nothing, "", _
         "Site: " & Container.Appointment.Resources.GetResourceByType("Site").Text & _
         If(Container.Appointment.Resources.GetResourceByType("Building").Text Is Nothing, "", _
           " Bldg: " & Container.Appointment.Resources.GetResourceByType("Building").Text) & _
        " Room: " & Container.Appointment.Attributes("EventRoomLoc"))%>
         </AppointmentTemplate>
         <InlineInsertTemplate>
            <asp:TextBox ID="SubjectTextBox" runat="server" Text='<%# Bind("Subject") %>' Width="80%"></asp:TextBox>
            <div class="ResourceToolbox">
               Category: 
               <telerik:RadComboBox ID="RcbCategory" runat="server" DataSourceID="SqlDataSourceEventCategories"
                  DataTextField="EvntCategoryName" DataValueField="EvntCatId" SelectedValue='<%# Bind("EventCategory") %>'>
               </telerik:RadComboBox>
                Site: 
               <telerik:RadComboBox ID="RcbSite" runat="server" DataSourceID="SqlDataSourceSiteList"
                  DataTextField="FullSiteName" DataValueField="Site_PK" SelectedValue='<%# Bind("EventSiteLoc") %>' 
                  OnClientSelectedIndexChanging="loadBldg" MarkFirstMatch="True">
               </telerik:RadComboBox>
                Bldg: 
<telerik:RadComboBox ID="RcbBldg" runat="server" DataSourceID="SqlDataSourceBldgList"
                  DataTextField="BldgDesc" DataValueField="Bldg_PK" SelectedValue='<%# Bind("EventBldgLoc") %>' 
                  MarkFirstMatch="True" OnClientItemsRequested="ItemsLoaded" OnItemsRequested="RcbBldg_ItemsRequested"
                  >
               </telerik:RadComboBox>                    
               <asp:Button ID="btnInsert" runat="server" Text="Insert" CommandName="Insert" /><asp:Button
                  ID="btnCancel" runat="server" Text="Cancel" CommandName="Cancel" />
            </div>
         </InlineInsertTemplate>
      </telerik:RadScheduler>
   </div>
<!-- sql data sources declared here, then end of form -->



And this is the code behind in VB
Protected Sub LoadBldgs(ByVal siteID As String)
   Dim connection As New SqlConnection(ConfigurationManager.ConnectionStrings("ERMasterConnectionString").ConnectionString)
   ' Select a country based on the continentID.
   Dim adapter As New SqlDataAdapter("SELECT [Bldg_PK], [BldgNbr], [Description], [Site_PK], [BldgNbr]+'-'+[Description] As BldgDesc " & _
                                     "FROM [Building]  WHERE Site_PK=@siteID ORDER By BldgNbr", connection)
   Adapter.SelectCommand.Parameters.AddWithValue("@siteID", siteID)
   Dim dt As New DataTable()
   Adapter.Fill(dt)
   'RcbBldg.DataTextField = "BldgDesc" 'set from initial declaration
   'RcbBldg.DataValueField = "Bldg_PK"
   RcbBldg.DataSource = dt 'does not find this control to allow build
   RcbBldg.DataBind()
End Sub
Private Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
End Sub
Private Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
   If (Not IsPostBack) Then
  ' set up other stuff that not combo related
   ' should not have to do anything with site combo, as pulled from control settings.
   ElseIf Not Page.IsCallback Then
      LoadBldgs(RcbSite.SelectedValue) ' does not find this combo
      strUserGuid = hfUserGuid.Value
   Else
      strUserGuid = hfUserGuid.Value
   End If
End Sub

I'm hoping to continue to use the inline templates, but expect the answer I'm going to get is the advanced form...
Brenda
Ivana
Telerik team
 answered on 19 Apr 2012
1 answer
100 views
Hi,

i have problem when i try to use bubble chart type
my datatable


Title               Complexity             Stategic value            Cost
item 1            25                                 5                          $10,000
item 2            14                                 2                          $2,000
item 2            1                                   2                          $25,000

aspx.cs

<telerik:RadChart ID="RadChart1" SkinsOverrideStyles="true" runat="server"   >
                        <PlotArea>
                        <XAxis AutoScale="False" MaxValue="20" MinValue="0" Step="5">
                        </XAxis>
                        <YAxis AutoScale="False" MaxValue="40" MinValue="0" Step="5">
                        </YAxis>
                        <YAxis2 AutoScale="true"  ></YAxis2>
                        </PlotArea>

                        <Series  >
                               <telerik:ChartSeries Name="Series 1" Type="Bubble"    >
                                <Appearance LegendDisplayMode="ItemLabels" >
                                    <FillStyle MainColor="Blue">
                                    </FillStyle>
                                </Appearance>
                                <Items>
                                     <telerik:ChartSeriesItem XValue="5"  YValue="25"  YValue2="10000"  Name="Item 1">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem XValue="2"  YValue="14"  YValue2="2000"  Name="Item 2">
                                    </telerik:ChartSeriesItem>
                                    <telerik:ChartSeriesItem XValue="2"   YValue="1"  YValue2="25000"   Name="Item 3">
                                    </telerik:ChartSeriesItem>
                                 
                                </Items>
                            </telerik:ChartSeries>
                        </Series>
                    </telerik:RadChart>

when i run it, i can see buble chart image. how to fix it
Petar Marchev
Telerik team
 answered on 19 Apr 2012
5 answers
99 views
Hey there,

Internet Explorer and Fire Fox seem to use different attributes of an image tag to render the tooltip text. Fire Fox uses the 'alt text' as a place holder for unavailable images and the 'title' tag to render the tooltip. Whereas IE seems to use the 'alt text' for both.

Our question is whether or not the RadEditor has a way of editing the 'title' attribute (for FF) through the UI?

Regards,

Gav.
Didier
Top achievements
Rank 2
 answered on 19 Apr 2012
2 answers
123 views
Is there any support in the TabStrip for notification style behavior?  By that, I mean behavior like you would see in an IM client with different tabs for each conversation and a tab blinks when someone has sent a message on a closed tab.  I'm just looking for the ability to cause a tab to have that behavior until the user clicks it.  If there isn't a way to do that now, could it be included in a future release?
Korn1699
Top achievements
Rank 1
 answered on 19 Apr 2012
1 answer
88 views
Hi,

how to resize the content area (both iframe, div) and its parent element. kindly support on js files . 
Rumen
Telerik team
 answered on 19 Apr 2012
5 answers
62 views
Hi

I know this must be quite simple, but none of the examples are quite doing what I am so I am unsure what I need to do!
I am setting custom resources to an appointment which are showing fine and can be selected when inserting, but when I am editing an appointment I don't know how to bind the selected values for the custom resource.

I have looked at this page http://www.telerik.com/community/code-library/aspnet-ajax/scheduler/customize-the-advanced-form-with-the-advanced-template-user-controls.aspx  which was suggested on a previous post but this appears to be just for custom advanced forms but I am not using  a custom form, I am just using custom resources.

A simplified version of how I am adding the custom resources:

if (!IsPostBack)
            {
                 SchToday.CustomAttributeNames = new string[] { "Added Users", "Type" };
                //type is added separately and works fine, the users are added separately as they are only added under certain circumstances.
               SetUsersResource();
}
  private void SetUsersResource()
        {
            UserDetailCollection allUSers = UserManager.GetAllUsers();
            ResourceType users = new ResourceType("Added Users");
 
            users.AllowMultipleValues = true;
            users.ForeignKeyField = "AppointmentId";
            SchToday.ResourceTypes.Add(users);
 
            foreach (UserDetail user in allUSers)
            {
                SchToday.Resources.Add(new Resource("Added Users", user.UserId, user.FullName));
            }
        }

When I bind the scheduler I an doing this:

SchToday.DataSource = GetSchedule();
Where GetSchedule returns a collection of appointments from a table set up as per the documentation.

The selected users are stored in a table called UserAppointments, where the appoinmentId is stored against the user ID.
How do I bind these values back so they are selected when I edit the appointment?

Bex



Peter
Telerik team
 answered on 19 Apr 2012
42 answers
2.3K+ views

You can find attached to this sticky note all available localizations of RadEditor for ASP.NET AJAX provided by our customers. If you have any new localizations for RadEditor and would like to share them with our community, you can send them via the support ticketing system under your Client.net account.

You work will be gladly rewarded.

p.s. Please, note that Telerik supports only the provided English (en-US), German (de-DE) and French (fr-FR) localizations in the Telerik.Web.UI installation and that the attached here localizations could be incomplete or could have mistakes.

p.s.2. If you want t to update any language packs, you can use the following useful tool: http://www.screwturn.eu/(X(1)S(grc2ro551rnpa2eeviiyb5fn))/ResxSync.ashx. It can add new keys to the translated files whenever you have updated the original English files.

Another good diff and merge tool is WinMerge.

Best regards,
Rumen
The Telerik team

Rumen
Telerik team
 answered on 19 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?