Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
90 views
I cannot get a RadToolTip to appear when a user sets focus on a RadEditor.
The code I am using is below:


<asp:TextBox ID="txt" runat="server" Text="try me" />
    <telerik:RadEditor ID="re1" runat="server">
    </telerik:RadEditor>
    <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="re1"
        ShowEvent="OnFocus" Text="Test">
    </telerik:RadToolTip>
<telerik:RadEditor ID="re1" runat="server">
</telerik:RadEditor>
<telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="re1"
    ShowEvent="OnFocus" Text="Test">
</telerik:RadToolTip>

How do I go about this?
Thanks
Rumen
Telerik team
 answered on 12 Oct 2010
7 answers
695 views
All,

I am having problems getting my GridDropDownColumn to bind with the current value of my Grid data row.  I can get the drop down to bind to it's source but I can't seem to get it to set the correct selected value automatically.

Here is my ASPC Code:
<%@ Page Language="C#" MasterPageFile="~/MasterPages/Popup.Master" AutoEventWireup="true" CodeBehind="CompanyItemReference.aspx.cs" Inherits="NTE.NTEx.Web.App.ItemMaster.CompanyItemReference" Title="Item Reference" %>
<asp:Content ID="Content1" ContentPlaceHolderID="cphMain" runat="server">
<center><asp:Label ID="Label1" CssClass="NormalTextBold" runat="server" ></asp:Label></center>
       <telerik:RadGrid ID="RadGrid1" Skin="Web20" runat="server" Width="100%" AutoGenerateColumns="False" HorizontalAlign="Right"
            BorderStyle="None" BorderWidth="0px" CellPadding="0" CellSpacing="0" ItemStyle-Height="10px" HeaderStyle-Height="10px"
            OnNeedDataSource="RadGrid1_NeedDataSource" 
            OnDeleteCommand="RadGrid1_DeleteCommand"
            OnInsertCommand="RadGrid1_InsertCommand"
            OnUpdateCommand="RadGrid1_UpdateCommand"
            OnItemDataBound="RadGrid1_ItemDataBound"
            PageSize="20" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True" GridLines="Horizontal" ShowStatusBar="false">
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <ClientSettings AllowExpandCollapse="True">
               <Resizing AllowColumnResize="true" ResizeGridOnColumnResize="false" AllowRowResize="true" />
            </ClientSettings
            <MasterTableView CommandItemDisplay="Top" AllowFilteringByColumn="True" DataKeyNames="item_id" AllowMultiColumnSorting="True"
                HierarchyLoadMode="ServerOnDemand" Width="100%" HierarchyDefaultExpanded="False" runat="server" 
                Name="Item">
                <DetailTables>
                    <telerik:GridTableView AllowPaging="false" CommandItemDisplay="Top" DataKeyNames="id" Width="80%" runat="server" Name="Reference">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="item_id" MasterKeyField="item_id" />
                        </ParentTableRelation>
                        <Columns>
                            <telerik:GridEditCommandColumn Resizable="false" HeaderStyle-Width="30px" ItemStyle-Width="30px" UniqueName="EditCommandColumn"></telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn ReadOnly="true" visible="false" UniqueName="id" HeaderText="Detail ID"
                                DataField="id">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn ReadOnly="true" visible="false" UniqueName="Item_ID" HeaderText="Item ID"
                                DataField="item_id">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn ReadOnly="true" visible="false" UniqueName="HoldReferenceType"
                                DataField="reference_type">
                            </telerik:GridBoundColumn>
                            <telerik:GridDropDownColumn 
                                UniqueName="DDReferenceType" SortExpression="display_name" 
                                ListTextField="display_name" EnableEmptyListItem = "true" EmptyListItemText="--Choose an option--" EmptyListItemValue=""
                                ListValueField ="Reference_Type" HeaderText="Reference Type" DataField="reference_type">
                            </telerik:GridDropDownColumn>                            
                            <telerik:GridBoundColumn ReadOnly="true" UniqueName="reference_name" HeaderText="Name"
                                DataField="reference_name">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="reference_value" HeaderText="Value"
                                DataField="reference_value">
                            </telerik:GridBoundColumn>
                                    <telerik:GridButtonColumn ConfirmText="Delete this Item?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1">
                                        <HeaderStyle Width="20px" />
                                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                                    </telerik:GridButtonColumn>
                  </Columns>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="reference_name"></telerik:GridSortExpression>
                        </SortExpressions>
                   </telerik:GridTableView>
                </DetailTables>
                <Columns>
                  <telerik:GridBoundColumn ReadOnly="true" visible="false" UniqueName="item_id" HeaderText="item_ID" 
                        DataField="item_id">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ReadOnly="true" visible="false" UniqueName="MemNo" HeaderText="Member" 
                        DataField="Mem_No">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ReadOnly="true" visible="false" UniqueName="GroupID" HeaderText="Community" 
                        DataField="Group_Id">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ReadOnly="true" visible="false" UniqueName="type" 
                        HeaderText="Type"
                        DataField="owner_reference_type">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="reference" 
                        HeaderText="Product ID" FilterControlWidth="50px"
                        HeaderStyle-Width="100px" ItemStyle-Width="100px"
                        DataField="owner_reference_value">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn UniqueName="Commodity" 
                        HeaderText="Commodity" ReadOnly="true"
                        ShowFilterIcon="false" FilterControlAltText="Enter a commodity and hit return" FilterControlWidth="20px" AutoPostBackOnFilter="true"
                        HeaderStyle-Width="30px" ItemStyle-Width="30px"
                        DataField="Commodity_code">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ReadOnly="true" UniqueName="UPC" 
                        HeaderText="UPC" Resizable="true" 
                         HeaderStyle-Width="120px" ItemStyle-Width="120px"
                       DataField="UPC">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ReadOnly="true" UniqueName="GTIN" 
                        HeaderText="GTIN"
                        HeaderStyle-Width="120px" ItemStyle-Width="120px"
                        DataField="GTIN">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ReadOnly="true" UniqueName="Branch" 
                        HeaderText="Branch" 
                        ShowFilterIcon="false" FilterControlAltText="Enter a branch and hit return" FilterControlWidth="20px" AutoPostBackOnFilter="true"
                        HeaderStyle-Width="30px" ItemStyle-Width="30px"
                        DataField="Branch">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ReadOnly="true" UniqueName="Description" 
                        HeaderText="Description" AllowFiltering="false"
                        DataField="Description">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn ConfirmText="Delete this Item?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1">
                         <HeaderStyle Width="20px" />
                         <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>
               </Columns>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="owner_reference_value"></telerik:GridSortExpression>
                        </SortExpressions>
            </MasterTableView>
        </telerik:RadGrid>
