Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
84 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
87 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
169 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
349 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
131 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
145 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 Object, ByVal 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
2 answers
111 views
Hello everyone,

I am using a RadEditor for a small messaging system. However when the user clicks my maintain screen it brings back the data. However the data is not in the same format as they saved it in. Such as spacing, paragraphs, bold, italics, etc. Kind of like these forums, I want to be able to hit edit post or Manage button and comes back with the exact format that the user entered before. Can anyone provide me some assistance. It would be greatly appreciated.

Thanks,
Tommy
Rumen
Telerik team
 answered on 21 Jun 2010
3 answers
176 views
I'm opening an image in radwindow. Rather than resizing the window to fit the image, the image shrinks. Is there a way around this ? Or am i doing something wrong ?
Georgi Tunev
Telerik team
 answered on 21 Jun 2010
5 answers
361 views
HI:

I have basepage.aspx in which I have defined scriptmanager and radwindowmanager. In this page I have a link for create a radwindow. In this new radwindow I load myfirstpage.aspx.


Is there a way for creating from codebehind a radalert window in myfirstpage.aspx, but if the scriptmanager and radwindowmanager are in the basepage.aspx?

Thanks again.
Princy
Top achievements
Rank 2
 answered on 21 Jun 2010
4 answers
378 views
Hello,

I'm binding on the client-side using declarative binding.  Everything works great.  The only issue is when I try to set the page size in the master table view markup as:

<MasterTableView ... PageSize="25" />

I am not using custom paging.  When this runs, the grid doesn't show the pager.  When I remove this and use tableView.set_pageSize(25), it works fine.

Any ideas why?  I'm using the latest telerik, 2010.1.415

Thanks.
Brian Mains
Top achievements
Rank 1
 answered on 21 Jun 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?