Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
99 views
Hello,

I have a Rad Grid to the left of my page and a ajax panel to the right, I basically want the user to be able to select any row in my grid which in turn will pass an ID and refresh the ajax panel showing the selected row details.

I'm pretty sure you used to have an online example of this scenerio, if so could please link it (I've looked everywhere for it to no avail).

Thank you.

Craig Mellon
Top achievements
Rank 1
 answered on 16 Dec 2011
1 answer
258 views
Hi,

I am creating a hierarchical grid with template as shown in link below. However, all of my  tab pages in the  nested view template have chidgrids. . There is n-level of hierarchy. How can i create parent table relation in  hierarchical grid with template   to avoid infinite loop.



http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/nestedviewtemplate/defaultcs.aspx

Thanks,
Prava
Antonio Stoilkov
Telerik team
 answered on 16 Dec 2011
1 answer
71 views
Hi all,

can someone tell me what it is the best way to browse all nodes of a RadTreeView?

I'm using the following code:

foreach (RadTreeNode oNode in oTreeView.Nodes)
{
    Label oLbl = (Label)oNode.FindControl("spnDesignation");
    oLbl.Visible = bShow;
}

but it is just catching the root node.

Thanks,
Bruno
Bruno
Top achievements
Rank 1
 answered on 16 Dec 2011
2 answers
91 views
I have one database with two tables, named Event1 and Event2. 

I now have:

<telerik:RadScheduler runat="server" ID="RadScheduler1" Width="748px" SelectedDate="2007-03-30"<br>            DayStartTime="08:00:00" DayEndTime="18:00:00" DataKeyField="ID" DataSubjectField="Subject"<br>            DataStartField="Start" DataEndField="End" DataRecurrenceField="RecurrenceRule"<br>            DataRecurrenceParentKeyField="RecurrenceParentID" <br>            DataSourceID="EntityDataSource1" ><br>            <ResourceTypes><br>                <telerik:ResourceType KeyField="ID" Name="Event1" TextField="Text1" ForeignKeyField="ID"<br>                    DataSourceID="EntityDataSource1" /><br>                <telerik:ResourceType KeyField="ID" Name="<span style="font-size: 14px; ">Event2</span>" TextField="Text2" ForeignKeyField="ID"<br>                    DataSourceID="EntityDataSource2" /><br>            </ResourceTypes><br>        </telerik:RadScheduler>


I have some questions:

1. What is the method GetResources(ISchedulerInfo schedulerInfo) for? What would I get if I override it?
2. In the code above, I know that the KeyField is the primary key of the table, the ForeignKeyField  is the foregin key, but what column of the table represents the TextField attribute?
3. How to define the tables as different resources?
4. How to make different color of the events from the second table but not with javascript, but as resources?
Dani
Top achievements
Rank 1
 answered on 16 Dec 2011
3 answers
126 views
Hi,

in certain cases I want to reload specific nodes. When it's about nodes under other nodes, this is no problem.
I collapse the node, remove the children, set the expand mode back to webservice and expand the node.
The nodes are loaded-on-demand by the tree.

But when it is about the root nodes, I have to do it myself. I call the webservice, get the nodes but how do I add them to the tree?
This is what I found in the forums (but the post was from 2008).
function AddRootNodesToTree(nodes, tree) {
   tree.trackChanges();
   tree.get_nodes().clear();
   for (var node in nodes) {
      var dynamicNode = new Telerik.Web.UI.RadTreeNode();
      dynamicNode._loadFromDictionary(nodes[node]);
      tree.get_nodes().add(dynamicNode);
   }
   tree.commitChanges();
}

The nodes from the webservice are correctly converted to RadTreeNode and added. But the attributes of the nodes aren't transferred to the RadTreeNode.

So, how can I add nodes, which I fetch from a webservice, to the tree as root nodes?

Thanks!

Edit: I added screenshot from the Google Chrome debugger where you can see the difference. The webservice returns in both cases RadTreeNodeData and I didn't see any difference regarding the attributes.
Plamen
Telerik team
 answered on 16 Dec 2011
6 answers
105 views

Hi
I have been trying to use the RadGrid to maintain emergency contact information. I am having a difficulty getting my user control to perform the actual insert. I have looked through the documentation and still cannot figure out what I am doing wrong. My grid comes up ok and when I click on Add new record, my user control comes up and I can fill in the information. I even have validators on the page that fires ok. When I click the Insert button, the form returns and no record is added. I handle the InsertCommand event on the server side but it does not seem to get there. I really have an urgent need to move past this problem, so your urgent response here is very welcome.

Any leads will be very helpful. Here is my code