</asp:Content>

Here is my ASPX C# code:

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using NTE.NTEx.Web.Common;
using NTE.NTEx.BusinessLogic;
using Telerik.Web.UI;
using SubSonic; //Query Object
using NTE.NTEx.Data;
using NTE.NTEx.Web.Session;
using NTE.NTEx.DataAccessObjects;
using NTE.NTEx.Security;
using System.Text;
  
namespace NTE.NTEx.Web.App.ItemMaster
{
    [Page("Item References", Description = "Item References")]
    public partial class CompanyItemReference : BasePage
    {
        private void Page_Load(object sender, System.EventArgs e)
        {
           if (!Page.IsPostBack)//first time hit page
            {
                SetData("MemNo", Request.QueryString["MemNo"]);
                SetData("GroupID", Request.QueryString["GroupID"]);
                SetData("ReadOnly", Request.QueryString["ReadOnly"]);
                if (string.IsNullOrEmpty(Data["WHERE"]) == true
                {
                    SetWhereClause();
                }
            }
        }
        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            LoadData();
        }
  
        private void SetWhereClause()
        {
            StringBuilder strSQL = new StringBuilder();
            DbParams parameters = new DbParams();
  
            strSQL.Append(" Select get_mem_group_filter (:1, :2, 'mem_no','group_id') where_clause from ntex_session" );
            parameters.Add("1", Data["MemNo"]);
            parameters.Add("2", Data["GroupId"]);
  
            DataSet ds = DataHelper.FetchData(strSQL.ToString(), parameters);
            SetData("WHERE", (string) ds.Tables[0].Rows[0]["where_clause"]);
        }
  
