Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
205 views
The text area populates, and combo indicates there are several items but I can't get the list to drop down.  A web service is attatched to combo by way of ObjectDataSource.

asp.net;
<telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" height="200px"
     width="95%">
     <telerik:RadComboBox ID="RadComboSearch" Runat="server" AutoPostBack="True"
         EmptyMessage="Type your search query here;" Height="98%"
         ShowDropDownOnTextboxClick="True" ShowMoreResultsBox="True"
         Text="Enter Search Criteria" Width="100%" AllowCustomText="True"
         EnableVirtualScrolling="True" MarkFirstMatch="True"
         DataSourceID="MyWebServices" DataValueField="StringResult" DataTextField="StringResult"
         EnableAutomaticLoadOnDemand="True" ItemsPerRequest="10"
         >
     </telerik:RadComboBox>
     <asp:ObjectDataSource ID="MyWebServices" runat="server" SelectMethod="SearchBoxResult"
   
         TypeName="NVSS_Manual.Lookup" >
         <SelectParameters>
             <asp:ControlParameter ControlID="RadComboSearch" Name="SearchString"
                 PropertyName="Text" Type="String" />
         </SelectParameters>
     </asp:ObjectDataSource>
 </telerik:RadAjaxPanel>

The data provider is a method on the page that calls a web service and converts the dataset to a datatable

public DataTable SearchBoxResult(string SearchString)
{
    DataTable ReturnValue = null;
    NVSS_ManualWebService.NVSS_Manual_WebService ws = new NVSS_ManualWebService.NVSS_Manual_WebService();
    DataSet ds =ws.Search_BoxResult();
    ReturnValue = ds.Tables[0];
    return ReturnValue;
}

The web service is simply plugs some values into a dataset for purpose of demonstration;

...
[WebMethod]
    public DataSet Search_BoxResult()
    {
        DataSet ds = new DataSet();
        DataTable dt = new DataTable();
        DataColumn dc=new DataColumn("StringResult", Type.GetType("System.String"));
        dt.Columns.Add(dc);
        ds.Tables.Add(dt);
 
        dt.Rows.Add("Appendicitus");
        dt.Rows.Add("aaa1");
        dt.Rows.Add("aaa3");
        dt.Rows.Add("aaa2");
        return ds;
    }
...

see also attached.

Would be grateful for any ideas.  Thank you.
John
Top achievements
Rank 1
 answered on 24 Nov 2010
2 answers
226 views
For version 2010.2.826.40. I have set a radlistbox so it will alternate every other row background with a different color.  Doing that caused the side effect that the mouse over color doesn't change as would be the case in the list box's default behavior.

protected void Load_ManualWithFoundContent(string SearchResult)
        {
            WebServiceProxy wsp = new WebServiceProxy();
            DataSet ManualsWithSearchResults = wsp.GetServicesHandle.Search_ManualTitlesResult(SearchResult);
            DataTable dt = ManualsWithSearchResults.Tables[0];
            DataRowCollection drc = dt.Rows;
 
            RadListBoxItemCollection rlbic = RadList_ManualsWithFoundContent.Items;
 
            int i = 0;
            foreach (DataRow dr in drc)
            {
                RadListBoxItem rlbi = new RadListBoxItem(dr["ManualName"].ToString(), dr["pKey"].ToString());
                rlbi.BackColor = i++ %2 ==0 ? Color.WhiteSmoke : Color.White;
                 
                rlbic.Add(rlbi);
            }
        }

My thought on this is I need to add a handler client side for mouse over?
function RadList_ManualsWithFoundContent_OnClientMouseOver(sender, evenArgs) {
  ...???set item color???...   
}
Not sure how to do this (looking through client side api).

Thanks in advance
John
Top achievements
Rank 1
 answered on 24 Nov 2010
6 answers
318 views
How do I change the cursor in the radgrid when drag with some checking?

I'm able to use document.body.style.cursor= "hand", but the row does apply.

Thanks in advance.
Dimo
Telerik team
 answered on 24 Nov 2010
5 answers
165 views
Is it possible to display text under each pictures in coverflow mode?
jc mag
Top achievements
Rank 1
 answered on 24 Nov 2010
2 answers
160 views
Hi,
I am using two tables in a data set. I need to bind these two tables in two different rad charts.
Is it possible ?
If so can you please explain the steps to achieve this ?
Antony
Top achievements
Rank 1
 answered on 24 Nov 2010
1 answer
214 views
I have requirement in web project to be able to load a word document, edit it and save it back to the server.

Will RadEditor allow me to do it?
How can an load the word document in RadEditor?
Only option I saw was to export the content of RadEditor to PDF or RTF. Is there an option to save the contents as word document?

Please let me know ASAP.
msoor 
Rumen
Telerik team
 answered on 24 Nov 2010
1 answer
87 views
I have the RadGrid with drag and drop function and context menu. When I select multiple rows and right click, the context menu shown and the "no access" cursor is also appear (change of "no access" cursor is in ongriddragstarted event).

How do I stop triggering the OnRowDragStarted when right click on the selected multiple rows? Thanks!!

