Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
98 views
Please take a look at www.microsoft.com website. I am also attaching a screenshot here.  
The UI is created like the new Windows Phone 7 interface where if you click the arrow on the far right of the screen, the entire display changes with a different div.  

I think that this is a great way of using up space to show very large forms or articles.

Can someone suggest how to create this kind of layout and can you do this using Telerik controls or jQuery?

Pratik
Marin Bratanov
Telerik team
 answered on 06 Apr 2011
1 answer
278 views
I have a radComboBox in a usercontrol within a RadGrid.

The combo box contains a list of approx 3000 clients, so I have set EnableAutomaticLoadOnDemand = true so that when open the usercontrol, the load time of the form is quite fast.

This works well for adding new records, however when I am trying to edit a record which already has a client set, the SelectedValue property will fail to pick the value from the list (as I guess it hasn't been loaded yet).  As soon as I revert to the default of EnableAutomaticLoadOnDemand = false as shown in my code snippet below, then the SelectedValue property will correctly set the value from the list, but this then takes a couple of seconds to load the combo data.

Is there any way that I can set EnableAutomaticLoadOnDemand = true, while also getting the SelectedValue property to set the correct value from the data source?  (As an added complication, I also have a "Select from Template" combo box which will set various values in other text boxes and combo boxes, which I would also like to use with EnableAutomaticLoadOnDemand = true.)

Thanks for your help,
Ben


 

<tr>

 

 

<td>

 

Client

 

</td>

 

 

<td>

 

 

<telerik:RadComboBox ID="cboClient" Runat="server" AllowCustomText="true"

 

 

DataSourceID="SqlDataSource1" DataTextField="Account" DataValueField="ClientID"

 

 

Skin="Outlook"

 

 

 

SelectedValue='<%# DataBinder.Eval( Container, "DataItem.ClientID") %>'

 

 

 

Width="320px" EnableVirtualScrolling="True"

 

 

 

Filter="Contains" ItemsPerRequest="20" ShowMoreResultsBox="True">

 

 

<itemtemplate>

 

 

<table style="width:300px">

 

 

<tr>

 

 

<td style="width:100px; text-align: left;">

 

<%

#DataBinder.Eval(Container.DataItem, "Account")%>

 

 

 

</td>

 

 

<td style="width:200px; text-align: left;">

 

<%

#DataBinder.Eval(Container.DataItem, "Disp")%>

 

 

 

</td>

 

 

</tr>

 

Vasil
Telerik team
 answered on 06 Apr 2011
1 answer
180 views
Hi,

I have a page that uses a user control that contains a telerik:RadGrid which uses another control for edit that contains a radcombo. I enabled load on demand and everything works fine withone exception. The when typing it doesn't call load on demand only when I scoll down and does not filter based on what the user enteres. Here is the code that is behind the Edit Control.

protected void RadComboBox1_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)

{

IEnumerable<Client> clients = BizLayer.Instance().ClientsGetAllUnfiltered();

var AllClients = from c in clients where c.ClientName.Contains(e.Text) select c;

int itemOffset = e.NumberOfItems;

int endOffset = Math.Min(itemOffset + ItemsPerRequest, AllClients.Count());

e.EndOfItems = endOffset == AllClients.Count();

var filter = AllClients.Skip(itemOffset).Take(ItemsPerRequest);

foreach (Domain.Client c in filter)

{

RadComboBox1.Items.Add(new RadComboBoxItem(c.ClientName.ToString(), c.ClientId.ToString()));

}

e.Message = GetStatusMessage(endOffset, AllClients.Count());

}

Thank you.
Dimitar Terziev
Telerik team
 answered on 06 Apr 2011
1 answer
155 views

I have a Radgrid with button column when I click the button the first time the Radwindow does not open, but it opens on the second click on the same button. I have tried every possible solution in RadAjax but still facing the same problem. I am using Masterpage in this project.

Following are my code in Javascript,Client side and Server side.

//Javascript Code

 
  
function ShowUPExc(partnerid) {
  
                window.radopen("Update.aspx?PartnerID=" + partnerid , "rwUpdateExc");
                return false;
                }

//Client Side Code
  
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgExc">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgExc" />
                    <telerik:AjaxUpdatedControl ControlID="btnUpdate" />
                    <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>   
  