        private void LoadData()
        {
            StringBuilder strSQL = new StringBuilder();
            //Category Query
            DbParams parameters = new DbParams();
  
            strSQL.Append(" select * from company_item2");
            strSQL.Append(" where mem_no = :1 ");
            strSQL.Append(Data["Where"]);
            parameters.Add("1", Data["MemNo"]);
            DataSet ds = DataHelper.FetchData(strSQL.ToString(), parameters);
  
            RadGrid1.AutoGenerateColumns = false;
            RadGrid1.DataSource = ds.Tables[0];
            RadGrid1.MasterTableView.DataSource = ds.Tables[0];
              
            strSQL.Remove(0, strSQL.Length);
            parameters.Clear();
  
            strSQL.Append(" select * from company_item");
            strSQL.Append(" where mem_no = :1 ");
            strSQL.Append(Data["Where"]);
            parameters.Add("1", Data["MemNo"]);
  
            ds = DataHelper.FetchData(strSQL.ToString(), parameters);
  
            RadGrid1.AutoGenerateColumns = false;
            RadGrid1.MasterTableView.DetailTables[0].DataSource = ds.Tables[0];
        }
        protected void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            string tableName = e.Item.OwnerTableView.Name.ToString();
            if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode && tableName=="Reference")
            {
                GridEditableItem editedItem = e.Item as GridEditableItem;
                GridEditManager editMan = editedItem.EditManager;
                StringBuilder strSQL = new StringBuilder();
  
                strSQL.Append(" select a.reference_type, a.display_name from reference_master_type a where reference_master_id = to_number(getcontextattribute('"+Data["MemNo"]+"',"+Data["GroupId"]+",'REFMSTRID'))");
                DataSet ds = DataHelper.FetchData(strSQL.ToString());
                //
                GridDropDownListColumnEditor editor = editMan.GetColumnEditor("DDReferenceType") as GridDropDownListColumnEditor;
                //in case you have RadComboBox editor for the GridDropDownColumn (this is the default editor),         
                //you will need to use ComboBoxControl below instead of DropDownListControl
                //Then you can modify the list control as per your custom conventions
                editor.DataSource = ds.Tables[0];
                editor.DataBind();
                //editor.Visible = true;
                //editor.ComboBoxControl.SelectedValue = e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id"].ToString();
                //And so on
            }
        }
        protected void RadGrid1_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            //Get the GridEditableItem of the RadGrid  
            string tableName = e.Item.OwnerTableView.Name.ToString();
            GridEditableItem editedItem = e.Item as GridEditableItem;
            //try
            //{
                switch (tableName)
                {
                    case "Item":
                        {
                            string str_Reference = (editedItem["reference"].Controls[0] as TextBox).Text;
                            ItemCollection colIC = new ItemCollection();
                            Query qry = new Query(Item.Schema);
                            qry.AddWhere("owner_reference", str_Reference);
                            colIC.LoadAndCloseReader (qry.ExecuteReader());
                            if (colIC.Count == 1)
                            {
                                ItemCorporationUsageCollection colICU = new ItemCorporationUsageCollection();
                                qry = new Query(ItemCorporationUsage.Schema);
                                qry.AddWhere("item_id", colIC[0].Id).AND("related_corporation_id", int.Parse(Data["MemNo"]));
                                colICU.LoadAndCloseReader (qry.ExecuteReader());
  
                                if (colICU.Count == 0)
                                {
                                    DataAccessObjects.ItemCorporationUsage oICU;
                                    oICU = new ItemCorporationUsage();
                                    oICU.RelatedCorporationId = int.Parse(Data["MemNo"]);
                                    oICU.ItemId = colIC[0].Id;
                                    oICU.Save();
                                }
                            }
                            LoadData();
                            DisplayMessage("Add Successfull.");
                            break;
                        }
                    case "Reference":
                        {
                            int itemid = int.Parse(editedItem.OwnerTableView.ParentItem.OwnerTableView.DataKeyValues[editedItem.OwnerTableView.ParentItem.ItemIndex]["item_id"].ToString());
                            DropDownList list = editedItem.FindControl("DDReferenceType") as DropDownList;
                            Response.Write(list.Items.Count +"<BR>");
                            Response.Write(editedItem["DDReferenceType"].Controls[0].ToString());
                            DataAccessObjects.ItemCorporationReference oICR;
                            oICR = new ItemCorporationReference();
                            oICR.RelatedCorporationId = int.Parse(Data["MemNo"]);
                            oICR.ItemId = itemid;
                            //oICR.ReferenceType = (editedItem.FindControl("DDReferenceType") as DropDownList).SelectedItem.Value;
                            oICR.Reference = (editedItem["reference_value"].Controls[0] as TextBox).Text;
                            //oICR.Save();
                            //LoadData();
                            DisplayMessage("Insert Successfull.");
                            break;
                        }
                }
            //}
            //catch
            //{
            //    Response.Write("Error: Parameter could not be saved.");
            //}
        }
        protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.EditCommandName)
            {
                Response.Write("Primary key for the clicked item from ItemCommand: " + e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["item_id"] + "<br>");
                Response.Write("Item Index for the clicked item from ItemCommand: " + e.Item.ItemIndex + "<br>");
                DisplayMessage("Table Name clicked item from ItemCommand: " + e.Item.OwnerTableView.Name.ToString() + "<br>");
            }
        }
        protected void RadGrid1_DeleteCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            //Get the GridEditableItem of the RadGrid  
            GridEditableItem editedItem = e.Item as GridEditableItem;
            string tableName = e.Item.OwnerTableView.Name.ToString();
            try
            {
                switch (tableName)
                {
                    case "Item":
                        {
                            int ItemID = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["item_id"].ToString());
                            Query qry = new Query(ItemCorporationReference.Schema);
                            qry.QueryType = QueryType.Delete;
                            qry.AddWhere("item_id", ItemID).AND("related_corporation_id", int.Parse(Data["MemNo"]));
                            qry.Execute();
  
                            qry = new Query(ItemCorporationUsage.Schema);
                            qry.QueryType = QueryType.Delete;
                            qry.AddWhere("item_id", ItemID).AND("related_corporation_id", int.Parse(Data["MemNo"]));
                            qry.Execute();
  
                            LoadData();
                            DisplayMessage("Delete Successfull.");
                            break;
                        }
                    case "Reference":
                        {
                            int DeleteID = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id"].ToString());
                            DataAccessObjects.ItemCorporationReference.Delete(DeleteID);
                            DisplayMessage("Delete Successfull.");
                            break;
                        }
                }
            }
            catch
            {
                DisplayMessage("Error: Parameter could not be saved.");
            }
        }
        protected void RadGrid1_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {
            //Get the GridEditableItem of the RadGrid  
            GridEditableItem editedItem = e.Item as GridEditableItem;
            string tableName = e.Item.OwnerTableView.Name.ToString();
            try
            {
                switch (tableName)
                {
                    case "Item":
                        {
                            break;
                        }
                    case "Reference":
                        {
                            int UpdateID = int.Parse(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["id"].ToString());
                            DataAccessObjects.ItemCorporationReference oICR;
                            oICR = new ItemCorporationReference(UpdateID);
                            oICR.ReferenceType = (editedItem["DDReferenceType"].Controls[0] as DropDownList).SelectedItem.Value;
                            oICR.Reference = (editedItem["reference_value"].Controls[0] as TextBox).Text;
                            oICR.Save();
                            DisplayMessage("Delete Successfull.");
                            break;
                        }
                }
            }
            catch
            {
                DisplayMessage("Error: Parameter could not be saved.");
            }
        }
        private void DisplayMessage(string text)
        {
            RadGrid1.Controls.Add(new LiteralControl(string.Format("<span style='color:red'>{0}</span>", text)));
        }
    }
}
Marin
Telerik team
 answered on 12 Oct 2010
