Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
157 views
I have a RadComboBox is inside a PagerTemplate within a grid.  Sometimes OnSelectedIndexchanged is called with the incorrect sender and incorrect new value.  ie if i change the combobox on the top the bottom one is passed in.   In the case of the aspx i have below OnSelectedIndexchanged is called with the wrong values.

In particular when combbox is set to the default value(value that it gets set to when first visiting the page) the wrong value is passed in.

Thanks in advance,
Calvin

ps. Below is the a snippet of what i have in the aspx page and the method called when the index is changed:

<telerik:RadGrid ID="RadGrid1"  runat="server"
            Skin="Office2007"
            AllowPaging="True"
            AllowCustomSorting="true"
            PagerStyle-AlwaysVisible="true"
            AllowSorting="True"
            GridLines="None"  
            AutoGenerateColumns="false"
            OnNeedDataSource="RadGid1_NeedDataSource"
            OnItemDataBound="RadGrid1_ItemDataBound"
            OnItemCommand="RadGrid1_ItemCommand"
            OnItemCreated="RadGrid1_ItemCreated"
            OnColumnCreated="RadGrid1_ColumnCreated"
            ShowStatusBar="false"
            ShowHeader="false"
            ClientSettings-Resizing-AllowColumnResize="true"
            >

    <MasterTableView  GroupLoadMode="Client"  >
        <GroupByExpressions>
                    <telerik:GridGroupByExpression>
                        <SelectFields>
                            <telerik:GridGroupByField  HeaderText="&nbsp;&nbsp;&nbsp;&nbsp;" HeaderValueSeparator="" FieldAlias="Events" FieldName="Day" FormatString="{0:dddd, MMMM d, yyyy}"></telerik:GridGroupByField>
                        </SelectFields>
                        <GroupByFields>
                            <telerik:GridGroupByField FieldName="Day" SortOrder="Ascending"></telerik:GridGroupByField>
                        </GroupByFields>
                    </telerik:GridGroupByExpression>
                </GroupByExpressions>
        <Columns>
            <telerik:GridEditCommandColumn UniqueName="viewDetails" ButtonType="ImageButton"  EditImageUrl="../Images/plus.png">
            </telerik:GridEditCommandColumn>
            <telerik:GridTemplateColumn UniqueName="SingleColumn">
                <ItemTemplate>
                    <!-- Items -->                      
                    </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <FormTemplate>
                        <CHO:TemplateViewer id="templateViewer" runat="server" MiniTemplate="true" />
                    </FormTemplate>
                </EditFormSettings>
                <PagerTemplate>
                    <asp:Panel ID="PagerPanel" Style="padding: 6px;" runat="server">
                    <telerik:RadComboBox id="cbSort" runat="server"  AutoPostBack="true" OnSelectedIndexChanged="cbSort_OnIndexChanged" EnableViewState="true">
                        <Items>
                            <telerik:RadComboBoxItem Text="Event Date" Value="Day" />
                            <telerik:RadComboBoxItem Text="Event Name" Value="EventName" />
                            <telerik:RadComboBoxItem Text="Category" Value="CategoryName" />
                        </Items>
                    </telerik:RadComboBox>                            
                        <div class="listPageNumber">                        
                            <asp:Panel runat="server" ID="NumericPagerPlaceHolder" >  </asp:Panel>
                        </div>
                        <div class="listPageSize">                            
                            <span class="listPageSizeText">Page size:</span>
                            <telerik:RadComboBox ID="cbPaging" DataSource="<%# new object[]{10, 20, 30, 40, 50} %>"
                                Skin="Office2007" SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>'
                                runat="server" OnClientSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
                            </telerik:RadComboBox>
                        </div>
                    </asp:Panel>
                </PagerTemplate>
                <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" Position="TopAndBottom" ShowPagerText="false"   ></PagerStyle>
               </MasterTableView>
        </telerik:RadGrid>

-------------------------- code behind----------------

