Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
182 views
I'm working on some JavaScript to set the width of the dropdown list for a RadComboBox to the widest item in the list.  Is there a client-side DropDownWidth property I can use for this?  I didn't see any and so I was trying to set the width of the div containing the dropdown (I use the clientid of the RadComboBox with "_DropDown").  But using the following isn't setting the width:

var ddl = document.getElementById("MainContent_RadComboBox1_DropDown");
ddl.style.width = maxWidth + 'px';

maxWidth is the width of the longest item in the droplist.

Thanks for the help!

Sean M. Severson
Sean Severson
Top achievements
Rank 1
 answered on 19 Nov 2010
4 answers
111 views
After panelbar item collapses, controls are still visible for 1-2 seconds. is there anyway to fix it since it make the web app to look very unprofessional.
Attached is a screenshot and here is a snippet:

<telerik:RadPanelBar ID="RadPanelBar1" Runat="server" Skin="Windows7"
           Width="90%"  ExpandMode="SingleExpandedItem" AllowCollapseAllItems="true">
           <Items>
               <telerik:RadPanelItem runat="server" Text="Company" ImagePosition="Right" ImageUrl="Images/Expand.jpg" ExpandedImageUrl="Images/Collapse.jpg"  >
               <Items>
                   <telerik:RadPanelItem>
                   <ItemTemplate>
                        <uc2:ByCompany ID="ByCompany1" runat="server" />
                   </ItemTemplate>
                   </telerik:RadPanelItem>
               </Items>
                
               </telerik:RadPanelItem >
               <telerik:RadPanelItem runat="server" Text="Analyst" ImagePosition="Right" ImageUrl="Images/Expand.jpg" ExpandedImageUrl="Images/Collapse.jpg">
                <Items>
                   <telerik:RadPanelItem>
                   <ItemTemplate>
                   <uc3:ByAnalyst ID="ByAnalyst1" runat="server" />
              </ItemTemplate>
                   </telerik:RadPanelItem>
               </Items>
                
               </telerik:RadPanelItem >



Thanks
Kamen Bundev
Telerik team
 answered on 19 Nov 2010
1 answer
68 views
We have a custom user control that has RadListBoxes.  We populate the RadListboxes with dynamic Templates in the OnIt method.
sample:
override protected void OnInit(EventArgs e)
{
    //
    // CODEGEN: This call is required by the ASP.NET Web Form Designer.
    //
    InitializeComponent();
 
    if (NumberOfColumns == 1)
    {
        ShelfListBox.ItemTemplate = new DefaultListBoxTemplate();
        CartListBox.ItemTemplate = new DefaultListBoxTemplate();
    }
    else if (NumberOfColumns == 2)
    {
        ShelfListBox.ItemTemplate = new TwoColumnListBoxTemplate();
        CartListBox.ItemTemplate = new TwoColumnListBoxTemplate();
    }
    else if (NumberOfColumns == 3)
    {
        ShelfListBox.ItemTemplate = new ThreeColumnListBoxTemplate();
        CartListBox.ItemTemplate = new ThreeColumnListBoxTemplate();
    }
    base.OnInit(e);
}
Right now we have a page that has 6 of our custom control.  
DefaultListBoxTemplate Code:
/// <summary>
/// DefaultListBox ItemTemplate one column
/// </summary>
public class DefaultListBoxTemplate : ITemplate
{
    /// <summary>
    /// Defines the <see cref="T:System.Web.UI.Control"/> object that child controls and templates belong to. These child controls are in turn defined within an inline template.
    /// </summary>
    /// <param name="container">The <see cref="T:System.Web.UI.Control"/> object to contain the instances of controls from the inline template.</param>
    public void InstantiateIn(Control container)
    {
        var label = new Label
                        {
                            ID = "LabelListItem"
                        };
        label.DataBinding += new EventHandler(LabelListItemDataBinding);
        container.Controls.Add(label);
    }
 
    /// <summary>
    /// Handles the DataBinding event of the LabelListItem control.
    /// </summary>
    /// <param name="sender">The source of the event.</param>
    /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
    private static void LabelListItemDataBinding(object sender, EventArgs e)
    {
        var label = (Label)sender;
        var item = (RadListBoxItem)label.BindingContainer;
        var listItemText = DataBinder.Eval(item.DataItem, "Property1") as String;
        label.Text = listItemText;
    }
}