3 answers
130 views
I'm new to using WCF and LINQ. I'm attempting to shoehorn the example from this link:

http://demos.telerik.com/aspnet-ajax/combobox/examples/loadondemand/wcf/defaultcs.aspx

into an application Im putting together as a learning excercise.

Ive verified ( using a packet sniffer, and decoding the HTTP traffic) that the results from the services calls are being sent from the server to the client, however the results do not appear in the combobox.

The svc file looks like:

using

 

 

System;

 

 

using

 

 

System.Collections.Generic;

 

 

using

 

 

System.Data.Linq;

 

 

using

 

 

System.Linq;

 

 

using

 

 

System.Runtime.Serialization;

 

 

using

 

 

System.ServiceModel;

 

 

using

 

 

System.ServiceModel.Activation;

 

 

using

 

 

System.ServiceModel.Web;

 

 

using

 

 

System.Text;

 

 

using

 

 

System.Web.Services;

 

 

using

 

 

Telerik.Web.UI;

 

 

namespace

 

 

QUARK.webservices

 

{

[

 

 

ServiceContract(Namespace = "")]

 

[

 

 

AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]

 

 

 

 

public class strange

 

 

{

[

 

OperationContract]

 

 

 

 

public RadComboBoxData LoadDataTemplates(RadComboBoxContext context)

 

{

 

 

 

RadComboBoxData result = new RadComboBoxData();

 

 

 

 

quarkDataContext quarkdb = new quarkDataContext();

 

 

 

 

var allTemplates = from DEVICE_TYPE in quarkdb.DEVICE_TYPEs

 

 

 

 

orderby DEVICE_TYPE.DESC

 

 

 

 

select new RadComboBoxItemData

 

 

{

Text = DEVICE_TYPE.DESC

};

 

 

string text = context.Text;

 

 

 

 

if (!String.IsNullOrEmpty(text))

 

{

allTemplates = allTemplates.Where(item => item.Text.StartsWith(text));

}

 

 

 

int numberOfItems = context.NumberOfItems;

 

 

 

 

var templates2 = allTemplates.Skip(numberOfItems).Take(10);

 

result.Items = templates2.ToArray();

 

 

 

int endOffset = numberOfItems + templates2.Count();

 

 

 

 

int totalCount = allTemplates.Count();

 

 

 

 

if (endOffset == totalCount)

 

result.EndOfItems =

 

 

true;

 

result.Message =

 

 

String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>",

 

endOffset, totalCount);

 

 

 

return result;

 

}

}

}

 