<telerik:RadGrid ID="rgExc" runat="server" AllowFilteringByColumn="True" AllowPaging="True"
                                                    AllowSorting="True" DataSourceID="dsExclusion" GridLines="None" Skin="Outlook"
                                                    Width="100%" ShowGroupPanel="False" AutoGenerateColumns="False" PageSize="2"
                                                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
                                                    ShowHeader="true" OnItemDataBound="rgExc_ItemDataBound" OnItemCommand="rgExc_ItemCommand">
                                                    <HeaderContextMenu>
                                                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                                    </HeaderContextMenu>
                                                    <FilterMenu>
                                                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                                    </FilterMenu>
                                                    <GroupingSettings ShowUnGroupButton="true" CaseSensitive="false" />
                                                    <MasterTableView DataSourceID="dsExclusion" DataKeyNames="ExcType, StartDate, EndDate"
                                                        PageSize="2" Width="100%" GroupLoadMode="Client" EnableNoRecordsTemplate="true"
                                                        ShowHeadersWhenNoRecords="true" AllowFilteringByColumn="false" AllowMultiColumnSorting="false"
                                                        EnableHeaderContextMenu="false">
                                                         
                                                        <Columns>
                                                            <telerik:GridBoundColumn DataField="ExcType" HeaderText="Exc Type" SortExpression="ExcType"
                                                                UniqueName="ExcType" ReadOnly="True" CurrentFilterFunction="EqualTo" AutoPostBackOnFilter="true"
                                                                ShowFilterIcon="false" FilterDelay="4000" Groupable="false" FilterControlWidth="120px"
                                                                HeaderStyle-Width="140px">
                                                            </telerik:GridBoundColumn>
                                                            <telerik:GridDateTimeColumn DataField="StartDate" DataType="System.DateTime" HeaderText="Start Date"
                                                                SortExpression="StartDate" UniqueName="StartDate" AutoPostBackOnFilter="true"
                                                                PickerType="DateTimePicker" FilterControlWidth="150px" ItemStyle-Wrap="false"
                                                                HeaderStyle-Width="170px">
                                                            </telerik:GridDateTimeColumn>
                                                            <telerik:GridDateTimeColumn DataField="EndDate" DataType="System.DateTime" HeaderText="End Date"
                                                                SortExpression="EndDate" UniqueName="EndDate" AutoPostBackOnFilter="true" PickerType="DateTimePicker"
                                                                FilterControlWidth="150px" ItemStyle-Wrap="false" HeaderStyle-Width="170px">
                                                            </telerik:GridDateTimeColumn>
                                                            <telerik:GridTemplateColumn UniqueName="TemplateEditColumn" AllowFiltering="false"
                                                                HeaderStyle-Width="120px">
                                                                <ItemTemplate>
                                                                    <asp:Button ID="btnUpdate" runat="server" Text="Update" CommandArgument='<%# DataBinder.Eval(Container,"ItemIndex")%>'
                                                                        CommandName="UpdateExc" />
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>
                                                        </Columns>
                                                    </MasterTableView>
                                                    <ClientSettings AllowColumnsReorder="False" AllowDragToGroup="False" ReorderColumnsOnClient="False"
                                                        EnableRowHoverStyle="true" EnablePostBackOnRowClick="true" AllowKeyboardNavigation="true">
                                                        <Resizing AllowColumnResize="False" EnableRealTimeResize="False" ResizeGridOnColumnResize="False"
                                                            AllowResizeToFit="true" />
                                                        <Selecting AllowRowSelect="True" />
                                                        <Scrolling AllowScroll="False" UseStaticHeaders="False" SaveScrollPosition="False">
                                                        </Scrolling>
                                                    </ClientSettings>
                                                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                                                </telerik:RadGrid>
  
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true"
        Skin="Office2007">
        <Windows>
            <telerik:RadWindow ID="rwUpdateExc" runat="server" ShowContentDuringLoad="false"
                ReloadOnShow="true" Title="Update Exclusion Window" Width="750px" Height="350px"
                VisibleStatusbar="false" Modal="true" ToolTip="Update Exclusion">
            </telerik:RadWindow>
             
        </Windows>
    </telerik:RadWindowManager>

//Server Side Code
  
protected void rgExclusion_ItemCommand(object source, GridCommandEventArgs e)
    {
if (e.CommandName == "UpdateExc")
        {
            string strEType;
  
            strEType = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["ExcType"].ToString();
  
            if (strEType == "Partner")
            {
                Button btnUExc = (Button)e.Item.FindControl("btnUpdate");
                btnUExc.Attributes["href"] = "#";
                btnUExc.Attributes["onclick"] = String.Format("return ShowUPExc('{0}');", Session["PGEPartnerID"].ToString());
           }
}   
      
}  
Princy
Top achievements
Rank 2
 answered on 06 Apr 2011
4 answers
153 views
Hi there

I'm trying to create a custom Webpart which should work similar to the "Telerik RadEditor for Moss", but with some kind of extended functionality. Also it has to derive from a custom Webpart Base Class which we use in the Project. This base class derives itself from System.Web.UI.WebControls.WebParts.WebPart