aspx:
<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="Default" %>
  
<html>
<head runat="server">
    <title></title>
    <style type="text/css">
    .noAccessCursor, .noAccessCursor *
    {
        cursor:url('noaccess.cur'), default !important;
    }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager" runat="server" />
        <telerik:RadScriptBlock runat="server" ID="ScriptBlock">
  
            <script type="text/javascript">
            function gridRowContextMenu(sender, args)
            {
                // remove the cursor cause but the onrowdragstarted
                Sys.UI.DomElement.removeCssClass(document.documentElement, "noAccessCursor");
                  
                var evt = args.get_domEvent();
                if(evt.target.tagName == "INPUT" || evt.target.tagName == "A") 
                    return;
                      
                var menu = $find("<%= ContextMenu1.ClientID %>");
                  
                menu.show(evt);
  
                //evt.cancelBubble = true;
                //evt.returnValue = false;
  
                //if (evt.stopPropagation)
                //{
                //    evt.stopPropagation();
                //    evt.preventDefault();
                //} 
            }
  
            var destTaxonomyID;
            //var expandedNodes = [];
            function gridRowDropping(sender, args) 
            {
                args.set_cancel(true);
                alert("Dropped");
                  
                // reset the cursor to default
                Sys.UI.DomElement.removeCssClass(document.documentElement, "noAccessCursor");
            }
  
            function gridRowDragStarted(sender, args)
            {
                Sys.UI.DomElement.addCssClass(document.documentElement, "noAccessCursor");
            }
            </script>
  
        </telerik:RadScriptBlock>
        <telerik:RadContextMenu ID="ContextMenu1" runat="server" Skin="Vista">
            <Items>
                <telerik:RadMenuItem Text="Menu 1" />
                <telerik:RadMenuItem Text="Menu 2" />
            </Items>
            <Targets>
                <telerik:ContextMenuControlTarget ControlID="GridDocument" />
            </Targets>
        </telerik:RadContextMenu>
        <telerik:RadGrid ID="Grid1" runat="server" AutoGenerateColumns="False" Skin="Vista"
            AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="true" GridLines="None"
            Width="100%" Height="345px" BorderWidth="0px" OnRowDrop="Grid1_RowDrop">
            <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" />
            <MasterTableView DataKeyNames="ID" ClientDataKeyNames="ID" TableLayout="Fixed">
                <Columns>
                    <telerik:GridBoundColumn DataField="Title" HeaderText="Title" UniqueName="Title">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
            <ClientSettings EnableRowHoverStyle="True" AllowRowsDragDrop="true">
                <Selecting AllowRowSelect="True"></Selecting>
                <ClientEvents OnRowContextMenu="gridRowContextMenu" OnRowDropping="gridRowDropping"
                    OnRowDragStarted="gridRowDragStarted" />
                <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                <Resizing AllowColumnResize="True" EnableRealTimeResize="true" ClipCellContentOnResize="true">
                </Resizing>
            </ClientSettings>
        </telerik:RadGrid>
    </form>
</body>
</html>

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
  
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            DataTable tb = new DataTable();
            tb.Columns.Add("ID");
            tb.Columns.Add("Title");
  
            for (int i = 0; i < 10; i++)
            {
                DataRow row = tb.NewRow();
                row["ID"] = i;
                row["Title"] = "Title " + i;
                tb.Rows.Add(row);
            }
  
            Grid1.DataSource = tb;
            Grid1.DataBind();
        }
    }
  
    protected void Grid1_RowDrop(object sender, GridDragDropEventArgs e)
    {
  
    }
}
Dimo
Telerik team
 answered on 24 Nov 2010
1 answer
95 views
Hi,

How to disabled the specific row’s checkbox of radgrid control based on value /text of the grid column. It should not allowed me to check the checkbox if I click on the checkall.

Pavlina
Telerik team
 answered on 24 Nov 2010