ASPX

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="pEmergencyContact.aspx.cs" Inherits="ARM.ETF.pEmergencyContact" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head id="Head1" runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            width: 760px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="grdEmergency">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grdEmergency" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
        </telerik:RadAjaxLoadingPanel>
        <table class="style1">
            <tr>
                <td>
                    <asp:Panel ID="pnlGrid" runat="server">
                        <telerik:RadGrid ID="grdEmergency" runat="server" AutoGenerateColumns="False"
                            OnInsertCommand="grdEmergency_InsertCommand"
                            OnNeedDataSource="grdEmergency_NeedDataSource"
                            CellSpacing="0" GridLines="None">
                            <MasterTableView CommandItemDisplay="Top" AllowAutomaticInserts="false" EditMode="PopUp" >
                                <CommandItemSettings ExportToPdfText="Export to PDF" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="FIRST_NAME"
                                        FilterControlAltText="Filter firstname column" HeaderText="Contact First Name"
                                        UniqueName="firstname">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="LAST_NAME"
                                        FilterControlAltText="Filter lastname column" HeaderText="Contact Last Name"
                                        UniqueName="lastname">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="RELATION"
                                        FilterControlAltText="Filter relationship column" HeaderText="Relation"
                                        UniqueName="relationship">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="TELEPHONE_HOME"
                                        FilterControlAltText="Filter homeTelephone column"
                                        HeaderText="Telephone (Home)" UniqueName="homeTelephone">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="TELEPHONE_BUSINESS"
                                        FilterControlAltText="Filter workTelephone column"
                                        HeaderText="Telephone (Work)" UniqueName="workTelephone">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="TELEPHONE_EXTENSION"
                                        FilterControlAltText="Filter extension column" HeaderText="Extension"
                                        UniqueName="extension">
                                    </telerik:GridBoundColumn>
                                </Columns>
                                <EditFormSettings UserControlName="~/Controls/emergencycontact.ascx" EditFormType="WebUserControl">
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                </EditFormSettings>
                            </MasterTableView>
                            <FilterMenu EnableImageSprites="False">
                            </FilterMenu>
                            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                            </HeaderContextMenu>
                        </telerik:RadGrid>
                    </asp:Panel>
                    </td>
            </tr>
            <tr>
                <td>
                </td>
            </tr>
        </table>
     
    </div>
    </form>
</body>
</html>

ASCX

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="emergencycontact.ascx.cs" Inherits="ARM.ETF.Controls.emergencycontact" %>
<%@ Import Namespace="ARM.Common.Classes" %>
<style type="text/css">
        .grdTable
        {
            font-size: 12px;
            font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
            margin: 0px;
            padding: 0px;
            color: #696969;           
            width: 360px;
        }
        .grdText
        {
            font-family: 'Segoe UI';
            font-size: 12px;
            color: #000000;
            background-color: #EAEAEA;
            border: 1px solid #CCCCCC;
        }
        .grdlabel
        {
            width: 100px;
        }
    </style>
    <table class="grdTable">
        <tr>
            <td class="grdlabel">
                <asp:Label ID="lblgrdFirstName" runat="server" Text="lblgrdFirstName"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtgrdFirstName" Runat="server" Width="200px" CssClass="grdText"></asp:TextBox
                <asp:RequiredFieldValidator ID="rfvgrdFirstName" runat="server" ControlToValidate="txtgrdFirstName" ErrorMessage="*"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="grdlabel">
                <asp:Label ID="lblgrdLastName" runat="server" Text="lblgrdLastName"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtgrdLastName" Runat="server" Width="200px" CssClass="grdText"></asp:TextBox> <asp:RequiredFieldValidator ID="rfvgrdLastName" runat="server" ControlToValidate="txtgrdLastName" ErrorMessage="*"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="grdlabel">
                <asp:Label ID="lblgrdHomeTelephone" runat="server" Width="100px" Text="lblgrdHomeTelephone"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtgrdHomeTelephone" Runat="server" CssClass="grdText"></asp:TextBox
                <asp:RequiredFieldValidator ID="rfvgrdHomeTelephone" runat="server" ControlToValidate="txtgrdHomeTelephone" ErrorMessage="*"></asp:RequiredFieldValidator>
                <asp:RegularExpressionValidator ID="revgrdHomeTelephone" runat="server" ControlToValidate="txtgrdHomeTelephone" ValidationExpression="^[2-9]\d{2}-\d{3}-\d{4}$" ErrorMessage="*"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="grdlabel">
                <asp:Label ID="lblgrdWorkTelephone" runat="server" Text="lblgrdWorkTelephone"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtgrdWorkTelephone" Runat="server" Width="100px" CssClass="grdText"></asp:TextBox> <asp:RegularExpressionValidator
                    ID="revgrdWorkTelephone" runat="server" ControlToValidate="txtgrdWorkTelephone" ValidationExpression="^[2-9]\d{2}-\d{3}-\d{4}$" ErrorMessage="*"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="grdlabel">
                <asp:Label ID="lblgrdExtension" runat="server" Text="lblgrdExtension"></asp:Label>
            </td>
            <td>
                <asp:TextBox ID="txtgrdExtension" Runat="server" Width="70px" CssClass="grdText"></asp:TextBox> <asp:RegularExpressionValidator
                    ID="revExtension" runat="server" ControlToValidate="txtgrdExtension" ValidationExpression="^\d+$" ErrorMessage="*"></asp:RegularExpressionValidator>
            </td>
        </tr>
        <tr>
            <td class="grdlabel">
                <asp:Label ID="lblgrdRelation" runat="server" Text="lblgrdRelation"></asp:Label>
            </td>
            <td>
                <asp:DropDownList ID="cbogrdRelation" runat="server" CssClass="grdText"></asp:DropDownList
                <asp:RequiredFieldValidator ID="rfvgrdRelation" runat="server" ControlToValidate="cbogrdRelation" InitialValue="0" ErrorMessage="*"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:Button ID="btngrdSave" CommandName="PerformInsert" runat="server"
                    Text="btngrdSave" />
            </td>
 
        </tr>
    </table>