I found this tiny bit of documentation here:
http://www.telerik.com/help/aspnet-ajax/moss-radeditor-in-custom-moss-solutions.html

Is there any more documentation about this somewhere, because i don't know  whats is actually needed for the MossRadEditor class to be used within an Weppart. This class is also missing from the API Reference. So i looked with the .net Reflector into the code of the Telerik.SharePoint.RadEditorWebPart, but i'm stuck a little. I don't know what is necesary for me to get it working. Also this WebPart is based on Microsoft.SharePoint.WebPartPages.WebPart which is different somehow.

So far am having a WebPart and a correspondending EditorPart. The Webpart creates a MOSSRadEditor Object, a Literal Control to Show the Content in Display mode, and a Text Field which should save the actuall content.

The EditorPart adds the MOSSRadEditor Objects to the WebPart Controls Collection which works so far. But when i want to save the created content in the ApplyChanges Method of the Editor Part, i can't manage to get the field from which i could read the actual content.

I notice there is some Java Script involved in the RadEditorWebPart class, but i don't know if i need that. Also i'm having trouble setting the ToolsFile Property of the MOSSRadEditor Object. Whenever i do, i get an IO Exception, whereas setting the ConfigFile property is no problem. The File i want to set is definetaly there. I'm using version 5.8.5 of the RadEditorSharepoint.dll
Roger
Top achievements
Rank 1
 answered on 06 Apr 2011
3 answers
162 views
In the project I'm currently working we are trying to reduce the number of server calls we have to do to bind the grid since the data is coming from wcf service which implies some overhead on the overall operation.
Currently for displaying some of the information we are using the Edit Form with a template that only contains read-only fields. Is it possible to make the grid send the HTML code to the client and use a column to expand/collapse the form similar to what is shown in the Grid/Mixed Hierarchy Loading sample?
Thanks in advance for any answer.
Mira
Telerik team
 answered on 06 Apr 2011
3 answers
233 views
Hi
I have set up the editor and linked a toolfile from my menu.
On my aspx page inside the content tag i have inserted the following:

<Content>
<p>Please enter your text</p>
</Content>

 

However when the page is loaded the <p> tags are removed just showing 'Please enter your text'.
Any thoughts would be great.

As a second point if you type into the editor a pound sign in the HTML it shows as '£' rather than &pound;. This is the same for all symbols is there anyway are this?

Thanks in advance
T

Rumen
Telerik team
 answered on 06 Apr 2011
2 answers
111 views
Hi,
Is it possible to minimize distance between node's default image and node's text?   I could not find reletaed style property in TreeView.css file. I attached the screen shot of tree to point the distance I want to narrow.
Thank you,
Kate
Telerik team
 answered on 06 Apr 2011
2 answers
396 views
Hi,

I am using RadWindow as ContentTemplate and in the Content Template I am using a Custom UserControl to do some functionality. In my Default Page, I have a RadWindow which also has a UserControl as ContentTemplate. When this window Opens the user can click a button to open another RadWindow with UserControl as Content Template. Now in this User Control I do some things and then I want to close the window. I can register a startup script from server side to call a CloseWindow javascript function. But the problem is that I can't get the reference of the RadWindow using the GetRadWindow() function, which is used on the content pages to get the reference of the radWindow. But this function does not give me the reference to the Rad window. 
Here is a sample of how i am using most of my RadWindows:
<telerik:RadWindow ID="rw_EditObjectRecordScreen" runat="server" Modal="true" Behaviors="Close, Move, Resize  "
    Width="900px" Height="500px" Visible="true"
    OnClientClose="CloseEditObjectRecordWindowODR"
    DestroyOnClose="true" >
    <ContentTemplate>
        <uc1:EditObjectRecord ID="EditObjectRecord1" runat="server" />
    </ContentTemplate>
</telerik:RadWindow>

I am not using any ScriptManager or AjaxManager, or RadWindowManager on any of my pages. I only use AjaxPanel to wrap all my user Controls. then I use these User Controls in the RadWindow's ContentTemplate. and i open the window from server side by setting the Visible on Page Load property to TRUE.
Is there a way to Close the RadWindow, which is used as a Content Template and the Content is a User Control, from with in the UserControl Code? I have tried GetRadWindow() method but it does not work. then I also tried the following:
function GetContentRadWindow() {
                //using ContentTemplate instead of Navigate URL
                //for RadWindow so we need to get RadWindow by name
                var oWnd = GetRadWindowManager().getWindowByName("RadContentWindow");
                return oWnd;
            }
 but as I am not using any WindowManager so this also did not work. and This code is run on the Page where the RadWindow is defined and not inside the Content.