protected void cbSort_OnIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadGrid1.MasterTableView.GroupByExpressions.Clear();
            RadGrid1.MasterTableView.SortExpressions.Clear();
            
            var group = new GridGroupByExpression();
            var field = new GridGroupByField();

            switch (e.Value)
            {
                case DayFieldName:
                   /*set sorting and grouping*/
                    break;
                case CategoryFieldName:
                   /*set sorting and grouping*/
                    break;
                case EventFieldName:
                   /*set sorting and grouping*/
                    break;
                default:
                   /*set sorting and grouping*/
                    break;
            }
            RadGrid1.MasterTableView.Rebind();

            //Selects the correct item in the combo box based on the new value
            ((RadComboBox) RadGrid1.MasterTableView.GetItems(GridItemType.Pager)[0].FindControl("cbSort")).SelectedValue
                = e.Value;
            ((RadComboBox)RadGrid1.MasterTableView.GetItems(GridItemType.Pager)[1].FindControl("cbSort")).SelectedValue
                = e.Value;
        }
Calvin
Top achievements
Rank 1
 answered on 25 Nov 2008
1 answer
143 views

Hi
I am using menu as a context menu on grid.

I am inserting a new menu item at runtime from JavaScript. My problem is that the Menu does not disappear after on click event.

var

 

childItem = new Telerik.Web.UI.RadMenuItem();

 

 

 

 

 

childItem.set_text(strOption);

childItem._click = AdjustOwner_LoadDropdown; // AdjustOwner_LoadDropdown is a function

menu.get_items().insert(2, childItem);

Am I missing setting some property?

 

 

 

 

 

 

 

Punit
Top achievements
Rank 1
 answered on 25 Nov 2008
2 answers
143 views
Hi

I need to add or remove a menu item depending upon some comdiitons in javascript. I found no trouble finding menu object in javascript, I was able to remove an item as well with the help of 

menu._childListElement.removeChild(menu._childListElement.childNodes[4]);

but I could not find a way to add a menu item into it. There are functions like apendchild(child), but I am not able to figure out first how to create a child to pass that as parameter.

Is there a way to do add an item?
Punit
Top achievements
Rank 1
 answered on 25 Nov 2008
1 answer
110 views
Hi,

I am trying to put RadPanelBar into "My Portal" example. So I opened the sample project, edited \Dock\Examples\Default\ExchangeRates.ascx as following:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ExchangeRates.ascx.cs" 
    Inherits="Dock_Examples_Default_ExchangeRates" %> 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> 
<br /> 
Base currency:  
<br /> 
<asp:DropDownList runat="server" ID="BaseCurrencyList" EnableViewState="false" /> 
<br /> 
<br /> 
Foreign currency:  
<br /> 
<asp:DropDownList runat="server" ID="ForeignCurrencyList" EnableViewState="false" /> 
<br /> 
<br /> 
<asp:Button runat="server" ID="SubmitBtn" Text="Calculate Rate" OnClick="SubmitBtn_Click" /> 
<br /> 
<br /> 
<telerik:RadPanelBar ID="uxMenuBar" runat="server" BorderStyle="None" BorderWidth="0px" 
    EnableTheming="True" ExpandMode="FullExpandedItem" Height="200px" PersistStateInCookie="True" 
    Skin="Outlook" Width="100%" OnItemClick="uxMenuBar_ItemClick">  
    <CollapseAnimation Type="None" Duration="100"></CollapseAnimation> 
    <Items> 
        <telerik:RadPanelItem runat="server" Expanded="True" Text="Home">  
            <Items> 
                <telerik:RadPanelItem runat="server" Text="Dashboard"
                </telerik:RadPanelItem> 
                <telerik:RadPanelItem runat="server" Text="Announcements">  
                </telerik:RadPanelItem> 
                <telerik:RadPanelItem runat="server" Text="Events">  
                </telerik:RadPanelItem> 
            </Items> 
        </telerik:RadPanelItem> 
        <telerik:RadPanelItem runat="server" Text="My Inbox">  
            <Items> 
                <telerik:RadPanelItem runat="server" Text="Inbox">  
                </telerik:RadPanelItem> 
                <telerik:RadPanelItem runat="server" Text="Compose">  
                </telerik:RadPanelItem> 
                <telerik:RadPanelItem runat="server" Text="Sent Messages">  
                </telerik:RadPanelItem> 
                <telerik:RadPanelItem runat="server" Text="Recycle Bin">  
                </telerik:RadPanelItem> 
            </Items> 
        </telerik:RadPanelItem> 
    </Items> 
    <ExpandAnimation Type="None" Duration="100"></ExpandAnimation> 
</telerik:RadPanelBar> 
<asp:UpdatePanel runat="server" ID="UpdatePanelHoroscopes">  
    <ContentTemplate> 
        <asp:Literal runat="server" ID="Result" /> 
    </ContentTemplate> 
    <Triggers> 
        <asp:AsyncPostBackTrigger ControlID="SubmitBtn" /> 
    </Triggers> 
