Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
81 views
I maintain a web page with a 2 tier grid
the second tier contains a column that needs a filter on
I would appreciate any suggestion on how to implement this functionality
a drop-down on the top, but what to do on the selected index changed event handler

thanks
Eyup
Telerik team
 answered on 22 Oct 2012
3 answers
406 views
I'm creating a dynamic tooltip control that will reference javascript when moused over that is located in the master page, which uses the tool tip manager in the master page to call ajax from the master page's code behind.  I think that's all working fine.  It's a combination of examples that you've provided.  It will load nicely, but then the tooltip will go blank and a javascript error is produced.

It's an "Argument Out of Range" exception triggered by Sys$UI$Bounds when fetching the ToolTipBounds.  The 'x' value is NaN when an integer is expected.  The element in question is the control which is placed in a RadDock.  The tool tip does appear just below the div element and centered.  I'm unsure why it wouldn't have an x value.  I've tried to provide as much information as I can.

Thanks for your assistance, opinions, etc.

EDIT:  Version 2012.2.912.40

Error Stack

Uncaught Sys.ArgumentOutOfRangeException: Sys.ArgumentOutOfRangeException: Value must be an integer.
Parameter name: x
Actual value was NaN. ScriptResource.axd:237
Error$create ScriptResource.axd:237
Error$argumentOutOfRange ScriptResource.axd:302
Function$_validateParameterType ScriptResource.axd:217
Function$_validateParameter ScriptResource.axd:130
Function$_validateParams ScriptResource.axd:84
Sys$UI$Bounds ScriptResource.axd:3924
window.$telerik.window.TelerikCommonScripts.Telerik.Web.CommonScripts.getBounds ScriptResource.axd:247
$T.RadToolTip._getBoundsRelativeToElement ScriptResource.axd:429
$T.RadToolTip.getToolTipBounds ScriptResource.axd:482
$T.RadToolTip._reSetToolTipPosition ScriptResource.axd:646
$T.RadToolTip._reSetPositionWithoutFlicker ScriptResource.axd:651
(anonymous function) ScriptResource.axd:150
(anonymous function) ScriptResource.axd:47
(anonymous function) ScriptResource.axd:3484
Sys$WebForms$PageRequestManager$_endPostBack ScriptResource.axd:865
Sys$WebForms$PageRequestManager$_scriptsLoadComplete ScriptResource.axd:1729
(anonymous function) ScriptResource.axd:31
(anonymous function) ScriptResource.axd:47
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:342
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:335
Sys$_ScriptLoader$_nextSession ScriptResource.axd:357
Sys$_ScriptLoader$_loadScriptsInternal ScriptResource.axd:344
Sys$_ScriptLoader$_nextSession ScriptResource.axd:357
Sys$_ScriptLoader$loadScripts ScriptResource.axd:262
Sys$WebForms$PageRequestManager$_onFormSubmitCompleted ScriptResource.axd:1344
(anonymous function) ScriptResource.axd:47
(anonymous function) ScriptResource.axd:3484
Sys$Net$WebRequest$completed ScriptResource.axd:6364
Sys$Net$XMLHttpExecutor._onReadyStateChange ScriptResource.axd:5984


Javascript on MasterPage

function showToolTip(element) {
    var tooltipManager = $find("<%= toolTipManagerMain.ClientID %>");
 
    //If the user hovers the image before the page has loaded, there is no manager created
    if (!tooltipManager) return;
 
    //Find the tooltip for this element if it has been created
    var tooltip = tooltipManager.getToolTipByElement(element);
 
    //Create a tooltip if no tooltip exists for such element
    if (!tooltip) {
        tooltip = tooltipManager.createToolTip(element);
 
        var message = element.getAttribute("alt", 2);
        tooltip.set_value(message);
        tooltip.set_animationDuration(0);
    }
}

RadToolTipManager declaration on MasterPage