and my combobox in the aspx looks like:

<

 

 

telerik:RadComboBox ID="drp_hosttemplate" Runat="server"

 

 

 

 

Skin="Web20" Width="177px" EnableLoadOnDemand="True"

 

 

 

 

EnableVirtualScrolling="True" ShowMoreResultsBox="True"

 

 

 

 

EnableItemCaching="True" >

 

 

 

 

<WebServiceSettings Method="LoadDataTemplates" Path="webservices/strange.svc" />

 

 

 

 

<ExpandAnimation Type="InOutElastic" />

 

 

 

 

<CollapseAnimation Type="InOutElastic" />

 

 

 

 

</telerik:RadComboBox>

 

 



Simon
Telerik team
 answered on 12 Oct 2010
1 answer
72 views
Hi

When pasting the same word content from different clients, then result is not the same.
Ex the span tags is not removed etc..

The Clients is
Windows XP, IE8, MS Word is not installed (copy past via Terminal Client). Fails.
Windows 7, IE8, MS Word 2007. Ok result

What can be the reason ?, and is there a way to unify this process.

Please contact me if you need futher information,

/Erik K




Rumen
Telerik team
 answered on 12 Oct 2010
12 answers
249 views

I’m using a web service to feed the search as you type combo box on my page.  If the search returns 0 results I get the following error:

 