7 answers
397 views
I have a main Grid and inside the item template of that grid i have placed 6 grids.
I have done this as i have to export to excel all the six grids data into one excel. This is working fine. The thing i am not able to figure out is how to display the total for some of the columns of my first grid.
below is my code block for the first grid.
<telerik:RadGrid ID="radGridWrapper" runat="server" Skin="Web20" ShowHeader="false" BorderStyle="None" Width="100%" 
                    onexcelmlexportstylescreated="radGridWrapper_ExcelMLExportStylesCreated" onexcelmlexportrowcreated="radGridWrapper_ExcelMLExportRowCreated" >
                <ExportSettings OpenInNewWindow="true" />
                <MasterTableView AutoGenerateColumns="true" CellSpacing="-1">
                            <ItemTemplate>
                             <h4 style="font-weight:bold;color:Black; width:100%;height:15px"   align="left" > Manpower Summary<asp:Label ID="lblmansummary" runat="server" Visible="false" ></asp:Label></h4>
                                    <telerik:RadGrid ID="grdmanpower" runat="server" 
                                    OnNeedDataSource="RadGrid_NeedDataSource" AutoGenerateColumns="False" 
                                    CellSpacing="1" GridLines="Vertical" Width="100%" AllowSorting="true" Skin="Web20" 
                                    HeaderStyle-HorizontalAlign="Center" HeaderStyle-Font-Underline="true" HeaderStyle-Wrap="false" 
                                    HeaderStyle-Font-Bold="true" HeaderStyle-Font-Names="Arial"  FooterStyle-HorizontalAlign="Right" FooterStyle-Font-Bold="true"
                                    PagerStyle-Wrap="false"  OnItemDataBound="grdmanpower_ItemDataBound"  OnColumnCreated="grdmanpower_ColumnCreated"  >
                                        <ItemStyle Font-Names="Arial"></ItemStyle>
                                        <AlternatingItemStyle Font-Names="Arial" /> 
                                       <MasterTableView AutoGenerateColumns="false" ShowFooter="true" UseAllDataFields="true">
                                        <Columns>
                                            <telerik:GridBoundColumn DataField="Project Name" HeaderText="Project Name"  ItemStyle-Wrap="false" DataFormatString="{0:f1}" UniqueName="Project Name" ></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Total Hours Booked (including OT)" HeaderText="Total Hours Booked<br/>(including OT)" DataFormatString="{0:f1}" UniqueName="Total Hours Booked (including OT)" ></telerik:GridBoundColumn>                                            
                                            <telerik:GridBoundColumn DataField="Booked Manpower (including OT,Abs and WO)" HeaderText="Booked Manpower<br/>(including OT,Abs and WO)" UniqueName="Booked Manpower (including OT,Abs and WO)" ItemStyle-Width = "14%" DataFormatString="{0:f1}" ></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Present" HeaderText="Present" ItemStyle-Width = "14%" DataFormatString="{0:f1}" UniqueName="Present" ></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Abs" HeaderText="Abs" ItemStyle-Width = "14%" DataFormatString="{0:f1}" UniqueName="Abs"></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Weekly Off" HeaderText="Weekly Off" ItemStyle-Width = "16%" DataFormatString="{0:f1}" UniqueName="Weekly Off"></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Training" HeaderText="Training" ItemStyle-Width = "14%" DataFormatString="{0:f1}" UniqueName="Training"></telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="Abs %" HeaderText="Abs %" ItemStyle-Width = "14%" DataFormatString="{0:f1}" UniqueName="Abs %"></telerik:GridBoundColumn>
                                        </Columns>
                                       </MasterTableView>
                                    </telerik:RadGrid>
                                                          
            </MasterTableView>
        </telerik:RadGrid>

In this excluding the first column i.e. project name i want to display the total for all the other columns.
I tried to use Column created event.
if (e.Column is GridBoundColumn)
            {
                if (col.UniqueName != "Project Name")
                {
                    col.Aggregate = GridAggregateFunction.Sum;
                    col.FooterText = " ";
                    col.HeaderStyle.Width = Unit.Pixel(30);
                    col.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
                }
            }
but this is not working please let me know how i can go about doing this i.e. in any other event like itemdatabound or something please let me know....
Pavlina
Telerik team
 answered on 24 Nov 2010
3 answers
275 views
I took your sample ListBoxInItemComboTemplate and modified to have the listbox populated with data from a datasource.  That works fine.  I need to add an item "ALL" and what I'm hoping to do is to check if the user selected "ALL" then turn off the other items in the listbox.  Would that be done on the client side? 
<td><telerik:RadComboBox ID="ObjectiveCombo" Runat="server" 
    DataTextField="ObjectiveName"
    DataValueField="ObjectiveID" Skin="Office2007" Width="487px" 
    OnClientDropDownClosed = "onObjectiveDDClosed" 
        >
         
        <Items><telerik:RadComboBoxItem Text="" />
         </Items>
        <ItemTemplate>
                <div id="div1">
                    <telerik:RadListBox ID="RadListBox1" runat="server" Width="100%" SelectionMode="Multiple"
                        OnClientSelectedIndexChanged="onSelectedIndexChangedObjective" 
                        DataSourceID="ObjectiveDS" DataTextField="ObjectiveName" 
                        DataValueField="ObjectiveID">
                    </telerik:RadListBox>
                </div>
                <script type="text/javascript">
                    var div1 = document.getElementById("div1");
                    div1.onclick = stopPropagation;
                </script>
            </ItemTemplate>
  
</telerik:RadComboBox>
This is what I have.  The listbox is inside an item template.

Also, I was trying to find out how many items I have selected in my listbox when the dropdown closes.  The get_value() call works but the get_count() gives an error. 
function onObjectiveDDClosed(sender, eventArgs) {
        var text = "";
        var value = "";
  
        var comboBox = $find("<%= ObjectiveCombo.ClientID %>");
        var items = comboBox.get_items().getItem(0).get_value();
        var num = comboBox.get_items().getItem(0).get_count(); 
        alert(num);
        var total = items.split(",");
        alert(total.length);
          
         
         
    }
This client-side stuff is a little new for me.  It's frustrating when you know what you want, but you struggle with a new language.
Dimitar Terziev
Telerik team
 answered on 24 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?