<telerik:RadToolTipManager ID="toolTipManagerMain" runat="server" HideEvent="ManualClose"
    Animation="Fade" OnAjaxUpdate="OnAjaxUpdate" RelativeTo="Element"
    Width="180px" Height="150px" Style="font-size: 18px; text-align: center; font-family: Arial;"
    RenderInPageRoot="True"
     >

OnAjaxUpdate in MasterPage's code behind

protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
{
    Control ctrl = Page.LoadControl("~/Controls/ToolTip/ToolTipSummary.ascx");
    args.UpdatePanel.ContentTemplateContainer.Controls.Add(ctrl);
    ToolTipSummary details = (ToolTipSummary)ctrl;
    details.Data = args.Value;
}

Tool Tip Control markup

<div id="testId" class="toolTipGuide" alt="<%# ToolTipMessage %>" runat="server" onmouseover="showToolTip(this);">?</div>

Tool Tip Control code behind

private string _tookTipMessage = "";
public string ToolTipMessage
{
    get { return _tookTipMessage; }
    set { _tookTipMessage = value; }
}
 
protected void Page_Load(object sender, EventArgs e)
{
}
Marin Bratanov
Telerik team
 answered on 22 Oct 2012
2 answers
51 views
I render about 60 images on a page as:

string _html = String.Emtpy;

_html += "<img javascript:void() style=\"z-index: 100; position: absolute; left: " + _releaseLeft + "px; top: " + _imageTop.ToString(CultureInfo.InvariantCulture) + "px;\" src=\"/Images/Orange.png\" /><div style=\"z-index: 101; position: absolute; color: white; top: " + _versionTextTop + "px; left: " + _textLeft + "px; float: right\" id=\"buttonText\">" + pVersionNumber + "</div>" + "\r\n";

PageHTML.Text = _html;

The above code is a switch that adds 4 different images but each image has unique values associated with it.

How can I bind a tooltip in such a way that each image when it is hovered over displays the tooltip properly?

I need to display rich text like:

<strong>Firmware: </strong> yadda
<strong>Release Date: </strong> some date
<strong>More Info: </strong> embedded URL.
....
....
and so on...


Marin Bratanov
Telerik team
 answered on 22 Oct 2012
2 answers
65 views

Hi,

I have used two text box see my screen shot,
I have typed Main Work Name for Ex: Test,
I want to Generate Main Code in alphametics(EX: A, B, C, D, ......)

Thanks
Ansari
Tamim
Top achievements
Rank 1
 answered on 22 Oct 2012
1 answer
80 views

I have  Radgrid with  6 columns

One of the column say 4th_col can have multiple rows within itself.
Basically the parent row id will be the key for retrieving the rows for 4th column.

I am doing inline editing on complet parent rows which means the 4ht column rows are also open.Now on top of that I should be able to add rows in the 4th column.

I hope I am clear

Do you have any sugesstions/ approaches?

Thanks

Marin
Telerik team
 answered on 22 Oct 2012
4 answers
88 views
I'm pretty sure I'm just doing something incorrectly, but here we go.

I'm trying to get a self-referencing hierarchy grid where the first grid and it's hierarchy is linked by ID and DirectParent and its second hierarchy is linked by ChildID and DirectParent so you'd have:
Ben
Ralph
Ralph's Age
Ralph's Eye Color
Betty
Ruth
Ruth's Height
Ruth's Shoe Size
David
David's Age
Sam
Beth
Beth's Blood Type

If the lines in the ASPX below are uncommented then the structure is there, but on the second level, it's like the entire data source just comes out on that line. If you leave in the commenting lines in then you can see what I want, but only for the first and second levels, but not the third. What am I doing wrong here? I also have this "MyRadGrid.MasterTableView.FilterExpression = "DirectParent IS NULL";" in the page load method. I've tried setting a filter on the detail tables, but nothing. Any suggestions are appreciated.

I'm working with a DataTable with Data that resembles this form:
Columns: ID, ChildID, Name, Value, DirectParent
myData.Rows.Add(0, 0, "Ben", "has no kids", DBNull.Value);
 