Everything renders correctly on the page, but for some reason in IE7 only, the display of the radlistboxes disappear.  If the page does something on the client side; some of the radlistobxes reappear and some disappear. very strange occurrences in IE7.  Everything works correctly in IE8 or higher, Firefox and chrome.

tried attaching code in zip file...

Version: Telerik.Web.UI 2010.1.309.35
Kamen Bundev
Telerik team
 answered on 19 Nov 2010
4 answers
246 views
Guys,

I have created a stacked bar chart and I want the Series Item label to be shown besides the segment.
As of now it shows above the segment. I played around with the API and found that it can be positioned either inside or outside.
Can I somehow place the text label besides the segment?

Cheers,
Nitin
Ves
Telerik team
 answered on 19 Nov 2010
3 answers
182 views
I have validaiton setup on some of my input controls, and a RadAjaxManagerProxy setup on the page. 

On first page load my validation is working.  But after ajaxifying the page and when the RadAjaxManager refreshes the Ajax content, the validation doesn't work anymore. 

I have read this article (http://www.telerik.com/help/aspnet-ajax/ajxlimitations.html) re. RadAjax and Validators which suggest placing the validation summary in it's own asp:Panel, but it's still not working.

Any ideas?

<asp:Panel ID="validationSummaryPanel" runat="server">
        <asp:ValidationSummary ID="newClientValidationSummary" runat="server" ShowMessageBox="true"
            ShowSummary="false" ValidationGroup="newClientGroup" />
    </asp:Panel>
    <telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="addClientButton">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="leftContainer" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="validationSummaryPanel" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
    </telerik:RadAjaxLoadingPanel>
Graeme Pickup
Top achievements
Rank 1
 answered on 19 Nov 2010
7 answers
204 views
I noticed that this property takes in object.  What can I put in here to make it zero?  This would be server-side.
Genady Sergeev
Telerik team
 answered on 19 Nov 2010
4 answers
182 views
Please assist. I am using Q1 2010 and am trying to implement an exploding pie chart with ajax enabled. The chart datasource is a SQLServer stored procedure.

I just can't seem to find any examples that actually work in my project. There doesn't seem to be an

ChartSeriesItem.Exploded 

 

 property any longer--- are there any recent examples like this one which looks like it is really old?

http://demos1x.telerik.com/aspnet/Controls/Examples/Integration/Ajax/Chart/DefaultCS.aspx?product=chart

or this one:

http://demos1x.telerik.com/aspnet/Chart/Examples/Programming/Poll/DefaultCS.aspx

Evgenia
Telerik team
 answered on 19 Nov 2010
3 answers
127 views
Hello.

I'm trying to use "inplace editor" jquery plugin (http://jquery-in-place-editor.googlecode.com/svn/trunk/demo/index.html) on page which use telerik rad ajax controls. I have added necessary scripts fallow the instruction (http://www.telerik.com/help/aspnet-ajax/using-jquery-plugins.html) but it doesn't work. When I move my code to plain html page (not aspx) with jquery (without telerik) everything works fine (like on demo page). To be sure I have tested the example from telerik help with BlockUI and this works fine to, so probably the inplace editor" plugin use some more advanced functionalities of jQuery.
Anyone was successfully to integrate this plugin into aspx with telerik scripts registered?

I will be grateful for any help,
Lukas
Peter
Telerik team
 answered on 19 Nov 2010
3 answers
296 views
Hello,

I've seen a lot of examples to access to DataKeyValues from DetailTables, but I cannot find an example about doing the same in NestedViewTemplates.

Here is my RadGrid:

<telerik:RadGrid ID="ListGrid" runat="server" AllowFilteringByColumn="True"
     AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
     GridLines="None" ShowStatusBar="True" ShowGroupPanel="True"
     onneeddatasource="ListGrid_NeedDataSource"
     onitemcommand="ListGrid_ItemCommand">
 
     <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"
         AllowDragToGroup="True">
         <Selecting AllowRowSelect="True" />
     </ClientSettings>
 
     <MasterTableView DataKeyNames="CustomerId" CommandItemDisplay="Top">
         <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
 
         <RowIndicatorColumn>
             <HeaderStyle Width="20px"></HeaderStyle>
         </RowIndicatorColumn>
 
         <ExpandCollapseColumn>
             <HeaderStyle Width="20px"></HeaderStyle>
         </ExpandCollapseColumn>
 
         <NestedViewTemplate>
             <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap">
                 <telerik:RadTabStrip runat="server" ID="CustomersTabStrip" MultiPageID="CustomersMultipage" SelectedIndex="0">
                     <Tabs>
                         <telerik:RadTab runat="server" Text="Contacts" PageViewID="ContactsPageView">
                         </telerik:RadTab>
                         <telerik:RadTab runat="server" Text="Addresses" PageViewID="AddressesPageView">
                         </telerik:RadTab>
                     </Tabs>
                 </telerik:RadTabStrip>
                 <telerik:RadMultiPage runat="server" ID="CustomersMultipage" SelectedIndex="0" RenderSelectedPageOnly="false">
                     <telerik:RadPageView runat="server" ID="ContactsPageView">
                         <telerik:RadGrid runat="server" ID="ContactsGrid" AllowSorting="true" DataKeyNames="ContactId"
                             onneeddatasource="ContactsGrid_NeedDataSource"
                             onitemcommand="ContactsGrid_ItemCommand">
                             <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                                 DataKeyNames="ContactId" PageSize="5" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top">
                                 <Columns>
                                     <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False"
                                         Resizable="False" ShowFilterIcon="False" ShowSortIcon="False"
                                         UniqueName="EditButton" ImageUrl="~/Images/Edit.png" CommandName="Edit">
                                         <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
                                     </telerik:GridButtonColumn>
                                     <telerik:GridBoundColumn DataField="ContactId" HeaderText="Id"
                                         UniqueName="ContactId" Visible="false">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Full Name" DataField="FullName" UniqueName="FullName">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Position" DataField="Position" UniqueName="Position">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Contact Type" DataField="ContactType.Description" UniqueName="ContactType">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridHyperLinkColumn DataNavigateUrlFields="Email" DataNavigateUrlFormatString="mailto:{0}"
                                         DataTextField="Email" HeaderText="Email" UniqueName="Email" Groupable="false"
                                         AllowFiltering="false">
                                     </telerik:GridHyperLinkColumn>
                                     <telerik:GridBoundColumn HeaderText="Phone" DataField="Phone" UniqueName="Phone">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Mobile" DataField="Mobile" UniqueName="Mobile">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False"
                                         Resizable="False" ShowFilterIcon="False" ShowSortIcon="False"
                                         UniqueName="DeleteButton" ImageUrl="~/Images/Delete.png" CommandName="Delete"
                                         ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?" ConfirmTitle="Delete record..."
                                         ConfirmDialogHeight="130px">
                                         <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
                                     </telerik:GridButtonColumn>
                                 </Columns>
                             </MasterTableView>
                         </telerik:RadGrid>
                     </telerik:RadPageView>
                     <telerik:RadPageView runat="server" ID="AddressesPageView">
                         <telerik:RadGrid runat="server" ID="AddressesGrid" AllowSorting="true" DataKeyNames="AddressId"
                             onneeddatasource="AddressesGrid_NeedDataSource"
                             onitemcommand="AddressesGrid_ItemCommand">
                             <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                                 DataKeyNames="AddressId" PageSize="5" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top">
                                 <Columns>
                                     <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False"
                                         Resizable="False" ShowFilterIcon="False" ShowSortIcon="False"
                                         UniqueName="EditButton" ImageUrl="~/Images/Edit.png" CommandName="Edit">
                                         <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
                                     </telerik:GridButtonColumn>
                                     <telerik:GridBoundColumn DataField="AddressId" HeaderText="Id"
                                         UniqueName="AddressId" Visible="false">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Address Type" DataField="AddressType" UniqueName="AddressType">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Full Address" DataField="FullAddress" UniqueName="FullAddress">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Zip Code" DataField="ZipCode" UniqueName="ZipCode">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="City" DataField="City" UniqueName="City">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Province" DataField="Province" UniqueName="Province">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridBoundColumn HeaderText="Country" DataField="Country" UniqueName="Country">
                                     </telerik:GridBoundColumn>
                                     <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False"
                                         Resizable="False" ShowFilterIcon="False" ShowSortIcon="False"
                                         UniqueName="DeleteButton" ImageUrl="~/Images/Delete.png" CommandName="Delete"
                                         ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?" ConfirmTitle="Delete record..."
                                         ConfirmDialogHeight="130px">
                                         <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
                                     </telerik:GridButtonColumn>
                                 </Columns>
                             </MasterTableView>
                         </telerik:RadGrid>
                     </telerik:RadPageView>
                 </telerik:RadMultiPage>
             </asp:Panel>
         </NestedViewTemplate>
 
         <Columns>
             <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False"
                 Resizable="False" ShowFilterIcon="False" ShowSortIcon="False"
                 UniqueName="EditButton" ImageUrl="~/Images/Edit.png" CommandName="Edit">
                 <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
             </telerik:GridButtonColumn>
             <telerik:GridImageColumn AllowFiltering="False" AllowSorting="False"
                 DataAlternateTextField="Name" DataImageUrlFields="Logo"
                 DataImageUrlFormatString="~/Images/Customers/{0}" Groupable="False"
                 HeaderText="Logo" ImageHeight="64px" ImageWidth="64px" ShowSortIcon="False"
                 UniqueName="Logo" ItemStyle-Width="75px">
                 <ItemStyle Width="75px" />
             </telerik:GridImageColumn>
             <telerik:GridBoundColumn DataField="CustomerId" HeaderText="Id"
                 UniqueName="CustomerId" Visible="false">
             </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="Name" HeaderText="Name"
                 UniqueName="Name">
             </telerik:GridBoundColumn>
             <telerik:GridHyperLinkColumn DataNavigateUrlFields="Web"
                 DataNavigateUrlFormatString="{0}" DataTextField="Web"
                 HeaderText="Web" UniqueName="Web" Target="_blank" Groupable="false"
                 AllowFiltering="false">
             </telerik:GridHyperLinkColumn>
             <telerik:GridBoundColumn DataField="Group.Name" HeaderText="Group"
                 UniqueName="Group">
             </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="AccountManager.FullName" HeaderText="Acct. Manager"
                 UniqueName="AccountManager">
             </telerik:GridBoundColumn>
             <telerik:GridBoundColumn DataField="SIC.Description" HeaderText="SIC"
                 UniqueName="SIC">
             </telerik:GridBoundColumn>
             <telerik:GridCheckBoxColumn DataField="IsProspect" HeaderText="Prospect"
                 UniqueName="IsProspect">
             </telerik:GridCheckBoxColumn>
             <telerik:GridButtonColumn ButtonType="ImageButton" Reorderable="False"
                 Resizable="False" ShowFilterIcon="False" ShowSortIcon="False"
                 UniqueName="DeleteButton" ImageUrl="~/Images/Delete.png" CommandName="Delete"
                 ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to delete this record?" ConfirmTitle="Delete record..."
                 ConfirmDialogHeight="130px">
                 <ItemStyle Width="20px" HorizontalAlign="Center" VerticalAlign="Middle" />
             </telerik:GridButtonColumn>
         </Columns>
 
     </MasterTableView>
 
     <PagerStyle Mode="NextPrevAndNumeric" Position="Bottom" />
 
     <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
 
 </telerik:RadGrid>

How can I get parent DataKeyValues from a child ItemCommand event? I need the CustomerId value in order to pass this parameter to another page.

Any idea?
Thanks a lot in advanced,
Jose
Pavlina
Telerik team
 answered on 19 Nov 2010
3 answers
92 views
I have a page that contains a radtabstrip with five tabs.
There is a RadMultiPage that corresponds to each tab.
Each RadMultiPage contains a grid, and each grid does some item manipulation on _OnItemDatabound. Each grid also has paging enabled.
Everything works fine until I go the next page in grid X on Tab X. If I then click Tab Y, Grid Y has lost the changes that had occurred when it was databound. If I forced the grid to rebind, it would fix the problem, but I would rather not rebind this grid.
What causes this grid to revert to it's original state (before onItemDatabound modified the column content)?
Pavlina
Telerik team
 answered on 19 Nov 2010
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?