Page Code Behind

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ARM.Common.Classes;
using YorkU.Data;
using Telerik.Web.UI;
 
namespace ARM.ETF
{
    public partial class pEmergencyContact : System.Web.UI.Page
    {
        SqlServer sql = new SqlServer();
        Command cmd = new Command();
        DataFactory df = new DataFactory();
        private string MyToken = "7EC07A5015A945A4A49037E315E9F8C3";
        private int MyPerson = 2;
 
        protected override void OnInit(EventArgs e)
        {
            grdEmergency.InsertCommand += new GridCommandEventHandler(grdEmergency_InsertCommand);
            grdEmergency.NeedDataSource += new GridNeedDataSourceEventHandler(grdEmergency_NeedDataSource);
            base.OnInit(e);
        }
 
        protected void grdEmergency_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            this.grdEmergency.MasterTableView.Items[0].Edit = true;
            ConfigureGrid();
        }
 
        protected void grdEmergency_InsertCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.PerformInsertCommandName)
            {
                GridEditableItem itm = e.Item as GridEditableItem;
                UserControl uc = (UserControl)e.Item.FindControl(GridEditFormItem.EditFormUserControlID);
 
                TextBox txtgrdFirstName = uc.FindControl("txtgrdFirstName") as TextBox;
                TextBox txtgrdLastName = uc.FindControl("txtgrdLastName") as TextBox;
                TextBox txtgrdHomeTelephone = uc.FindControl("txtgrdHomeTelephone") as TextBox;
                TextBox txtgrdWorkTelephone = uc.FindControl("txtgrdWorkTelephone") as TextBox;
                TextBox txtgrdExtension = uc.FindControl("txtgrdExtension") as TextBox;
                DropDownList cbogrdRelation = uc.FindControl("cbogrdRelation") as DropDownList;
 
                string firstName = txtgrdFirstName == null ? string.Empty : txtgrdFirstName.Text;
                string lastName = txtgrdLastName == null ? string.Empty : txtgrdLastName.Text;
                string homeTel = txtgrdHomeTelephone == null ? string.Empty : txtgrdHomeTelephone.Text;
                string workTel = txtgrdWorkTelephone == null ? string.Empty : txtgrdWorkTelephone.Text;
                string extn = txtgrdExtension == null ? string.Empty : txtgrdExtension.Text;
                int relation = cbogrdRelation == null ? 0 : int.Parse(cbogrdRelation.SelectedItem.Value);
 
                cmd.CommandText = ETFConstants.sp_CreateEmergencyContact;
                cmd.CommandType = CommandType.StoredProcedure;
 
                cmd.ParameterAdd("@PersonID", DbType.Int32, MyPerson);
                cmd.ParameterAdd("@FirstName", DbType.String, firstName);
                cmd.ParameterAdd("@LastName", DbType.String, lastName);
                cmd.ParameterAdd("@Relation", DbType.Int32, relation);
                cmd.ParameterAdd("@HomeTelephone", DbType.String, homeTel);
                cmd.ParameterAdd("@WorkTelephone", DbType.String, workTel);
                cmd.ParameterAdd("@Extension", DbType.String, extn);
 
                sql.ExecuteNonQuery(cmd);
            }
 
        }
 
 
 
        protected void Page_Load(object sender, EventArgs e)
        {
            ConfigureGrid();
        }
 
        private void ConfigureGrid()
        {
            grdEmergency.DataSource = df.GetERContactData(MyToken);
            grdEmergency.DataBind();
        }
 
    }
}