Microsoft Jscript runtime error: ‘Items’ is null or not an object

 

It works fine if results are returned.  Below is the code for the RadComboBox and below that is the web service method I’m using.  Any assistance would be greatly appreciated.

 

Experienced this problem with both 2010 Q1 and now Q2 Beta.

 

RadComboBox Snippet:

<telerik:RadComboBox ID="rcmbClients" runat="server" EnableLoadOnDemand="true"
    ShowMoreResultsBox="true" EnableVirtualScrolling="true"
    TabIndex="1" EnableItemCaching="true" EnableViewState="false" EmptyMessage="-- enter text --"
    NoWrap="true" ShowWhileLoading="false"
    OnSelectedIndexChanged="rcmbClients_SelectedIndexChanged"
    AutoPostBack="true" Width="500" WebServiceSettings-Method="GetFilteredClients"
    Filter="Contains" ItemRequestTimeout="300" WebServiceSettings-Path="~/RadService.svc"
    AllowCustomText="true">
</telerik:RadComboBox>  

 

Web Service Snippet:

[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class RadService
{
  [OperationContract]
  public RadComboBoxData GetFilteredClients(RadComboBoxContext context)
  {
      try
      {
             
         RadComboBoxData result = new RadComboBoxData();
         ClientBL clientBL = new ClientBL();
         IList<ShortClient> clients = clientBL.GetFilteredShortClients(context.Text.Replace("%""[%]").Replace("&squote""[']"));
         IEnumerable<RadComboBoxItemData> allDataItems = from client in clients
                                                         select new RadComboBoxItemData()
                                                         {
                                                             Text = client.DisplayName,
                                                             Value = client.ID.ToString()
                                                         };
         int numberOfItems = context.NumberOfItems;
         IEnumerable<RadComboBoxItemData> pageOfDataItems = allDataItems.Skip(numberOfItems).Take(500);
         result.Items = pageOfDataItems.ToArray();
         int endOffSet = numberOfItems + pageOfDataItems.Count();
         int totalCount = allDataItems.Count();
         if (endOffSet == totalCount)
             result.EndOfItems = false;
         result.Message = String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffSet, totalCount);
         return result;
     }
     catch (Exception ex)
     {
         string target = context.Text;
         LogManager logManager = new LogManager();
         logManager.Log(TraceEventType.Error, "Search Criteria Submitted By User: \"" + context.Text + "\""  + Environment.NewLine + ex.Message.ToString());
         throw;
     }
}
Simon
Telerik team
 answered on 12 Oct 2010
1 answer
80 views
Hello,

I have a problem with setting the z-index property for the radwindow control
I have a flash vedio (downloaded from http://www.aspnetflashvideo.com/ ) in the master page, and the child page has a radwindow control. By displaying the radwindow, its titlebar and boder will be displayed under the flash vedio (view attached image).

My code:
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
<script type="text/javascript">
           
         function open_win() {
             window.open("Pages/FullSMap.aspx?smapp=MainImage", "_blank", "toolbar=no, location=no, titlebar=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, copyhistory=no, width=100%, height=100%");
         }
</script>
  
</asp:Content>
  
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
<asp:Panel ID="CnsrtsPanel" style="margin-left:10px; margin-right:10px;" runat="server">
        <br />
        <telerik:RadWindowManager VisibleOnPageLoad="false" ID="RadWindowManager2" runat="server">
            <Windows>
                <telerik:RadWindow runat="server" VisibleTitlebar="true" DestroyOnClose="true" VisibleStatusbar="false" Behaviors="Close,Maximize,Minimize,Pin,Reload" Width="480px" Height="230px" style="z-index:80000;"
                        ID="RadWindow1"  NavigateUrl="Audio.aspx" >
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
        <script type="text/javascript">
            function UseRadWindow() {
                var oWnd = $find("<%= RadWindow1.ClientID %>");
                oWnd.show();
                oWnd.setUrl("Audio.aspx");
                oWnd.maximize();
            }
            </script>
        <asp:Label ID="HeaderLabel" SkinID="HeaderText" runat="server" Text="<%$ Resources:Resource, PagesConcertsHeaderLabel %>"></asp:Label>
        <br />
                <telerik:RadGrid ID="ConcertsRadGrid" runat="server" Skin="WebBlue" AllowFilteringByColumn="false"
                    GridLines="None" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False"
                    ShowStatusBar="true"  OnPreRender="ConcertsRadGrid_PreRender" 
                    OnNeedDataSource="ConcertsRadGrid_NeedDataSource" 
                    onitemcommand="ConcertsRadGrid_ItemCommand1" >
                    <MasterTableView GridLines="None" Width="100%" Dir="RTL" CommandItemDisplay="None" DataKeyNames="CnsrtID">
                        <Columns>
                            <telerik:GridBoundColumn UniqueName="CType" HeaderText="<%$ Resources:Resource, PagesConcertsRadGridCTypeColumn %>" DataField="CType">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="CnsrtName" HeaderText="<%$ Resources:Resource, PagesConcertsRadGridCnsrtNameColumn %>" DataField="CnsrtName">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn UniqueName="Choirs" HeaderText="<%$ Resources:Resource, PagesConcertsRadGridChoirsColumn %>" DataField="Choirs">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn UniqueName="AudioColumn" HeaderText="Audio" >
                               <ItemTemplate>
                                   <asp:LinkButton ID="AudioLinkButton" runat="server" OnClientClick="UseRadWindow();return false;" Text="Audio"></asp:LinkButton>
                               </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
           
    </asp:Panel>
</asp:Content>

The flash vedio:
<ASPNetFlashVideo:FlashVideo ID="FlashVideo1" VideoURL="~/Common/Cnsrts/Clps/Kuwait1_5.flv" Width="302px" Height="210px" style="z-index:1;" AutoPlay="false" runat="server">
                         </ASPNetFlashVideo:FlashVideo>

I'm using "RadControls for ASP.NET AJAX Q3 2009".

Please, I need your help to fix the probelm,
It is apprecited to send me the modified code.

Regards,
Bader
Svetlina Anati
Telerik team
 answered on 12 Oct 2010
1 answer
156 views
Consider the following JavaScript code

    var radToolTip = $find(toolTipClientId);
   radToolTip.set_targetControlID("");     // Fix provided by Telerik b/c target control id is list in update panel
   radToolTip.set_targetControlID(sender.id);
   if (getMousePosition() > (getWindowHeight() / 2)) { radToolTip.set_position(Telerik.Web.UI.ToolTipPosition.TopRight); }
   else { radToolTip.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight); }
   radToolTip.show();

I recently made a change where I calculate the mouse position and the window position to say (semantically), if the user has clicked on a link on the bottom of the window, set the position of the tooltip to the upper right else set the position to the lower right. It appears to work at first glance, with the tooltip popping up correctly. However, after a couple of clicks, it appears as though the tooltip is losing it's target control ID. For example, the tooltip will pop up in the right direction, just on the existing control ID (link). If I take out the position code it works fine but always has the tooltip on the bottom which causes users to scroll. I've really been scratching my head on this so any help is appreciated.
Svetlina Anati
Telerik team
 answered on 12 Oct 2010
1 answer
190 views

Here is the scenario

I have a RadGrid which contains a GridButtonColumn(I have highlighed in the code below). When the user clicks
then I take them to a separate page for editing. I know I can track this in the ItemCommand Event. But What I
am trying to accomplish is if possible get the cotrol id in the Page_Load so that I can skip all the other page
events and take redirect the user to the edit page.Currenly I am not able to do this since I can't get the
control id which cuased the postback (i this case it was the GridButtoncolumn) So my question is How to get
the Id/Control which caused the postback which is inside the RadGrid. Appreciate your reponse

Here is the code
    

<telerik:RadGrid 
    ID="rdgAccountView" 
    runat="server" 
    AllowPaging="True" 
    AllowSorting="True" 
    AutoGenerateColumns="False"
    OnNeedDataSource="rdgAccountView_OnNeedDataSource"
    OnItemCreated="rdgAccountView_ItemCreated"
    OnItemCommand="rdgAccountView_ItemCommand"
    OnPreRender="rdgAccountView_PreRender" 
    OnLoad="rdgAccountView_OnLoad" 
     OnItemDataBound="rdgAccountView_ItemDataBound"                       
    >
    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="320"/>
        <Selecting AllowRowSelect="False" />
        <Resizing AllowColumnResize="true" ClipCellContentOnResize="true" />
    </ClientSettings>
    <ExportSettings>
        <Pdf FontType="Subset" PaperSize="Letter" />
        <Excel Format="Html" />
    </ExportSettings>
    <MasterTableView 
        Width="100%" 
        NoDetailRecordsText="No Account Records Found"
        CurrentResetPageIndexAction="SetPageIndexToFirst" 
        Dir="LTR" 
        Frame="Border" 
        TableLayout="Auto"
        DataKeyNames="ParentIdentifier">
       
        <RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
            Visible="False">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <Columns>
            <telerik:GridButtonColumn ButtonType="ImageButton" ImageUrl="../../App_Themes/Default/DataEditingImages/Edit.gif"
                CommandName="EditAccountView" Text="Edit" UniqueName="EditFromAccountView">
                <HeaderStyle Width="20px" />
            </telerik:GridButtonColumn>
            <telerik:GridBoundColumn DataField="FirstName" Groupable="False" HeaderText="First Name" 
                UniqueName="Full Name" ReadOnly="True" ItemStyle-HorizontalAlign="left" HeaderStyle-Width="124px" 
                HeaderStyle-Wrap="true" AutoPostBackOnFilter="true">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="LastName" Groupable="False" HeaderText="Last Name" 
                UniqueName="Full Name" ReadOnly="True" ItemStyle-HorizontalAlign="left" HeaderStyle-Width="124px" 
                HeaderStyle-Wrap="true" AutoPostBackOnFilter="true">
            </telerik:GridBoundColumn>                               
        </Columns>
          
        <EditFormSettings>
            <EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">
            </EditColumn>
            <PopUpSettings ScrollBars="None"></PopUpSettings>
        </EditFormSettings>
    </MasterTableView>
    <ClientSettings AllowColumnsReorder="True">
    </ClientSettings>
</telerik:RadGrid>
Shinu
Top achievements
Rank 2
 answered on 12 Oct 2010
0 answers
103 views
using item databound  remove the series in first column(ex:- select count(name) as name from tablename) as value comes as a first series
Divya
Top achievements
Rank 1
 asked on 12 Oct 2010
1 answer
87 views
I have a MasterPage with a textbox I want to update with a message whenever something goes wrong.

The idea would be to have some method like

public void SetMessage(string message)
{
     alert.InnerText = message;
     UpdatePanel(AlertPanel);
}

in the MasterPage, and call it whenever I want to update my message from anywhere. What would be the simplest way to achieve this with RadAjaxPanel controls?

(I'm new at Rad controls, so other controls are fine as long as they achieve what I want)

thanks!
Shinu
Top achievements
Rank 2
 answered on 12 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
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
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?