Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
149 views
Hi

I'm trying to get the rotator to automatically advance after a postback to the viewport items where the item was clicked.  For the most part, it's working well, but I'm trying to set the scroll duration to zero, so it jumps to the correct viewport, then back to 500 milliseconds so that it scrolls normally.  I've set the OnItemShown event, and my javascript is:

    // Set up the scroll position  
    var currentIndex = <%= this.CurrentIndex %>;   
    var isFirstLoad = true;   
    function OnItemShown(sender, arg) {     
        if (isFirstLoad == true) { // First loading     
            isFirstLoad = false;  
            sender.set_scrollDuration(0);  
            // now scroll until currentIndex is reached  
            for (var i = 0; i < currentIndex; i++)  
            {  
                sender.showNext(Telerik.Web.UI.RotatorScrollDirection.Up);  
            }  
            sender.set_scrollDuration(500);  
        }     
    }      
 

What happens is the rotator jumps to the correct location, but if sender.showNext is called (e.g. I've jumped one or more sets of items), the scrolling animation goes away.  When I inspect the scrollDuration property, it's still set to 500 milliseconds, but scrolling is instantaneous, not animated.

Any ideas?

Thanks!
Mike
Mike Sharp
Top achievements
Rank 1
 answered on 21 Jun 2010
2 answers
620 views

I have a checkbox in my RadGrid.  If that checkbox is checked, then I change the background color for that row in RadGrid1_ItemDataBound:

Protected Sub RadGrid1_ItemDataBound(ByVal sender As System.Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound

        'Change the color of inactive rows
        If TypeOf e.Item Is GridDataItem Then
            Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
            Dim chk_Status As CheckBox = DirectCast(item.FindControl("chk_Status"), CheckBox)
            If chk_Status.Checked = False Then
                e.Item.BackColor = Drawing.Color.RoyalBlue
            End If
        End If

End Sub

But if I click on any header column to sort that column, the cells in the alternating rows that are highlighted are not highlighted in the background color I specified. 

Richard M
Top achievements
Rank 1
 answered on 21 Jun 2010
3 answers
272 views
I am trying to use a GridDropDownColumn in my RadGrid, using InPlace editing. I have a GridDropDownColumn, which is linked to a User Table via business objects. I can view existing records, and update existing records. However, when I try to insert a new record, I get the catch-all 500 javascript error. I suspect it is missing the bindings when it tries to create the insert form.

I replaced the drop down with a bound column, using the user id (int) as the value, and the insert (and update) works, so I have isolated the issue to the drop down.

I have tried to code a Template column, but I am not good with binding data, so I am not getting the right data to display in the item template label or binding the correct user in the EditItemTemplate value. Also, on the update/insert step the user id is dropped from the values so i can't get that field when it returns to the InsertCommand (or UpdateCommand) method. I have tried populating the drop down in the ItemCreated method, and the ItemDataBound method.

I can post some code, but I was just wondering if someone had an example of a situation like this they can point me to. I have also used user edit forms, and I can come up with that solution also.

Thanks in advance for any insight.
Jay Anderson
Top achievements
Rank 1
 answered on 21 Jun 2010
2 answers
54 views
Hello,

We have a project that uses a conditional IE7 stylesheet that contains a few styles for compatability.    We are also using RadGrid with automatic updates.  The problem we've encountered is that the IE7 stylesheet is being applied when we "Edit" a record in IE8.  We are using 2010 Q1 (2010.1.415.35).   Has anyone encountered this?

Thanks,
Larry
Larry
Top achievements
Rank 1
 answered on 21 Jun 2010
1 answer
81 views
Hello,

I have not been able to locate a solution to my problem, so thought I'd post it here.

I have created a class that extends the RCB (i.e public class MyComboBox : Telerik.Web.UI.RadComboBox { ...}).  Code omitted though it does do a fair bit of company centric implementation.  

I have placed two of these controls on a page, one dynamically loading items the other statically.  I have no issues with the dynamically loaded CB, Including the extended functionality, all works great. 
Though the statically loaded CB does not render the items, everything else seems fine! 

Statically loaded:
This displays an empty ComboBox.

Page code:
<cc1:MyComboBox ID="dl2" TabIndex="7" BackColor="White" Width="72px" runat="server" 
            Font-Size="12px" Font-Names="Arial" CssClass="txtBox">                                     
            <Items>                         
                <telerik:RadComboBoxItem Selected="True" Value="N/A"></telerik:RadComboBoxItem> 
                <telerik:RadComboBoxItem Value="Male" Text="Male"></telerik:RadComboBoxItem> 
                <telerik:RadComboBoxItem Value="Female" Text="Female"></telerik:RadComboBoxItem> 
            </Items>             
</cc1:MyComboBox> 


Dynamically loaded:
This is fine, the items are added in the code behind

<cc1:MyComboBox ID="dl1" TabIndex="1" BackColor="White" Width="160px" runat="server" 
            Font-Size="12px" Font-Names="Arial"
</cc1:MyComboBox> 



I have tried a simple extensions of the RadComboBoxItemCollection and RadComboBoxItem hoping that would help, but it did not.

 public class MyComboBoxItem : RadComboBoxItem 
    { 
        public MyComboBoxItem() 
        { 
        } 
    } 
 
    public class MyComboBoxItemCollection : RadComboBoxItemCollection 
    { 
         
        public MyComboBoxItemCollection():base(null) 
        { 
                          
        } 
 
        public MyComboBoxItemCollection(Control parent):base(parent) 
        { 
 
        } 
    } 

<cc1:MyComboBox ID="dl2" TabIndex="7" BackColor="White" Width="72px" runat="server"  
            Font-Size="12px" Font-Names="Arial" CssClass="txtBox">                                      
            <Items>                          
                <cc1:MyComboBoxItem  Selected="True" Value="N/A"></cc1:MyComboBoxItem>  
                <cc1:MyComboBoxItem Value="Male" Text="Male"></cc1:MyComboBoxItem>  
                <cc1:MyComboBoxItem Value="Female" Text="Female"></cc1:MyComboBoxItem>  
            </Items>              
</cc1:MyComboBox>  

I have a feeling I am missing one vital but simple requirement, though cannot for the life of me see what it is.

Any help would be appreciated.

Cheers.

Simon
Telerik team
 answered on 21 Jun 2010
3 answers
79 views

I'm sure I'm missing something simple here...

I have menu where the root nodes are loaded in the code behind and the child menu items are loaded on demand via a web service.  I need to apply a different css style to child menu items of a specific root item.  I thought I could do this on the OnClientItemPopulated event with the following code:

            function itemPopulated(sender, eventArgs)  
            {  
                var item = eventArgs.get_item();  
                if (item && item.get_value() == "myValue")  
                {  
                    for (var i=0; i < item.get_items().get_count(); i++)  
                    {  
                        item.get_items().getItem(i).set_cssClass("myCssClass");  
                    }  
                }  
            } 

However, I noticed that the style for the items, as the menu is expanding and when it is open, is the default style and that my applied style only takes effect as the menu is closing.  What am I missing?

James
Top achievements
Rank 1
 answered on 21 Jun 2010
4 answers
164 views
Hi,

I'm evaluating Telerik RadControls in a web application. On a RadComboBox change I display another third party control (Aspose.Form) that show my InfoPath forms. I need to view them and on Save button on my page, I want to save that form. However I'm just stuck just getting it loaded on dropdown change event. I get this message: 
"Error: Sys.WebForms.PageRequestManagerServerErrorException: Multiple controls with the same ID 'x0' were found. FindControl requires that controls have unique IDs" as shown in the attachment. 

My usage of controls in .aspx is:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="XmlFormView1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
</telerik:RadAjaxManager>

        <telerik:RadComboBox ID="RadComboBox1" runat="server" 
            AutoPostBack="true" 
            onselectedindexchanged="RadComboBox1_SelectedIndexChanged" 
            Label="Please select a form:" Width="200px">
        <Items> 
        <telerik:RadComboBoxItem Text="" Value="" />
        <telerik:RadComboBoxItem Text="AST Monthly Inspection Checklist" Value="1" />
        <telerik:RadComboBoxItem Text="Book1PMIQAL CHECKLIST" Value="2" />
        </Items>
        </telerik:RadComboBox>

And in codebehind, I have:
    protected void RadComboBox1_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
    {

        //Getting error on DDL change: 
        //Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Multiple controls with the same ID 'x0' were found. FindControl requires that controls have unique IDs.
        try
        {
            XmlFormView1.Controls.Clear();
            XmlFormView1.Reset();
            if (int.Parse(RadComboBox1.SelectedItem.Value) > 0)
            {
                XmlFormView1.XsnLocation = Server.MapPath("Forms/" + RadComboBox1.SelectedItem.Text + ".xsn");
                XmlFormView1.XmlDataString = GetFormDataByID(int.Parse(RadComboBox1.SelectedItem.Value));
            }
            XmlFormView1.RefreshData();
        }
        catch (Exception)
        {
            
            throw;
        }
    }

Sample project can be sent on request so that you can reproduce it.

Thank you,
Parvinder
Simon
Telerik team
 answered on 21 Jun 2010
9 answers
341 views
Hi,

I have gone through the following link.

http://www.telerik.com/community/forums/aspnet-ajax/calendar/datepicker-without-calendar.aspx


I need a month year picker, with the Year list as specified. Eg: if i will select 2009 from some control, and in my Month-Year Picker i need to show only previous three years. (i.e. 2006, 2007, 2008).

Help me.

Thanks & Regards,
Sudhanva.
Martin
Telerik team
 answered on 21 Jun 2010
0 answers
127 views
Hi All,
I want to customize radcombobox i.e. i want to create a combobox by inheriting radcombo. Can you please show me some demo.

Thanks
Akif
Akku
Top achievements
Rank 1
 asked on 21 Jun 2010
2 answers
140 views
Hello all,

  I have a combo box in a form view.  I want to have an event fire when the users selects an item.  I have coded it but I am not getting any joy.  I am usingthe same process that I have used in the past on a normal DDL.  Please help

FormView

<InsertItemTemplate> 
                        <table style="width: 100%;">  
                            <tr> 
                                <td class="MasterFilesLableCells"><asp:Label ID="ItemCodeLabel" runat="server" meta:resourcekey="ItemCodeLabel" /></td>  
                                <td class="MasterFilesDataCells">  
                                    <telerik:RadComboBox ID="ItemCodeRadComboBox" Runat="server"   
                                                         DataSourceID="objDsItemNames"   
                                                         DataTextField="ItemCode"   
                                                         DataValueField="ItemId"   
                                                         AppendDataBoundItems="True" 
                                                         OnSelectedIndexChanged="ItemCodeRadComboBox_SelectedIndexChanged">     
                                        <Items> 
                                            <telerik:RadComboBoxItem runat="server" Selected="True" text="Select An Item" Value="-1" /> 
                                        </Items> 
                                    </telerik:RadComboBox> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td class="MasterFilesLableCells"><asp:Label ID="PrintroomNamesLabel" runat="server" meta:resourcekey="PrintroomNamesLabel" /></td>  
                                <td class="MasterFilesDataCells"><uc2:PrintroomNames ID="PrintroomNames1" runat="server" SelectedValue='<%# Bind("PrintRoomName") %>'  /></td>  
                            </tr> 
                            <tr> 
                                <td class="MasterFilesLableCells"><asp:Label ID="ItemCostLabel" runat="server" meta:resourcekey="ItemCostLabel" /></td>  
                                  
                                <td class="MasterFilesDataCells">  
                                    <asp:Label ID="LabelItemCost" runat="server" Text='<%# Bind("ItemCost") %>' /> 
                                </td> 
                            </tr> 
                             <tr> 
                                <td colspan="2">  
                                    <asp:RadioButton ID="RadioButtonAdjustUp" runat="server" Text="Adjust Up" GroupName="AdjustDirection" Checked='<%# Bind("AdjustDirectionUp") %>' /> 
                                    <asp:RadioButton ID="RadioButtonAdjustDown" runat="server" Text="Adjust Down" GroupName="AdjustDirection" Checked='<%# Bind("AdjustDirectionDown") %>' /> 
                                 </td> 
                            </tr> 
                            <tr> 
                                 <td class="MasterFilesLableCells"><asp:Label ID="AdjustmentAmountLabel" runat="server" meta:resourcekey="AdjustmentAmountLabel" /></td>  
                                <td><telerik:RadTextBox ID="AdjustmentAmountTextBox" runat="server" Text='<%# Bind("AdjustmentAmount") %>'  Skin="Windows7" /></td>  
                            </tr> 
                            <tr> 
                                <td class="MasterFilesLableCells"><asp:Label ID="AdjustmentDateLabel" runat="server" meta:resourcekey="AdjustmentDateLabel" /></td>  
                                <td class="MasterFilesDataCells">  
                                    <telerik:RadDatePicker ID="AdjustmentDateLabelRadDatePicker" runat="server" SelectedDate='<%# Bind("AdjustmentDate") %>' > 
                                    </telerik:RadDatePicker> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td colspan="2"><asp:Label ID="AdjustmentReasonLabel" runat="server" meta:resourcekey="AdjustmentReasonLabel" /></td>  
                            </tr> 
                            <tr> 
                                <td colspan="2">  
                                    <telerik:RadTextBox ID="AdjustmentReasonTextBox" runat="server" Text='<%# Bind("AdjustmentReason") %>' Rows="5" Width="450" Height="50" TextMode="MultiLine" /> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td><asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" /></td>  
                                <td align="right"><asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" /></td>  
                            </tr> 
                        </table> 
                    </InsertItemTemplate> 


Code behind

    Inherits System.Web.UI.Page  
    Dim ItemCodeRadComboBox As Telerik.Web.UI.RadComboBox = CType(FindControl("ItemCodeRadComboBox"), Telerik.Web.UI.RadComboBox)  
    Dim LabelItemCost As Label = CType(FindControl("LabelItemCost"), Label)  
 
    Protected Sub ItemCodeRadComboBox_SelectedIndexChanged(ByVal o As ObjectByVal e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs)  
        Dim ItemsAPI As New SBIS.FMSuite.Items.ItemMasterBLL  
        Dim Items As SBIS.FMSuite.Items.ItemMasterDAL.ItemsDataTable = ItemsAPI.GetItemsByItemID(ItemCodeRadComboBox.SelectedValue)  
        Dim Item As SBIS.FMSuite.Items.ItemMasterDAL.ItemsRow = Items(0)  
 
        If Item.CostingMethod = "Last cost price" Then 
            LabelItemCost.Text = Item.LastCostPrice  
        Else 
            LabelItemCost.Text = Item.AverageCostPrice  
        End If 
    End Sub 
Rhys
Top achievements
Rank 1
 answered on 21 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?