myData.Rows.Add(1, 0, "Ralph", "has no kids", DBNull.Value);
myData.Rows.Add(2, 0, "Betty", "is a mother", DBNull.Value);
myData.Rows.Add(3, 0, "David", "is a father", DBNull.Value);
 
myData.Rows.Add(0, 0, "Ralph's Age", "33", 1);
myData.Rows.Add(0, 0, "Ralph's Eye Color", "Red", 1);
myData.Rows.Add(0, 0, "David's Age", "77", 3);
 
myData.Rows.Add(0, 4, "Sam", "is David's son", 3);
myData.Rows.Add(0, 5, "Beth", "is David's daughter", 3);
myData.Rows.Add(0, 6, "Ruth", "is Betty's daughter", 2);
 
myData.Rows.Add(0, 0, "Beth's Blood Type", "O+", 5);
myData.Rows.Add(0, 0, "Ruth's Height", "82 inches", 6);
myData.Rows.Add(0, 0, "Ruth's Shoe Size", "10", 6);


And my ASPX is as follows

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <%-- Old, but working
            <rad:RadGrid runat="server" ID="MyRadGrid" OnNeedDataSource="MyRadGrid_NeedDataSource" MasterTableView-HierarchyLoadMode="Client" OnPreRender="MyRadGrid_PreRender">
                <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" DataKeyNames="TheParent, GUID" FilterExpression="TheParent = 0" ShowHeadersWhenNoRecords="false">
                    <SelfHierarchySettings ParentKeyName="TheParent" KeyName="GUID" MaximumDepth="3" />
                </MasterTableView>
                <ClientSettings AllowExpandCollapse="true"></ClientSettings>
            </rad:RadGrid>
            --%>
            <rad:RadGrid runat="server" ID="MyRadGrid" OnNeedDataSource="MyRadGrid_NeedDataSource" MasterTableView-HierarchyLoadMode="Client" OnPreRender="MyRadGrid_PreRender">
                <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" DataKeyNames="DirectParent, ID" ShowHeadersWhenNoRecords="false">
                    <SelfHierarchySettings ParentKeyName="DirectParent" KeyName="ID" MaximumDepth="3" />
                    <%--
                    <DetailTables>
                        <rad:GridTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" DataKeyNames="DirectParent, ChildID" ShowHeadersWhenNoRecords="false">
                            <SelfHierarchySettings ParentKeyName="DirectParent" KeyName="ChildID" MaximumDepth="1" />
                        </rad:GridTableView>
                    </DetailTables>
                    --%>   
                </MasterTableView>
                <ClientSettings AllowExpandCollapse="true"></ClientSettings>
            </rad:RadGrid>
        </div>
    </form>
</body>
</html>

Also, please excuse the structure of this DataTable. It isn't representative of any crazy database where IDs aren't unique.
Andrey
Telerik team
 answered on 22 Oct 2012
1 answer
221 views
I am attempting to load values in a RadComboBox inside a RadGrid and I am getting the following error -

"Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control"

Here is the markup for the grid

