Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
85 views
We have a radgrid that polls the server to get updated data. The client rebind causes the winow to focus - often obscuring any other windows (i.e. popups). Is there a way to prevent this focus from occurring on an AJAX rebind?
Maria Ilieva
Telerik team
 answered on 01 Apr 2013
10 answers
1.9K+ views
Hi,

Let me be clearer:

I have limited space in the application so I needed a way to perform some lookups using list boxes without hiding other controls on the page. So I decided to use a RadComboBox with dropdown. Inside the combobox I place a RadListBox that transfers selected item to a different listbox.

my problem is that each time i select an item in the list box, the combobox closes, then I have to open it again to transfer the selected item to other list box. Of course it closes again and I have to repeat the process.

Is there anyway I can check server side if the combo box is open and/or is there a way I can prevent the combobox from closing each time I select an item in the list box? 

Thanks in advance....
<telerik:RadComboBox ID="RadComboBoxStringInLookupValue" Runat="server" 
     Width="325px" EnableTextSelection="False" DropDownWidth="325px"  
    HighlightTemplatedItems="True" Visible="true" 
    CloseDropDownOnBlur="False" >
    <ItemTemplate>
        <ul>
         <li class="col1">
           <telerik:RadListBox ID="RadListBoxSource" runat="server" Height="125px" 
                DataSourceID="ObjectDataSourceLookUpValues" 
                DataTextField="Descr" DataValueField="Code"  
                AllowTransfer="true" TransferToID="RadListBoxDestination" 
                AllowTransferOnDoubleClick="True" SelectionMode="Multiple" Enabled="True" 
                OnClientSelectedIndexChanging="SetDropDownToOpen"
                OnClientSelectedIndexChanged="SetCanvasChanged"
                ondatabound="OnDataBound" onitemdatabound="OnItemsDataBound" >
               <ButtonSettings ReorderButtons="Common"></ButtonSettings>
           </telerik:RadListBox
         </li>    
         <li class="col2">
            <telerik:RadListBox ID="RadListBoxDestination" runat="server" Height="125px"  SelectionMode="Multiple"
               <ButtonSettings ReorderButtons="Common"></ButtonSettings>
            </telerik:RadListBox
         </li>                                 
        </ul>
      </ItemTemplate
      <Items>
          <telerik:RadComboBoxItem Text="" />
      </Items>           
</telerik:RadComboBox>
Kate
Telerik team
 answered on 01 Apr 2013
1 answer
231 views
I am in the process of updating one of our web applications and replacing the RadUpload with the RadAsyncUpload control (along with updating all the other controls on the page).

The definition from the .aspx page and the the code behind is below...the trouble is that the when I click the Import button, it fires the Page_Load event, telling me it is doing the post back, but the FileUploaded event does not fire, which means that the For Each loop I have in the Button_Click event doesn't see any Uploaded files, and nothing happens.
UPDATE:
I've since tried setting the PostbackTriggers attribute...still nothing.  Getting to the desperate stage here as we need to move this to production next week.  ANY ideas will be greatly appreciated.  Thx.

Sorry if I'm missing something simple, this is my first crack at the Upload/AsyncUpload control, and I didn't see anything in the other threads that got me there.

Thanks all!
        <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server"
            AllowedFileExtensions=".pdf" OnFileUploaded="RadAsyncUpload1_FileUploaded"
            MaxFileInputsCount="1" AllowedMimeTypes="application/pdf"
            Width="300px" InputSize="48" MaxFileSize="20600"
            EnableFileInputSkinning="False" Skin="Vista" ChunkSize="0"
            TargetFolder="c:/TESTUPLOADS">
        </telerik:RadAsyncUpload>
     </td>
</tr>
<tr>
    <td><asp:CheckBox ID="chkLibrary" runat="server" Text="Add To Library"/>
    </td>
</tr>       
<tr>
    <td>
        <table cellpadding="2" cellspacing="2" width="100%" border="0">
            <tr>
                <td style="width:100%;">
                    <asp:CustomValidator ID="Customvalidator1" runat="server"
                     Display="Dynamic"
                     ClientValidationFunction="validateRadAsyncUpload1">
                            <span style="FONT-SIZE: 11px;">Invalid file type.</span>
                     </asp:CustomValidator>
                </td>
                <td>
                    <asp:Button ID="buttonSubmit" runat="server" CssClass="RadUploadButton" Text="Import"  style="width:95px"/>
                </td>
                <td>
                    <asp:Button ID="ctlCancelButton" runat="server" OnClientClick="Cancel_Clicked();return false;" Text="Cancel" style="width:95px"/>
                </td>
                 
            </tr>