Any help will be appriciated.

/MO
Mojeeb
Top achievements
Rank 1
 answered on 06 Apr 2011
1 answer
116 views
Hi.
I have a grid with a comboBox that use the event SelectedIndexChanged. AutoPostBack is set to true. The problem is that the event handler does not fired every time the comboBox index changed (in insert-mode), nearly never. When the index changed and it has not fired and i fill in values in some RadTextBox, then it fired when i save the new record. (I have also tried to use the OnTextChanged event and same happens here.)  The comboBox contain a list of companies and i use LinqDataSoure to get the companies.

Here is the code i am using and the  comboBox that not work correctly is with the id= Company :

protected void CompanyComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
      {         
          var combo = (RadComboBox) sender;
          if (combo == null)
              return;
           
          var item = combo.NamingContainer is GridEditFormInsertItem ? (GridEditFormInsertItem)combo.NamingContainer : (GridEditFormItem)combo.NamingContainer;           
          var userNumberBox = (RadNumericTextBox)item.FindControl("UserNumber");
 
          string userNumber = userNumberBox.Text;
          string companyId = combo.SelectedValue;
 
          if (string.IsNullOrEmpty(userNumber) || string.IsNullOrEmpty(companyId))
              return;
 
          var firstNameBox = (RadTextBox)item.FindControl("FirstName");
          var lastNameBox = (RadTextBox)item.FindControl("lastName");
 
          User user = GetUser(userNumber, companyId);
          if (user != null)
          {
              firstNameBox.Text = user.FirstName;
              lastNameBox.Text = user.LastName;
          }
          else
          {
              firstNameBox.Text = string.Empty;
              lastNameBox.Text = string.Empty;
          }
      }

<EditFormSettings EditFormType="Template">
           <EditColumn UniqueName="EditCommandColumn1" ></EditColumn>
          <FormTemplate>                
                    <div id="column1" style="float:left;padding:10px;">
                        <div style="padding-bottom:7px;">
                            <table>                     
                                <tr><td><asp:Label ID="NumberLabel" runat="server" Text="Brukernr.:"></asp:Label></td><td><telerik:RadNumericTextBox runat="server" OnTextChanged="UserNumberTextBox_TextChanged" AutoPostBack="true" ID="UserNumber" Width="107" DataType="System.Int32"><NumberFormat DecimalDigits="0" GroupSeparator=""/></telerik:RadNumericTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" Text="*" ForeColor="Red" ControlToValidate="UserNumber" runat="server"/>
                                <asp:Label ID="Label21" runat="server" Text="Aktiv"></asp:Label>
                                <telerik:RadComboBox runat="server" ID="RadComboBoxActive" Width="45px" DataValueField="IsActive" AutoPostBack="true">
                                    <Items>                             
                                        <telerik:RadComboBoxItem Value="1" Text="Ja"/>
                                        <telerik:RadComboBoxItem Value="0" Text="Nei"/>
                                    </Items>
                                </telerik:RadComboBox></td></tr>
                               <tr><td><asp:Label ID="CompanyLabel" runat="server" Text="Selskap/Avd.:"></asp:Label></td>
                                               <
td colspan="2"><telerik:RadComboBox  ID="Company" runat="server" OnSelectedIndexChanged="CompanyComboBox_SelectedIndexChanged" CausesValidation="true" AutoPostBack="true"   DataSourceID="CompanyDataSource"  DataTextField="Name" DataValueField="CompanyId"  EmptyMessage="Velg et element" AllowCustomText="true"></telerik:RadComboBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" Text="*" ForeColor="Red" ControlToValidate="Company" runat="server"/></td></tr>                                                                                               
                            </table>
                        </div>
                     </div>
                     <div id="column1b" style="float:left;padding:10px;">
                        <div style="padding-bottom:7px;">
                            <table>                    
                                <tr><td><asp:Label ID="FirstNameLabel"  runat="server" Text="Fornavn:"></asp:Label></td><td><telerik:RadTextBox ID="FirstName"  runat="server"  Width="150" MaxLength="20"></telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" Text="*" ForeColor="Red" ControlToValidate="FirstName" runat="server"/></td></tr>
                                <tr><td><asp:Label ID="LastNameLabel"   runat="server" Text="Etternavn:"></asp:Label></td><td><telerik:RadTextBox ID="LastName"   runat="server" Width="150" MaxLength="20"></telerik:RadTextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator8" Text="*" ForeColor="Red" ControlToValidate="LastName" runat="server"/></td></tr>                           
                           </table>                   
                        </div>                                                                  
                    </div>                                                                                                         
Dimitar Terziev
Telerik team
 answered on 06 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?