<telerik:RadGrid runat="server" ID="rgrdClaimantStatus" 
    AutoGenerateColumns="False" 
    Skin="Windows7"  OnInt="InitializeGrid"
    Style="margin-top: 0px"
    OnNeedDataSource="rgrdClaimantStatus_NeedDataSource" 
    OnUpdateCommand="rgrdClaimantStatus_UpdateCommand"
    OnInsertCommand="rgrdClaimantStatus_InsertCommand" 
    OnDeleteCommand="rgrdClaimantStatus_DeleteCommand"
    OnItemCommand="rgrdClaimantStatus_ItemCommand"
    OnItemDataBound="rgrdClaimantStatus_ItemDataBound"   
    OnPreRender="rgrdClaimantStatus_PreRender" 
    OnItemCreated="rgrdClaimantStatus_ItemCreated"
    TabIndex="21"              
    >
    <MasterTableView commanditemdisplay="Top" EditMode="InPlace" ShowHeadersWhenNoRecords="True"
        <Columns>
            <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" ImageUrl="~/PPSPortal/images/Cancel.gif" UniqueName="DeleteColumn" ShowInEditForm="True" />
            <telerik:GridTemplateColumn UniqueName="StatusDesc" DataField="StatusDesc" HeaderText="Status" FooterStyle-Font-Bold="true" FooterStyle-Wrap="false" ItemStyle-Wrap="false">
                <ItemTemplate>                                       
                    <telerik:RadComboBox runat="server" ID="rcbClaimantStatusCode" Width="100"  Text='<%# Bind("StatusDesc")  %>'  />
                </ItemTemplate>                
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="DateFrom" DataField="DateFrom" HeaderText="Date From" FooterStyle-Font-Bold="true" FooterStyle-Wrap="false" ItemStyle-Wrap="false">
                <ItemTemplate>                                       
                    <telerik:RadDatePicker runat="server" ID="rdpClaimantStatusStartDate" width="150" DbSelectedDate='<%# Bind("DateFrom") %>'>
                        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
                        <DateInput DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" TabIndex="2" />
                        <DatePopupButton ImageUrl="" HoverImageUrl="" TabIndex="2"></DatePopupButton>
                    </telerik:RadDatePicker
                </ItemTemplate>                
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="DateTo" DataField="DateTo" HeaderText="Date To" FooterStyle-Font-Bold="true" FooterStyle-Wrap="false" ItemStyle-Wrap="false">
                <ItemTemplate>                                       
                    <telerik:RadDatePicker runat="server" ID="rdpClaimantEndDate" width="150" onkeydown="ClaimantStatusEndDateKeyDown(this, event)" DbSelectedDate='<%# Bind("DateTo")  %>'>
                        <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" ViewSelectorText="x"></Calendar>
                        <DateInput DisplayDateFormat="M/d/yyyy" DateFormat="M/d/yyyy" TabIndex="2" />
                        <DatePopupButton ImageUrl="" HoverImageUrl="" TabIndex="2"></DatePopupButton>
                    </telerik:RadDatePicker
                </ItemTemplate>                
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn UniqueName="DateCreated" DataField="DateCreated" HeaderText="Date Created" FooterStyle-Font-Bold="true" FooterStyle-Wrap="false" ItemStyle-Wrap="false">
                <ItemTemplate>                                       
                     <asp:Label runat="server" ID="lblClaimantDateCreated" Width="150" Text='<%# Bind("DateCreated")  %>' />
                </ItemTemplate>                
            </telerik:GridTemplateColumn>                                                            
            <telerik:GridTemplateColumn UniqueName="DateEdited" DataField="DateEdited" HeaderText="Date Edited" FooterStyle-Font-Bold="true" FooterStyle-Wrap="false" ItemStyle-Wrap="false">
                <ItemTemplate>                                       
                     <asp:Label runat="server" ID="lblClaimantDateEdited" Width="150" Text='<%# Bind("DateEdited")  %>' />
                </ItemTemplate>                
            </telerik:GridTemplateColumn>            
            <telerik:GridTemplateColumn UniqueName="ModifiedBy" DataField="ModifiedBy" HeaderText="Modified By" FooterStyle-Font-Bold="true" FooterStyle-Wrap="false" ItemStyle-Wrap="false">
                <ItemTemplate>                                       
                     <asp:Label runat="server" ID="lblClaimantModifiedBy" Width="150" Text='<%# Bind("ModifiedBy")  %>' />
                </ItemTemplate>                
            </telerik:GridTemplateColumn>                                                                      
        </Columns>
    </MasterTableView>
    <ClientSettings>              
        <Selecting AllowRowSelect="True" EnableDragToSelectRows="false" />
        <DataBinding EnableCaching="True" />
        <ClientEvents OnKeyPress="KeyPressed" />
    </ClientSettings>               
