Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
155 views
I'm fairly new to the Telerik components (by the way a great set of components) and now I have a problem retrieving data in the insertCommand method.
I have RadGrid containing a FormTemplate for editing the data.

<EditFormSettings EditFormType="Template">
    <FormTemplate>
        <div id="editdetail">
            <h2>
                Truck information</h2>                 
            <table class="detailtable" cellspacing="2" cellpadding="1" width="100%" border="0"
                rules="none" style="border-collapse: collapse;">
                <tr>
                    <td class="detaillabel">
                        Brand:
                    </td>
                    <td>
                        <asp:PlaceHolder ID="phBrandComboBox" runat="server"></asp:PlaceHolder>
                    </td>
                </tr>
            </table>
        </div>
    </FormTemplate>
</EditFormSettings>

In ItemDatBound I inject a UserControle containing a Telerik ComboBox in the PlaceHolder.

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="MyTruckItemComboBox.ascx.cs"
    Inherits="Truck_marketplace.MyPortfolio.User_controls.MyTruckItemComboBox" %>
 
    <head>
        <title>MyTruckItemComboBox</title>
    </head>
    <body>
        <telerik:RadComboBox ID="cbMyTruckItemComboBox"
            OnSelectedIndexChanged="cbMyTruckItemComboBox_SelectedIndexChanged"
            runat="server">
        </telerik:RadComboBox>
    </body>
</html>

protected void grMyTruck_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is Telerik.Web.UI.GridEditableItem && e.Item.IsInEditMode)
    {
        // Insert + Edit mode.
 
        Telerik.Web.UI.GridEditableItem EditItem = (Telerik.Web.UI.GridEditableItem)e.Item;
        //Brand
        MyPortfolio.User_controls.MyTruckItemComboBox ComboBoxBrand = (MyPortfolio.User_controls.MyTruckItemComboBox)LoadControl("MyTruckItemComboBox.ascx");
        ComboBoxBrand.ID = "cbBrand";
        ComboBoxBrand.GroupID = "BRD";
        ComboBoxBrand.Languagecode = "en-US";
    }
     
    if (e.Item is Telerik.Web.UI.GridEditFormInsertItem || e.Item is Telerik.Web.UI.GridDataInsertItem)
    {
        // Insert mode
        //Brand
        ComboBoxBrand.BindComboBox2();
        PlaceHolder phBrandComboBox = (PlaceHolder)e.Item.FindControl("phBrandComboBox");
        phBrandComboBox.Controls.Add(ComboBoxBrand);
    }
}

In the InsertCommand I the try to find the ComboBox and reading the SelectedValue from it. But I dont have any luck.
All of the code in the code here fails because the cb is null.

protected void grMyTruck_InsertCommand(object sender, GridCommandEventArgs e)
{
    NMHG.Data.Truck_marketplace.Advert.Advert NewAdvert = new NMHG.Data.Truck_marketplace.Advert.Advert();
 
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem editableItem = e.Item as GridEditableItem;
 
        UserControl userControl = editableItem.FindControl(GridEditFormItem.EditFormUserControlID) as UserControl;
        Telerik.Web.UI.RadComboBox cb = userControl.FindControl("cbBrand") as Telerik.Web.UI.RadComboBox;
        var temp = cb.SelectedValue;
 
        PlaceHolder phBrandComboBox = (PlaceHolder)editableItem.FindControl("phBrandComboBox");
        Telerik.Web.UI.RadComboBox cb2 = phBrandComboBox.FindControl("cbBrand") as Telerik.Web.UI.RadComboBox;
        var temp2 = cb2.SelectedValue;
 
        Telerik.Web.UI.RadComboBox cb3 = editableItem.FindControl("cbBrand") as Telerik.Web.UI.RadComboBox;
        var temp3 = cb3.SelectedValue;
 
        Telerik.Web.UI.RadComboBox cb4 = editableItem.FindControl("cbMyTruckItemComboBox") as Telerik.Web.UI.RadComboBox;
        var temp4 = cb4.SelectedValue;
    }
}

Can some one please help - Thanks.

I properly do some thing stupid so please bare with me ;-)

Anders Pedersen

Anders
Top achievements
Rank 1
 answered on 09 Jul 2013
2 answers
103 views
Hello 

I need a clarification. Can I have different context menu for different root items in a radtreeview?

Thankyou
HG.
Henry
Top achievements
Rank 1
 answered on 09 Jul 2013
3 answers
141 views

     Hi,

I got the error message due to this mis-display

Duy

Pavlina
Telerik team
 answered on 09 Jul 2013
2 answers
78 views
Hi

I am trying to copy the value of one radtextbox to another in js as follows.

txtcompcode._text=txtids1._text;

There is no js error but its not working. Confused whats d issue here?
Please help
Tia
Top achievements
Rank 1
 answered on 09 Jul 2013
6 answers
508 views
Hello,