And User Control Code Behind

using System;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using YorkU.Data;
using ARM.Common.Classes;
using Telerik.Web.UI;
 
namespace ARM.ETF.Controls
{
    public partial class emergencycontact : UserControl
    {
        DataFactory df = new DataFactory();
        public const int MyPerson = 2;
 
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }
 
 
        protected void Page_Load(object sender, EventArgs e)
        {
            LoadLabels();
            LoadCombo();
        }
 
        private void LoadLabels()
        {
            lblgrdExtension.Text = ETFConstants.Label_Extension;
            lblgrdFirstName.Text = ETFConstants.Label_FirstName;
            lblgrdHomeTelephone.Text = ETFConstants.Label_TelephoneHome;
            lblgrdLastName.Text = ETFConstants.Label_LastName;
            lblgrdRelation.Text = ETFConstants.Label_Relation;
            lblgrdWorkTelephone.Text = ETFConstants.Label_TelephoneWork;
 
            btngrdSave.Text = ETFConstants.Btn_Save;
        }
 
        private void LoadCombo()
        {
            ListItem itm;
            DataTableReader dtr;
             
            cbogrdRelation.Items.Clear();
 
            itm = new ListItem();
            itm.Text = ETFConstants.ComboDefaultText;
            itm.Value = ETFConstants.ComboDefaultValue;
 
            cbogrdRelation.Items.Add(itm);
 
            dtr = df.GetRelations();
 
            while (dtr.Read())
            {
                itm = new ListItem();
 
                itm.Text = dtr["REFERENCE"].ToString();
                itm.Value = dtr["CODE"].ToString();
 
                cbogrdRelation.Items.Add(itm);
            }
        }
    }
 
}

BMEA
Top achievements
Rank 1
 answered on 16 Dec 2011
2 answers
159 views
I know I can register an event using ClientSettings.ClientEvents.OnRowDblClick, but this seems to fire for every row including any DetailTable instances in my grid.

Is there any way to either register a different event, or differentiate in some way (using a JavaScript function possibly) whether the event was fired from a master or detail table?  Thanks!
Doug
Top achievements
Rank 1
 answered on 16 Dec 2011
2 answers
63 views
Hello,

I have setup a RadCalendar with a RadTooltipManager using the examples here:
http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipcalendar/defaultcs.aspx


In the OnAjaxUpdate event i instantiate a control and set a public property on it (a collection of items)
adds it to the container: e.UpdatePanel.ContentTemplateContainer.Controls.Add(details);

and then bind the datasource in the control PreRender event.

When I hover over a day with an event the first time, I see a blank tooltip with the scrollers aligned tight to eachothers to the very right of the tooltip (firefox) ... In chrome nothing appears at all, but in FF, it all comes up correctly on the second time i hover over.

I don't experience any of this in IE9.
Could it be some z-index issue?
Thanks in advance :)


Any ideas?
Slav
Telerik team
 answered on 16 Dec 2011
2 answers
82 views
HI
I am useing Asp validators for my Teleric controls.
I am having issues like, it is not dispalying validation message after tab.

For example.

I have 2 textboxes, and values will save under save button.

Using RequiredFieldValidator for both textboxes.

If I won't enter data to text boxes , after tab it should display validation message like: Is required.

But right now it is displaying validation message only under save button click.

Could some one please help me regarding this.
I really appreciate if some helps regarding this.

I did spend so much time on it, but still searching for the solution ..


Thanks
usha
prathyusha
Top achievements
Rank 1
 answered on 16 Dec 2011
2 answers
35 views
Hi,

I use RadControls for ASP.NET AJAX Q1 2011 version. My problem is that MarkFirstMatch = true property of RadComboBox does not work in IE 7 & IE 8. I have tested with IE9, Opera, Safari, Firefox, Chrome and every works fine there.
I have read the below article:
 
http://www.telerik.com/community/forums/aspnet-ajax/combobox/patch-ms-update-kb2586448-breaks-radcombobox-markfirstmatch-in-versions-older-than-2009-3-1314-inclusive.aspx

and I don't know if that is the case as it refers to older versions.

Do you have any idea how to solve it?

Thank you in advance,
Antonia
Antonia
Top achievements
Rank 1
 answered on 16 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?