Protected Sub RadAsyncUpload1_FileUploaded(sender As Object, e As Telerik.Web.UI.FileUploadedEventArgs) Handles RadAsyncUpload1.FileUploaded
     Dim targetFolder As String = RadAsyncUpload1.TargetFolder
     Response.Write(Server.MapPath(targetFolder & "/" & e.File.FileName))
 
 End Sub
Peter Filipov
Telerik team
 answered on 01 Apr 2013
8 answers
206 views
I'm doing an org chart and am keen on using suite provided by telerik.
Prior to that, I have some uncertainties
1. Can telerik control (RadOrgChart) support a large scale (i.e. 130 employees) org chart? I believe the view at client end will be compromised (i.e. the need to scroll)? Are there other implementation (i.e. a zoom button which allows me to zoom in or out) which I can leverage on from telerik without using the [Change Zoom level] from our IE?
2. Can telerik control (RadOrgChart) read RDF?
Peter Filipov
Telerik team
 answered on 01 Apr 2013
3 answers
71 views
Hello,

How and where to specify/have/assign telerik:GridDropDownColumn on specified column when we have AutoGeneratedColum=True on RadGrid ?

Thant mean having specific colum as telerik:GridDropDownColumn when AutoGeneratedColum=True.

Thank you
Regards
Ganapathy
Shinu
Top achievements
Rank 2
 answered on 01 Apr 2013
2 answers
258 views
I have a date that I pull into my radgrid that I need to then convert to datefield so that I can color code them but whatever i do it never seems to work.  how can I change this string to date.