I have a lot of Grids that display correctly strings from a database that contains Chinese and Japanese characters as well as German and French accents. I have to build links from this items in the Grids to display the details in another page.

The URL passed to the new page has the Chinese/Japanese/etc characters: http://test.aspx?Os=Microsoft Windows 7 旗舰版

Because the way IE works I need this URL to be encoded or when I read back the Os variable it will return the value Microsoft Windows 7 ????.

I know I can accomplish this via the following Sub:

Protected Sub MyGrid_ItemDataBound(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles MyGrid.ItemDataBound  
        If e.Item.ItemType = GridItemType.Item Or e.Item.ItemType = GridItemType.AlternatingItem Then 
            Dim dataItem As GridDataItem = CType(e.Item, GridDataItem)  
            Dim currentRow As DataRowView = DirectCast(e.Item.DataItem, DataRowView)  
            For Each col As GridColumn In RadgridWinServerOSCount.Columns  
                If col.UniqueName = "columnOS" Then 
                    Dim strTxt As String = currentRow.Row("Operating_System").ToString  
                    Dim NewUrl As String 
                    NewUrl = Server.UrlEncode(strTxt)  
                    CType(dataItem("columnOS").Controls(0), HyperLink).NavigateUrl = "~/test.aspx?Os=" & NewUrl  
                End If 
            Next 
        End If 
    End Sub 

However this is kind of unpractical as the application I'm handling have around 25 different Grids where this needs to be changed, hence, even by creating a function to re-write the URL it's going to require a lot of code and the maintenance would be too cumbersome.

I was wondering if there's a way to "automatically" URL encode the GridHyperLinkColumn items in the Grid, I looked throught the documentation but I couldn't find anything relevant. I think to optionally allow this encoding for GridHyperLinkColumn would be really handy.

Thanks!
Tsvetoslav
Telerik team
 answered on 09 Jul 2013
1 answer
46 views
Hi, 
I'm using the Editor in one of the pages, and I'd like that onload the InsertUnOrderedList selected by default so when they click inside the editor they're already typing in bulletpoints
Ianko
Telerik team
 answered on 09 Jul 2013
1 answer
85 views
we run in the environment fine. no problems. but once uploaded to the dedicated server it errors out with the new version. we were running fine with the old one on the server. but once the new components went on the server this happened:

 Could not load file or assembly 'Telerik.Web.Design, Version=2013.2.611.40, Culture=neutral, PublicKeyToken=<BLANK> or one of its dependencies. The system cannot find the file specified.


Source Error: 

Line 22:         <add assembly="ActiveReports.PdfExport, Version=6.2.3681.0, Culture=neutral, PublicKeyToken="/>
Line 23:         <add assembly="ActiveReports.Web, Version=6.2.3681.0, Culture=neutral, PublicKeyToken="/>
Line 24:         <add assembly="Telerik.Web.Design, Version=2013.2.611.40, Culture=neutral, PublicKeyToken="/>
Line 25:       </assemblies>
Line 26:     </compilation>

..removed the keys...

we have no reference to the old files - 2012.2.724.40.

is there something missing with the new one??? Bin 40 UI.dll and UI.Skins.dll are the only 2 files we upload.

Please advise!
SDI
Top achievements
Rank 1
 answered on 09 Jul 2013
3 answers
254 views
Hi,

To show up error icon in client site below code is working, 

args.set_cancel(true);
sender._invalid = true;
     sender.updateCssClass();

How to get the same behavior through code-behind, so that i can avoid writing JavaScript ?
I tried asp custom validator but not able to get the error warning icon.

Thanks,
Stalin

Princy
Top achievements
Rank 2
 answered on 09 Jul 2013
3 answers
533 views
I have just started working with the Telerik controls and HTML, and have had a small roadblock in getting the AjaxLoadingPanel to show. The webpage is very primitive, and the button (that I'd like to trigger the load screen) already has a server-side click event that initiates a copy process written in VB. I don't believe this is possible, but it would seem easy to tie the load screen to the click event in the VB code, and begin it and end it in the codebehind. I don't believe this is how it works though.

I think that my HTML page layout could be one of the reasons that the AjaxLoadingPanel doesn't show. My HTML page doesn't sit in a panel or on a grid, so the entire panel isn't ever updated. Right now the Control ID is set to a button, because it's the only real control I have on the page that does something. However, the load never shows, so I must be doing something incorrectly.

I am running this in IE10. I read through a sticky on the front page that alluded to bugs with a similar situation as this, but they seemed to be in earlier versions of IE. I don't know if that really pertains to me.
The HTML page has two comboboxes and two buttons. The first combobox allows you to choose a sales rep, and upon clicking "copy," all of those rep's sales are copied to the other rep. Therefore, I would like to have the load screen show during the copy process, which can be 5+ seconds depending on how many sales records the first rep has.

Thanks in advance!
<head id="Head1" runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <cc1:ABLDocumentDomain runat="server">
        </cc1:ABLDocumentDomain>
         <div>
            <rad:RadAjaxManager ID="ctlAjaxMgr" runat="server">
                <ClientEvents OnRequestStart="ABLControls_LockPage();" OnResponseEnd="ABLControls_UnlockPage();" />
                <AjaxSettings>
                    <rad:AjaxSetting AjaxControlID="ctlAjaxMgr">
                        <UpdatedControls>
                            <rad:AjaxUpdatedControl ControlID="ctlCopy" LoadingPanelID="ctlLoadingPanel" />
                        </UpdatedControls>
                    </rad:AjaxSetting>
                </AjaxSettings>
            </rad:RadAjaxManager>
 
 
            <%--Copy From Agency table--%>
            <table id="tblBoxHolder" cellspacing="2" style="border-right: #a9c6ee 2px solid;
                padding-right: 0px; border-top: #a9c6ee 2px solid; padding-left: 0px; padding-bottom: 0px;
                margin: 0px; border-left: #a9c6ee 2px solid; padding-top: 0px; border-bottom: #a9c6ee 2px solid;
                height: 1px;" width="50%"; align="center">
                <tr>
                    <%--Table Header--%>
                    <td align="right" colspan="2" style="height: 10px; text-align: Center; vertical-align: middle;
                        background-color: #a9c6ee; font-weight: bold;">
                         Copy Spec Sheets From Agency:
                    </td>
                </tr>
                <tr>
                    <%--From Agency label and combobox rows--%>
                    <td class="style3">
                        Rep #:
                    </td>
                    <td style="width: 80%">
                        <rad:RadComboBox ID="ctlViewFromAgencyRepCombo" runat="server" AutoPostBack="true" AppendDataboundItems = "true" DataSourceID="odsRepNumFromAgency" DataTextField="REP_NUMBER"
                        DataValueField="REP_NUMBER" Skin="ABL_Std" SkinsPath="~/RadControls/ComboBox/Skins" Width="320px" Height="200px" OnSelectedIndexChanged="ctlViewFromAgencyRepCombo_SelectedIndexChanged">
                        <Items>                
                             <rad:RadComboBoxItem Text="-- Select One --" Value="-1" />
                        </Items>
                        </rad:RadComboBox>
                    </td>
                </tr>
                <tr>
 
            <%--Copy To Agency table--%>
            <table id="Table2" cellspacing="2" style="border-right: #a9c6ee 2px solid;
                padding-right: 0px; border-top: #a9c6ee 2px solid; padding-left: 0px; padding-bottom: 0px;
                margin: 0px; border-left: #a9c6ee 2px solid; padding-top: 0px; border-bottom: #a9c6ee 2px solid;
                height: 1px;" width="50%", align="center";>
                <tr>
                    <td align="right" colspan="2" style="height: 10px; text-align: Center; vertical-align: middle;
                        background-color: #a9c6ee; font-weight: bold;">
                         Copy Spec Sheets To Agency:
                    </td>
                </tr>
                <tr>
                    <%--To Agency label and combobox rows (dependent on selected rep). DataID and binding info is in the codebehind.--%>
                    <td class="style3">
                        Rep #:
                    </td>
                    <td style="width: 80%">
                        <rad:RadComboBox ID="ctlViewToAgencyRepCombo" runat="server" AutoPostBack="true" AppendDataboundItems = "true"
                        Skin="ABL_Std" SkinsPath="~/RadControls/ComboBox/Skins" Width="320px" enabled="false" OnSelectedIndexChanged="CopyCheck"
                        Height="200px">
                        <Items>
                             <rad:RadComboBoxItem Text="-- Select One --" Value="-1" />
                        </Items>
                        </rad:RadComboBox>
                    </td>
                </tr>
 
            <%--Close and Copy buttons--%>
            </table>
            <br />
            <br />
            <table width="50%", align="center">
                <tr>
                    <td align="center">
                        <asp:Button ID="ctlCopy" runat="server" Text="Copy" Visible="True" style="width: 95px;" enabled="false" OnClick="ctlCopy_CopySpecSheets" />
                        <asp:Button ID="ctlClose" runat="server" Text="Close" Visible="True" style="width: 95px;" onclientclick="CloseForm()" />
                    </td>
                </tr>
            </table>
            <rad:AjaxLoadingPanel ID="ctlLoadingPanel" runat="server" Height="75px" MinDisplayTime="1000"
                Transparency="5" Width="75px">
                <asp:Image ID="Image1" runat="server" AlternateText="Loading..." ImageUrl="~/Images_ABL_Std/Grid/loading.gif" />
            </rad:AjaxLoadingPanel>
        </div>
Adam
Top achievements
Rank 1
 answered on 09 Jul 2013
1 answer
73 views
Hi telerik folks

From server side code, anyone please show how to hide a contextual tab group?

Regards
Ben
Shinu
Top achievements
Rank 2
 answered on 09 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?