</asp:UpdatePanel> 
<br /> 
 

Then I go to design view of ExchangeRates.ascx, double click the RadPanelBar I added to the page. The added RadPanelBar in code behind will looked like this:

    protected void uxMenuBar_ItemClick(object sender, Telerik.Web.UI.RadPanelBarEventArgs e)     
    {     
        System.Diagnostics.Debug.WriteLine("You Clicked: " + e.Item.Text);     
    }    
 

Now I press F5 to debug the sample. Browse to /Dock/Examples/MyPortal/DefaultCS.aspx, then click "Add Dock" button with "Select Module" default to ExchangeRates.ascx. After the PanelBar appears, click "My Inbox" and I am expecting it to expand, but the menu refuse to expand. Refresh the page will show "My Inbox" expanded but again if you now click "Home" menu, which is collapsed at this time it won't expand like it doesn't for "My Inbox" previously.

How can I make RadPanelBar work with MyPortal sample? Did I miss something?

Thanks!

Wei
Wei
Top achievements
Rank 1
 answered on 25 Nov 2008
3 answers
150 views
Before moving to the 2008 Q3 release, we had been using the rsLastSpacingWrapper class to minimize the vertical padding placed within each row/resource. Our css looked like the following:

div.RadScheduler .rsTimelineView .rsAllDayRow td .rsLastSpacingWrapper
{
    height: 5px;
    _height: 5px;
}

This worked properly. Now, with Q3, we are experiencing an issue in which this only resizes the first row/resource displayed. The cause is that only that first row/resource gets the rsLastSpacingWrapper placed on it. Specifically, this is what a td of the first row compared to the second row appear as:

First Row: <TD class="  rsEmptyTimeSlot rsAptCreate"><DIV class="rsWrap rsLastSpacingWrapper" style="HEIGHT: 25px"><!-- --></DIV></TD>

Second Row: <TD class="  rsEmptyTimeSlot rsAptCreate"><DIV class=rsWrap style="HEIGHT: 25px"><!-- --></DIV></TD>

This appears to be a bug, and it's keeping us from being able to size our schedule appropriately.

Also, a related question (though a smaller issue). How is the "Height: 25px" getting rendered to that div? I am having to add "!important" to my css to override this. I'm not sure if we have control over that style attribute or not.

Thanks in advance for a quick response!

Jeff
Peter
Telerik team
 answered on 25 Nov 2008
5 answers
166 views
Hi, I have a grid included in page and I saw that the default height for it is 300px. I want the grid to readjust it's size depending on the number of records it contains. This default height is put into the inner classes of the grid? It cannot be replaced. It would be nice to have a readjustment of the height depending on the number of rows. What can I do? Any ideas?
Thank you.
Dimo
Telerik team
 answered on 25 Nov 2008
1 answer
163 views
Hi guys, I am trying to set a fixed size of a rad grid column to prevent the columns get resized on each page (paging enabled) - depending on their content.

The other thing I want to accomplish is to restrict the grid from displaying more than I specified - and if the content is too long it should get cut.

Is there a way to do this with a setting/property of the RadGrid, because I haven't found anything?

thank you very much, yours, Rene Weiss
Dimo
Telerik team
 answered on 25 Nov 2008
1 answer
124 views
Hello,
I have R.A.D Editor with its css class. I want to add hover state to the style that I use in the HyperLink Manager.
Can you give me an example how to do this.
Thanks in advance
Rumen
Telerik team
 answered on 25 Nov 2008
2 answers
108 views
I have the rad editor set up, deployed, and activated on a test machine to see if I can fix the cross browser compatibility.  I activated on my site and I can see it but for some weird reason I am unable to type anything in the editor.  Any ideas?  This is the latest version of the trial.

Thanks.
Michael
Top achievements
Rank 1
 answered on 25 Nov 2008
1 answer
405 views
Hello,

I have a RadGrid being bound via the DataSource property.  Null is being bound to the control because there are no records, and DataBind() is being called.  But my NoRecordsTemplate isn't being shown; instead, I see a horizontal line and that's it.  No template content.  How do I get this to work?  I'm not doing anything special and I have EnableNoRecordsTemplate set to true.

Thanks.
Dimo
Telerik team
 answered on 25 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?