</telerik:RadGrid>

and here is the code that is binding the combo box

protected void rgrdClaimantStatus_ItemDataBound(object source, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        //SetEditModeColumnWidths(e.Item as GridDataItem);
        RadComboBox status = ((e.Item as GridDataItem)["StatusDesc"].FindControl("rcbClaimantStatusCode") as RadComboBox);
        LoadClaimantStatusList(status, Convert.ToInt32((GetSelectedCompany())));
      
    }
}

protected void LoadClaimantStatusList(RadComboBox rddlStatus, int companyId)
{
    ReferenceProcess rc = new ReferenceProcess();
    Dictionary<int,string> statusList = rc.GetClaimantStatusList(CentralDBConnString, companyId);
    rddlStatus.DataSource = statusList;
    rddlStatus.DataTextField = "Value";
    rddlStatus.DataValueField = "Key";
    rddlStatus.DataBind();
    rddlStatus.Items.Insert(0, new RadComboBoxItem("Select a status", string.Empty));
}

I had read in other threads about removing the DataBind() from the above code, but all that does is allow the load of the "Select A Status" item and none of the database items.

Thanks!
Nencho
Telerik team
 answered on 22 Oct 2012
6 answers
71 views
Hi,

Is it possible to Drag n drop multiple appointments across resources( using resource grouping) In Asp.Net Ajax Scheduler (Latest version or any ?)
Ravi
Top achievements
Rank 1
 answered on 22 Oct 2012
3 answers
247 views
Hola buen dia me gustaria saber como puedo incluir en la lista de los temas que viene por default mi tema pesonalizado con el biulder espeor me puedan ayudar para que asi lo pueda aplicar de una forma mas sencilla y facil
Bozhidar
Telerik team
 answered on 22 Oct 2012
2 answers
102 views
I have used two Rad Tab in my form
1st tab added some text field
2nd tab added Rad Grid. see my screen shot
Default row 5 is set then i have add row using addrow button to click.
When i click Add Row button to row create but previous row clear

This is my addrow coding:
private void addrow(int currow)//int currow
        {
            object[] emptyRow = new object[columcount];
            tabledata1 = null;
            DataTable dt = tabledata1;
            assigndt2(dt);
            dt.Rows.Add(emptyRow);
            RadGrid1.DataSource = dt;
            RadGrid1.DataBind();
        }

private void assigndt2(DataTable dt)
        {
            RadComboBox r1;
            RadNumericTextBox rn1;

            for (int i = 0; i <= RadGrid1.Items.Count - 1; i++)
            {
                if (dt.Rows.Count - 1 < i)
                {
                    object[] emptyRow = new object[columcount];
                    dt.Rows.Add(emptyRow);
                }
                r1 = (RadComboBox)this.RadGrid1.Items[i].FindControl("Workdesc");
                dt.Rows[i]["Workdesc"] = r1.Text;
                r1 = (RadComboBox)this.RadGrid1.Items[i].FindControl("Radcombo_Unit");
                dt.Rows[i]["Radcombo_Unit"] = r1.Text;
                rn1 = (RadNumericTextBox)this.RadGrid1.Items[i].FindControl("Quantity");
                dt.Rows[i]["Quantity"] = rn1.Text;
                rn1 = (RadNumericTextBox)this.RadGrid1.Items[i].FindControl("Rate");
                dt.Rows[i]["Rate"] = rn1.Text;
                rn1 = (RadNumericTextBox)this.RadGrid1.Items[i].FindControl("Amount");
                dt.Rows[i]["Amount"] = rn1.Text;
                rn1 = (RadNumericTextBox)this.RadGrid1.Items[i].FindControl("Fees");
                dt.Rows[i]["Fees"] = rn1.Text;
                rn1 = (RadNumericTextBox)this.RadGrid1.Items[i].FindControl("Total");
                dt.Rows[i]["Total"] = rn1.Text;


            }

        }
Tamim
Top achievements
Rank 1
 answered on 22 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?