Protected Sub myRadGridList_ItemDataBound(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles myRadGridList.ItemDataBound
       If TypeOf e.Item Is GridDataItem Then
           Dim Item As GridDataItem = CType(e.Item, GridDataItem)
           Dim DOB As DateTime = DateTime.Parse(Item.Cells(2).Text.ToString)
 
           If DatePart(DateInterval.Month, DOB) = DatePart(DateInterval.Month, Date.Now) Then
               Item.Cells(2).ForeColor = Drawing.Color.Firebrick
           End If
       End If
   End Sub
Princy
Top achievements
Rank 2
 answered on 01 Apr 2013
1 answer
76 views
I need an example of the following.

  • A RadGrid bound via its OnNeedDataSource event. The grid should also have an Edit Template. 
  • The source of data should include at least two fields, LookupId and LookupValue.  Of these two, only LookupValue should be visible when NOT editing.
  • When editing or inserting, the edit template should contain a DropDownList or RadComboBox bound to a Lookup Table of IDs and Values.  Best would be if that source were an ObjectDataSource since that's what I'm using, but not sure that's required.

This seems like a fairly common scenario, but I'm having no success finding an example. The only example embedded DropDownList in the demo isn't even bound.
Shinu
Top achievements
Rank 2
 answered on 01 Apr 2013
3 answers
123 views
i tried numerous ways but still not able to get the paging work correctly. I am using JSON to bind the radgrid client side. Everything works  well except paging.

Please let me know how can I get the paging work with JSOn method. I dont want to do it with Getdate() and Getcount() methods

Attached is my code
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage/cp.master" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="Secure_test" %>
 <%@ OutputCache Location="None" VaryByParam="None" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

    <title></title>
    <script src="../Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>  
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

           // function OnbuttonClient() {
           function pageLoad(sender, eventArgs) {
                var GridData;

                jQuery.ajax({
                    type: 'POST',
                    contentType: 'application/json; charset=utf-8',
                    data: '',
                    dataType: 'JSON',
                    url: 'test.aspx/BindGrid',
                    success: function (result) {

                        GridData = result.d;
                         if (GridData.length > 0) {

                            var divGridContainer = document.getElementById('divGridContainer');
                            divGridContainer.style.display = "";
                            var tableView = $find("<%= RadGvManageOrder.ClientID %>").get_masterTableView();
                            tableView.set_dataSource(GridData);
                            tableView.dataBind();
                            tableView.set_virtualItemCount(GridData.length);
                        }
                        else {
                            var divGridContainer = document.getElementById('divGridContainer');
                            divGridContainer.style.display = "none";
                        }
                    },
                    error: function () {
                        alert('Error on binding the data');
                    }
                });

                return false;

               
            }

            function RadGrid1_RowDataBound(sender, args) {
//                var radTextBox1 = args.get_item().findControl("OrderID"); // find control
//                radTextBox1.set_value(args.get_dataItem()["OrderID"]);
            }

            function RadGrid1_Command(sender, args) {
            }
        </script>
        <script type="text/javascript">

            function SelectAllCheckboxesSpecific(spanChk) {

                var IsChecked = spanChk.checked;

                var Chk = spanChk;
                Parent = document.getElementById('<%= RadGvManageOrder.ClientID %>');

                var items = Parent.getElementsByTagName('input');

                for (i = 0; i < items.length; i++) {

                    if (items[i].id != Chk && items[i].type == "checkbox") {

                        if (items[i].checked != IsChecked) {

                            items[i].click();

                        }

                    }

                }

            }
        </script>
    </telerik:RadCodeBlock>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <div>
       
        <asp:Button ID="Button1" Text="Bind Grid" runat="server" OnClientClick="return OnbuttonClient();" />
        <div id="divGridContainer" style="display: none;">
         <asp:UpdatePanel ID="UpdatePanel1" runat="server">
         <ContentTemplate>
            <telerik:RadGrid ID="RadGvManageOrder" runat="server" PageSize="4"
            runat="server" BorderStyle="None" GridLines="None" AutoGenerateColumns="False" AllowPaging="True" AllowSorting="True">
           <ExportSettings HideStructureColumns="true" />
               <MasterTableView  ToolTip="Right click for more details.">
                                                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                                                <HeaderStyle Width="20px"></HeaderStyle>
                                                            </RowIndicatorColumn>
                                                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                                                <HeaderStyle Width="20px"></HeaderStyle>
                                                            </ExpandCollapseColumn>
                                                            <EditFormSettings>
                                                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                                                </EditColumn>
                                                            </EditFormSettings>
                                                            <Columns>
                                                            <telerik:GridTemplateColumn  ItemStyle-CssClass="td" HeaderText="OrderSelected" UniqueName="OrderSelected" DataField="OrderID">
                                                                    <HeaderTemplate>
                                                                        <asp:CheckBox ID="chkAll" onclick="javascript:SelectAllCheckboxesSpecific(this);"
                                                                            runat="server" />
                                                                    </HeaderTemplate>
                                                                    <ItemTemplate>
                                                                        <asp:CheckBox ID="chkThis" runat="server" />
                                                                        <asp:Label ID="lbl_OrderId" Visible="false" runat="server" ></asp:Label>
                                                                        <%--<asp:Label ID="lbl_SourceID" runat="server" Visible="false" Text='<%#Eval("SourceID") %>'></asp:Label>--%>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>
                                                               
                                                                <telerik:GridBoundColumn ItemStyle-CssClass="td" DataField="OrderNo" HeaderText="Customer Job Number" SortExpression="OrderNo">
                                                                </telerik:GridBoundColumn>
                                                                
                                                                <telerik:GridTemplateColumn ItemStyle-CssClass="td" HeaderText="eMerx Job Number" UniqueName="JobNumber" SortExpression="OrderID">
                                                                    <ItemTemplate>
                                                                        <input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" />
                                                                        <asp:Label ID="lblTargetShippingDate" runat="server" Visible="false"></asp:Label>
                                                                        <asp:Label ID="lblOrderID" runat="server" ></asp:Label>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>


                                                                <telerik:GridBoundColumn ItemStyle-CssClass="td" DataField="OrderDate" HeaderText="Customer Order Date" SortExpression="OrderDate" >
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn ItemStyle-CssClass="td" DataField="CreatedOn" HeaderText="Submitted On" SortExpression="CreatedOn">
                                                                </telerik:GridBoundColumn>
                                                                <telerik:GridBoundColumn ItemStyle-CssClass="td" DataField="OrderStatus" HeaderText="Order Status" SortExpression="OrderStatus">
                                                                </telerik:GridBoundColumn>
                                                        <%--        <telerik:GridBoundColumn DataField="NoOfItems" HeaderText="Quantity" SortExpression="NoOfItems">
                                                                </telerik:GridBoundColumn>--%>

                                                                
                                                                 <telerik:GridTemplateColumn ItemStyle-CssClass="td" HeaderText="Track Package" UniqueName="TrackOrder" HeaderStyle-ForeColor="#1F476F">
                                                                          <ItemTemplate><%--onclick='Open(this.id,<%#Eval("OrderID")%>);return false;'--%>
                                                                          
                                                                             <%--   <a href="javascript:;" target="_blank" style='display:<%#Eval("ShipMethod").ToString()=="Manual" ? "none" : "block"%>;' id='anchor<%#Eval("OrderID")%>' onclick='Open(this.id,<%#Eval("OrderID")%>);return false;' >
                                                                                    Track Package</a>--%>
                                                                                   <%-- <a href="javascript:;" target="_blank" style='display:<%#Eval("ShipMethod").ToString()=="Manual" ? "block" : "none"%>;' onclick='notify();return false;'>Track Package</a>
                                                                           --%> </ItemTemplate>

                                                                <HeaderStyle ForeColor="#1F476F"></HeaderStyle>
                                                                         </telerik:GridTemplateColumn>

                                                               <%-- <telerik:GridBoundColumn DataField="BinNumbers" HeaderText="Bin Number" SortExpression="BinNumbers">
                                                                </telerik:GridBoundColumn>--%>



                                                                <telerik:GridButtonColumn ItemStyle-CssClass="td" ButtonType="LinkButton" HeaderText="Cancel Order" CommandName="CancelOrder"
                                                                    UniqueName="CancelOrderColumn" Text="Cancel Order" ConfirmDialogType="RadWindow" ConfirmText="Are you sure you want to Cancel this order?" >
                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                </telerik:GridButtonColumn>
                                                               <%-- <telerik:GridButtonColumn ButtonType="LinkButton" HeaderText="Re-Processing" CommandName="ReProcessing"
                                                                    UniqueName="ReProcessingColumn" Text="Re-Processing">
                                                                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                                                                </telerik:GridButtonColumn>--%>
                                                                <telerik:GridTemplateColumn ItemStyle-CssClass="td" HeaderText="" UniqueName="OrderStatusCol">
                                                                    <ItemTemplate>
                                                                        <asp:Label ID="lblOrderStatus" runat="server" Visible="false" ></asp:Label>
                                                                    </ItemTemplate>
                                                                </telerik:GridTemplateColumn>
                                                            </Columns>
                                                            <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
                                                                ShowExportToCsvButton="true" />
                                                        </MasterTableView>

                <PagerStyle Position="TopAndBottom"/>
             <ClientSettings>
            <ClientEvents OnCommand="RadGrid1_Command" OnRowDataBound="RadGrid1_RowDataBound">
            </ClientEvents>
        </ClientSettings>
               
            </telerik:RadGrid>
             <telerik:RadContextMenu ID="RadMenu1" runat="server"
                                                        EnableRoundedCorners="true" EnableShadows="true">
                                                        <Items>
                                                            <telerik:RadMenuItem Text="Order Detail" />                                                           
                                                            <telerik:RadMenuItem Text="Modify Quantity" />
                                                            <telerik:RadMenuItem Text="Change Target Date" />
                                                        </Items>
                                                    </telerik:RadContextMenu>
            </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </div>
   
</asp:Content>


COde File

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;
using cpPresenter;
using cpModel;
using cpView;
using Telerik.Web.UI;
using System.Text;
using System.Web.Services;

public partial class Secure_test : System.Web.UI.Page,IManageOrder
{

    static string _sourceId = "";
    Int32? _EmployeeID;
    ManageOrder _manageOrder;
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request.QueryString["sid"] != null)
        {
            _sourceId = CommonFunctions.Decrypt(Request.QueryString["sid"]).ToString();
        }
        else
            _sourceId = Session["SourceId"].ToString();

      
    }
    [WebMethod]
    public static List<GetOrdersData4CP_Result> BindGrid()
    {

        return ManageOrder.GetdataTest(null, null, "3", null, null, null, null, null, null, null, null);
       
       // return ManageOrder.GetPhysicalPrinters();
       
    }



   
    public int? EmployeeID
    {
        get { return Session["EmployeeID"] != null ? Convert.ToInt32(Session["EmployeeID"]) : 0; ; }
        set { _EmployeeID = value; }
    }

}
Jayesh Goyani
Top achievements
Rank 2
 answered on 31 Mar 2013
3 answers
142 views
Hi,

I got a RadTextBox and after user enter some value and move to the next textbox, I want to check if the value is greater than 18. And if the condition fails, display an alert and clear text.

Thanks,
Karl.
moegal
Top achievements
Rank 1
 answered on 31 Mar 2013
11 answers
189 views
Hi guys

I looked some posts in regards to Radar Chart back in July 2009 and back then Telerik has no plan to make this as apart of RadChart. Now it's 2010 so I am just wondering if this is still the case.

I am appreciated your feedback.

Thanks
Tom
Top achievements
Rank 1
 answered on 31 Mar 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?