Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
127 views
Hi Telerik,

I have a dynamically created Dock and its content is a chart. I load the content for the dock like so:

private void LoadDockContent(RadDock dock)
{
    System.Web.UI.Control ctrl = Page.LoadControl("PowerUsage.ascx");
    dock.ContentContainer.Controls.Add(ctrl);
}

I need to be able to access the name of the control ClientSide.

I suspect it's something like this, but I'm not quite on:

<script type="text/javascript">
    function OnClientInitialize(dock, args) {
        var content = dock.get_contentContainer();
        var control = $telerik.isIE ? content.childNodes[0].innerHTML : content.childNodes[1].innerHTML;
        alert(control);
    }
</script>

The alert displays a dump of all the HTML in the dock. This does include the control I am looking for, but there would be some extremely heavy parsing necessary to isolate the string that I want from the HTML. I've attached to this post "html.png" which is the output of the alert.

If I could just get the img id instead of all the HTML I would be happier, but I would be happiest if I could capture the control name without any parsing, obviously. Ultimately, my goal is to utilize some jQuery to resize the chart control stored on the RadDock. Just to make sure I'm not headed down a dark path, I would also just like to get a quick, "Yep. That should work!" from you guys.

<script type="text/javascript">
    jQuery(function($) {
            $(window).wresize(SetPageChartSizes<%= Chart.ClientID %>);
            SetPageChartSizes<%= Chart.ClientID %>();
        });
                 
        function SetPageChartSizes<%= Chart.ClientID %>() {
            document.getElementById('<%= hfChartWidth.ClientID %>').value = (document.getElementById('<%= updatePanel.ClientID %>').offsetWidth - 4);
            <%=Page.GetPostBackEventReference(btnHidden_Charts)%>;
    }
</script>

So, this code isn't 100% relevant to what I've got going on, yet. This function waits for the window to be resized and then resizes Chart based on the new window size. I am going to rewrite this so that whenever the size of the Dock changes the content it controls (a chart) will resize to fill the size of the dock. Chart doesn't just exist on the page, though. I have to get a handle on that -- which means I need to get the control name from the Dock.

Let me know if anything here is unclear.

Thanks,

Sean
Pero
Telerik team
 answered on 03 Feb 2011
1 answer
93 views
Hi Team,

i have the below code for enabling the VirtualScrollPaging on grid. this is working fine on Mozilla. but on IE 7 (not checked on other IE version) when i am scrolling it jumping the scroll to 20-40 pages. here i noticed one thing is that the scroll bar size is diffrent in both MOzilla and IE 7. i had attached the screen shots with mail.

Code :
<telerik:RadGrid CssClass="RadGrid" GridLines="None" BorderStyle="None" ID="grdNominationDetails"
                        Width="100%" runat="server" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"
                        alternatingrowstyle-cssclass="alternate" OnDeleteCommand="grdNominationDetails_RowDeleting"
                        OnSortCommand="grdNominationDetails_Sorting" OnItemDataBound="grdNominationDetails_RowDataBound" PageSize="20">
                        <PagerStyle Mode="NumericPages" PageButtonCount="20" AlwaysVisible="true" />
                        
                        <%--<EmptyDataTemplate>
                                            <center>
                                                <asp:Label ID="lblNoNominationsMessage" CssClass="error-message" runat="server" Text="Nomination Data not available.<br>Please click 'Import HIPO Nomination Data' to upload nomination data."></asp:Label>
                                            </center>
                                        </EmptyDataTemplate>--%>
                        <MasterTableView AllowNaturalSort="true" >
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="Nominated" ItemStyle-HorizontalAlign="Center"
                                    SortExpression="PMConfirmation" HeaderStyle-Width="14%" >
                                    <ItemTemplate>
                                        <div style="text-align: center;">
                                            <asp:CheckBox ID="chkPMConfirmation" runat="server" Checked='<%# ConvertNominationStatusToBool(Eval("PMConfirmation") as bool?) %>' />
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Employee Name" HeaderStyle-Width="30%"
                                    SortExpression="LastName">
                                    <ItemTemplate>
                                        <a href="../../Develop/CandidateProfile.aspx?uid=<%# GetUserId( Eval("UserId")) %>">
                                            <%# FormatName(Eval("FirstName"),Eval("LastName"))%>
                                        </a>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Nominator Name" HeaderStyle-Width="28%"
                                    SortExpression="NominatorLastName">
                                    <ItemTemplate>
                                        <div class="wordwrap">
                                            <asp:Literal ID="ltlNominatorName" runat="server" Text='<%# FormatName(Eval("NominatorFirstName"), Eval("NominatorLastName")) %>'></asp:Literal>
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Status" ItemStyle-HorizontalAlign="Center"
                                    HeaderStyle-Width="20%"  SortExpression="Nominated">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddlNominationStatus" runat="server">
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderStyle-Width="8%"  HeaderText="Edit">
                                    <ItemTemplate>
                                        <div style="text-align: center;">
                                            <asp:ImageButton ToolTip="Delete" OnClientClick="ShowModal(this,'HIPO Candidate Delete Warning','Are you sure you want to delete this HIPO candidate?');return false;"
                                                ID="imgDelete" ImageUrl="~/images/icon_delete_competency.gif" runat="server"
                                                CausesValidation="false" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "UserId") %>'
                                                Text="Delete"></asp:ImageButton>
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="true">
                            
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" EnableVirtualScrollPaging="true">
                            </Scrolling>
                        </ClientSettings>
                    </telerik:RadGrid>
Tsvetina
Telerik team
 answered on 03 Feb 2011
1 answer
109 views
Hi,

I'm using the example posted on the following link
http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipcalendar/defaultcs.aspx


When I try to click on a date associated with a tooltip in IE8 (8.0.6001.18702), I get an unknown runtime error in ScriptResource.axd
The page works fine in Firefox, Chrome and Opera..

Any Ideas??

Source Code for page containing the calendar
public partial class rcalendar : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {    }
    protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
    {
        int ID = e.Day.Date.Day;
         if (ID == 3 || ID == 5 || ID == 14)
        {
            TableCell cell = e.Cell;
            cell.Attributes.Add("onclick", "ShowToolTip(this);");
            cell.Attributes.Add("id", "Calendar_" + ID.ToString());
        }
     }
    protected void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)
    {
        CalendarTT cdrTTobj = (CalendarTT)this.LoadControl("CalendarTT.ascx");
         cdrTTobj.Dateid = int.Parse(e.Value);
        cdrTTobj.ID = Guid.NewGuid().ToString();
         e.UpdatePanel.ContentTemplateContainer.Controls.Add(cdrTTobj);
    }
}

aspx page for calendar
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="rcalendar.aspx.cs" Inherits="CdrApp.rcalendar" %>
<%@ Register Src="CalendarTT.ascx" TagName="CalendarTT" TagPrefix="uc1" %>
<%@ 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 runat="server">
    <title></title>
    <style type="text/css">
 
         
 
    .RadCalendar .rcRow td
    {
        text-align: center !important;
        vertical-align: middle !important;
        width: 50px;
    }
 
 
</style>
</head>
<body style="height: 462px">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
 
        function ShowToolTip(sender) {
            var tooltipManager = $find("<%=RadToolTipManager1.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(sender);
 
            //Create a tooltip if no tooltip exists for such element
            if (!tooltip) {
                tooltip = tooltipManager.createToolTip(sender);
                var longValue = sender.getAttribute("ID");
                var neededValue = longValue.substring(longValue.indexOf('_') + 1)
                tooltip.set_value(neededValue);
                tooltip.show();
            }
        }
 
        </script>
     
    </telerik:RadCodeBlock>
 
    <div>
     
                <telerik:RadCalendar ID="RadCalendar1" Runat="server" DayNameFormat="Full"
                    EnableMultiSelect="False" Height="300px" SelectedDate="" TitleAlign="Center"
                    ViewSelectorText="x" Width="300px" PresentationType="Preview"
                    ShowRowHeaders="False"
                    ondayrender="RadCalendar1_DayRender">
                    </telerik:RadCalendar>
                    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"
        onajaxupdate="RadToolTipManager1_AjaxUpdate" Animation="Fade"
        AutoCloseDelay="30000" EnableShadow="True" EnableTheming="True"
        HideEvent="LeaveTargetAndToolTip" ShowEvent="OnClick" BorderStyle="Outset"
        Position="Center">
    </telerik:RadToolTipManager>
    </div>
    </form>
</body>
</html>




Thanks..
Ron
Top achievements
Rank 1
 answered on 03 Feb 2011
2 answers
287 views
I am trying to updated a RadGrid based on what is selected in a RadComboBox but the grid displays nothing.  The Grid's SQL DataSource is tied to a stored procedure which accepts a parameter (CustBill) from the RadComboBox.  Ajax Manager is setup to update both the RadGrid and RadComboBox but the stored procedure returns 0 results no matter what is selected in the combo box.  Here is the AjaxManager, RadComboBox, and SQL Datasource code.  Is AjaxManager refreshing the controls properly?  Your help is appreciated. 
-Scott

 

 

***
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"

 

 

 

DefaultLoadingPanelID="RadAjaxLoadingPanel1">

 

 

 

  <AjaxSettings>

 

 

 

  <telerik:AjaxSetting AjaxControlID="RadComboBox1">

 

 

 

    <UpdatedControls>

 

 

 

        <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />

 

 

 

        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

    </UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>



***
<telerik:RadComboBox ID="RadComboBox1" Runat="server"

 

 

 

    DataSourceID="SqlDataSource1" DataTextField="CustBill"

 

 

 

    DataValueField="CustBill" Height="122px" Skin="Windows7" Width="319px">

 

 

 

 

 

 

 

    <Items>

 

 

 

 

 

 

 

        <telerik:RadComboBoxItem Text="All" Value="0" Selected="true" />

 

 

 

 

 

 

 

    </Items>

 

 

 

 

 

 

 

</telerik:RadComboBox>

 

 

 

 


*** This SQL Data Source populates the combo box ***

 

<

 

 

asp:SqlDataSource ID="SqlDataSource1" runat="server"

 

 

 

    ConnectionString="<%$ ConnectionStrings:crmDashboardConnectionString %>"

 

 

 

    SelectCommand="SELECT TOP (10) CustBill FROM crmSalesSuperior WHERE (CustBill IN (SELECT CustBill FROM crmSalesSuperior AS crmSalesSuperior_1 WHERE (Branch = 102))) GROUP BY CustBill ORDER BY CustBill">

 

 

 

 

</asp:SqlDataSource>

 

 

 

 



*** This is the Grid's SQL data source, calling a stored procedure with a parameter from combo box. ***

 

 

 

 

<asp:SqlDataSource ID="SqlDataSource2" runat="server"

 

 

 

ConnectionString="<%$ ConnectionStrings:crmDashboardConnectionString %>"

 

 

 

SelectCommand="CRMDashboardSales" SelectCommandType="StoredProcedure">

 

 

 

 

    <SelectParameters>

 

 

 

 

        <asp:ControlParameter Name="CustBill" ControlID="RadComboBox1"

 

 

 

            PropertyName="SelectedValue" Type="String"

 

 

 

            DefaultValue="Power Equipment Co " />

 

 

 

 

    </SelectParameters>

 

 

 

 

</asp:SqlDataSource>

 

 

 

 




 

Scott
Top achievements
Rank 1
 answered on 03 Feb 2011
3 answers
149 views
I am using the Q3 2008 controls currently.

I have a radWindow I am opneing and setting options via JavaScript:

 

 

 

function openWindow() {  
        window.setTimeout(function() {  
            var oManager = GetRadWindowManager();  
            var rdWin = oManager.open('<%=WindowURL%> ''rwVideoTutorial');  
            rdWin.set_status('Video Tutorial <%=HelpVideoID %> ');  
            rdWin.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move);  
            rdWin.center;  
            rdWin.remove_resize;  
            rdWin.add_dragEnd(OnClientDragEnd);  
            rdWin.setSize(620, 430);  
        }, 1000);  
    }  
 
    function OnClientDragEnd(sender, eventArgs) {  
        var oManager = GetRadWindowManager();  
        var oWnd = oManager.getWindowById(sender.get_id());  
                oWnd.reload();  
 
          
    } 

I am embeding a YouTube video on a page that is loaded by the RadWindow. In IE8 some strange things are happening. I added the OnClinetDragEnd in hopes that the content would reload, but it doesn't in IE8 unless I have IE8 in compatability mode. If hte winodw is draged in IE8 the audio cuts out fromt he video, so I thought I could jsut reload the content. Also, when the window closes and the video is still running, you can still hear the audio after the window is clsoed. I am not experiencing any of these issues with FireFox. 

Ultimately, I would like the content to reload as it does in FireFox, but in FireFox I really don't need to reload the content, because even after the window is done being dragged the video plays from where it left off.

If I can;t get this to work IN IE8 like it does in FF, how can I set the window to be destroyed via Javascript? I have the window set to be destroyed in the ASPX code, but I guess, since I am openeing it via javascript that doesn't matter.

Daniel

 

 

Georgi Tunev
Telerik team
 answered on 03 Feb 2011
4 answers
155 views
Hello,

I have a web site that has a radmenu at the top of the page, with a radtabstrip directly below it, then a radwindow(s) below that.  I'm using the tabstrip and radwindows to simulate tabs with different web pages, much like IE and other browsers do only this is all within my web site.  I am having an issue with the latest build where the radmenu is showing behind the radwindows.  Previously this worked fine - I had the z-index on the radmenu set to a large number and the menu would always show on top.  When I upgraded to the latest build, the radmenu shows above the tabstrip but below the radwindow.  I've tried setting the z-index of the radmenu to something insanely high and also tried setting the z-index to a low value on my radwindowmanager.  Neither seem to work, the radmenu always shows behind the radwindow.  Is this a bug with the latest build, or is there something new that I need to account for in my page?  I downgraded to the previous build and verified this works fine.  It's just the latest build that seems to act differently.

Thanks!
Richard
Richard
Top achievements
Rank 1
 answered on 03 Feb 2011
1 answer
67 views
Hello,

I'm trying to implement the Tooltipified RadGrid in my web user control.  I've followed all the instructions  according to your attached file telerikradtooltipsample.zip. I'm also using this example: http://demos.telerik.com/aspnet-ajax/tooltip/examples/targetcontrolsandajax/defaultcs.aspx
I'm working on DotNetNuke and the following exception appears.
Error: TestToolTip is currently unavailable.
DotNetNuke.Services.Exceptions.ModuleLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.UI.Modules.ModuleHost.LoadModuleControl() --- End of inner exception stack trace ---
My code snippets:

TestToolTip.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TestToolTip.ascx.cs" Inherits="SU_SaleStatisticImport.TestToolTip" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="Telerik" %>
<%@ Register Src="ActivityDetails.ascx" TagName="ActivityDetails" TagPrefix="uc1" %>
<!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>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server">
    </asp:ScriptManager>
    <Telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
    </Telerik:RadAjaxLoadingPanel>
    <Telerik:RadToolTipManager ID="RadToolTipManager1" OffsetY="-1" HideEvent="ManualClose"
        Width="250" Height="350" runat="server" EnableShadow="true" OnAjaxUpdate="OnAjaxUpdate"
        RelativeTo="Element" Position="MiddleRight">
    </Telerik:RadToolTipManager>
    <Telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <Telerik:AjaxSetting AjaxControlID="rgCampaigns">
                <UpdatedControls>
                    <Telerik:AjaxUpdatedControl ControlID="rgCampaigns" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <Telerik:AjaxUpdatedControl ControlID="RadToolTipManager1" />
                </UpdatedControls>
            </Telerik:AjaxSetting>
        </AjaxSettings>
    </Telerik:RadAjaxManager>
    <Telerik:RadGrid ID="rgCampaigns" runat="server" OnItemDataBound="rgCampaigns_ItemDataBound"
        AutoGenerateColumns="false">
        <MasterTableView runat="server" DataKeyNames="GlobalCode">
            <Columns>
                <Telerik:GridTemplateColumn HeaderText="First">
                    <ItemTemplate>
                        <asp:Label ID="lblTitle" runat="server" Text="Show ToolTip"></asp:Label>
                    </ItemTemplate>
                </Telerik:GridTemplateColumn>
                <Telerik:GridBoundColumn DataField="SecondColumn" HeaderText="Second">
                </Telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </Telerik:RadGrid>
    </form>
</body>
</html>

TestToolTip.ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
 
namespace SU_SaleStatisticImport
{
    public partial class TestToolTip : System.Web.UI.UserControl
    {
        protected System.Data.DataTable GetData()
        {
            System.Data.DataTable tbl = new System.Data.DataTable();
            tbl.Columns.Add(new System.Data.DataColumn("GlobalCode"));
            tbl.Columns.Add(new System.Data.DataColumn("SecondColumn"));
            tbl.Columns.Add(new System.Data.DataColumn("ThirdColumn"));
            tbl.Columns.Add(new System.Data.DataColumn("FourthColumn"));
            tbl.Rows.Add(new object[] { "firstRecord1", "firstRecord2", "firstRecord3", "firstRecord4" });
            tbl.Rows.Add(new object[] { "secondRecord1", "secondRecord2", "secondRecord3", "secondRecord4" });
            tbl.Rows.Add(new object[] { "thirdRecord1", "thirdRecord2", "thirdRecord3", "thirdRecord4" });
            return tbl;
 
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                rgCampaigns.DataSource = GetData();
                rgCampaigns.DataBind();
            }
        }
 
        protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
        {
            this.UpdateToolTip(args.Value, args.UpdatePanel);
        }
        private void UpdateToolTip(string ActivityCode, UpdatePanel panel)
        {
            Control ctrl = Page.LoadControl("~/ActivityDetails.ascx");
            panel.ContentTemplateContainer.Controls.Add(ctrl);
 
            ActivityDetails details = (ActivityDetails)ctrl;
            details.ActivityCode = ActivityCode;
 
        }
 
        protected void rgCampaigns_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
 
            if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
            {
                Control target = e.Item.FindControl("lblTitle");
                if (!Object.Equals(target, null))
                {
                    if (!Object.Equals(this.RadToolTipManager1, null))
                    {
                        //Add the button (target) id to the tooltip manager
                        this.RadToolTipManager1.TargetControls.Add(target.ClientID, (e.Item as GridDataItem).GetDataKeyValue("GlobalCode").ToString(), true);
 
                    }
                }
            }
 
 
        }
    }
}

ActivityDetails.ascx
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ActivityDetails.ascx.cs" Inherits="SU_SaleStatisticImport.ActivityDetails" %>
<asp:label id="lbltest" runat="server" text="Label"></asp:label>

ActivityDetails.ascx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
namespace SU_SaleStatisticImport
{
    public partial class ActivityDetails : System.Web.UI.UserControl
    {
        public string ActivityCode
        {
            get
            {
                if (ViewState["ActivityCode"] == null)
                {
                    return "";
                }
                return (string)ViewState["ActivityCode"];
            }
            set
            {
 
                ViewState["ActivityCode"] = value;
 
            }
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            lbltest.Text += "<br>Activity code: " + ActivityCode;
        }
    }
}
Svetlina Anati
Telerik team
 answered on 03 Feb 2011
6 answers
610 views

I diamically added 2 columns to the grid when page load,  one GridHTMLEditorColumn is editable and another one is enabled=false, how I get both Radedit value (edited value and enabled=false's cell value) on InsertCommand and UpdateCommand?

 

 

On form load:

 

 

 

 

GridHTMLEditorColumn boundColumn = new GridHTMLEditorColumn();

 

 

 

// GridBoundColumn boundColumn = new GridBoundColumn(); 

 

 this.rgLanguages.MasterTableView.Columns.Add(boundColumn);

 

 

 

// this.rgLanguages.MasterTableView.Columns.Add(cBox.Text);

 

 

 

 

 

  

boundColumn.DataField = cBox.Text;

boundColumn.HeaderText = cBox.Text;

boundColumn.UniqueName = cBox.Value;

rgLanguages_InsertCommand;:

I tried (editedItem["English"].Controls[0] as RadEditor).Text to get value, it only works for NONE dinamically creaded value, but not work for dinamically created column.

How I get both editeable value and enbaled =false's Radedit value here?Thank,
Jessie

 

 

 

 

 

 

 

 

 

:

 

 

 

 

 

 

GP
Top achievements
Rank 1
 answered on 03 Feb 2011
1 answer
150 views
Hi.

I'm using a DatePicker to show data about a specific date, and there are also dates in which no data is related. Hence, I'm populating the picker with special days using the OnLoad event, enabling and disabling the dates between the MinDate and MaxDate, as it's being needed.

This is how I've done so far, populating from the picker's MinDate to the MaxDate, which works, but I'd like to populate by requesting dates everytime I navigate, within the picker's CalendarView, so everytime a request occurs, I only process no more than 40 Special Days, not every date of several months and so on:

protected void DatePicker_Load(object sender, EventArgs e)
{
            RadDatePicker picker = sender as RadDatePicker;
 
            DateTime[] dates = controller.GetCustomerBaseDates();
 
            picker.MinDate = dates.Min();
            picker.MaxDate = dates.Max();
 
            for (DateTime d1 = picker.MinDate; d1 <= picker.MaxDate; d1 = d1.AddDays(1))
            {
                RadCalendarDay day;
 
                bool exists = dates.Contains(d1);
 
                day = new RadCalendarDay { Date = d1, IsSelectable = exists, IsDisabled = !exists };
                day.ItemStyle.CssClass = exists ? "rcDataExists" : "rcDisabled";
 
                picker.Calendar.SpecialDays.Add(day);
            }
}


How could I add the special days every time navigation occurs?  I want to enable and disable these dates on navigation within the view, because a lot of dates would be involved in the process.

Regards.
Iana Tsolova
Telerik team
 answered on 03 Feb 2011
3 answers
237 views
I have nested radgrids in following order

Main RadGrid
Nested View Template
Tab Strip Control
Multi Page view
Rad Grid as child

I am using web user control for Edit/Insert in all child grids. How can I handle Insert and Update commands from child grids.  
Here is markup as is

<telerik:RadGrid  Width="100%" ID="MasterGrid" HorizontalAlign="Center"  runat="server"
             AllowSorting="True" ShowStatusBar="true" AllowAutomaticUpdates="true" ShowFooter="true" AllowAutomaticDeletes="true"  AllowFilteringByColumn="True"  AllowMultiRowSelection="False" AllowPaging="True" ShowGroupPanel="True" AutoGenerateColumns="False" GridLines="none">
            <GroupingSettings CaseSensitive="false" />
            <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"/>
                       <ExportSettings HideStructureColumns="true" />     
                 
                <MasterTableView Width="100%" ShowGroupFooter="true"  CommandItemDisplay="Top" DataKeyNames="custid" TableLayout="Auto"  Name="Customers">
 
                 
                   <GroupByExpressions>
                        <telerik:GridGroupByExpression>
                            <SelectFields>
                                <telerik:GridGroupByField FieldAlias="Agency" FieldName="Agency"></telerik:GridGroupByField>
                            </SelectFields>
                            <GroupByFields>
                                <telerik:GridGroupByField FieldName="Agency"></telerik:GridGroupByField>
                            </GroupByFields>
                        </telerik:GridGroupByExpression>
                    </GroupByExpressions>
                                                         
                      <%--<CommandItemSettings ShowAddNewRecordButton="false"  ShowExportToWordButton="true" ShowExportToExcelButton="true"
                        ShowExportToCsvButton="true" />   --%>
                                                                                             
                    <CommandItemTemplate>
                          <div style="padding: 5px 5px;">
                                                <asp:LinkButton ID="btnExpandAll" runat="server" CommandName="ExpandAll" Visible="false"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Plus.gif" />Expand All</asp:LinkButton>  
                                                <asp:LinkButton ID="btnCollapseAll" runat="server" CommandName="CollapseAll" Visible="false"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Minus.gif" />Collapse All</asp:LinkButton>  
                                                <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# MasterGrid.EditIndexes.Count = 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" />Edit selected</asp:LinkButton>  
                                                <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# MasterGrid.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.gif" />Update</asp:LinkButton>  
                                                <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# MasterGrid.EditIndexes.Count > 0 Or MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.gif" />Cancel editing</asp:LinkButton>  
                                                <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# Not MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />Add new</asp:LinkButton>  
                                                <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" />Add this customer</asp:LinkButton>  
                        <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected customers?')"
                        runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" />Delete selected customers</asp:LinkButton>  
                                                <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" />Refresh customer list</asp:LinkButton>
                                            </div>  
                    </CommandItemTemplate
                                                         
                     
                    <NestedViewTemplate>
                    <fieldset class="viewWrap" runat="server">
                           <asp:Panel runat="server" ID="InnerContainer" Visible="true">
                           <telerik:RadTabStrip EnableViewState="true" OnClientTabSelected="onTabSelected" runat="server" Skin='<%# RadComboBox1.selectedItem.text %>'  ID="TabStrip1" MultiPageID="Multipage1"
                                SelectedIndex="0">
                                <Tabs>
                                    <telerik:RadTab runat="server" Text="Support" PageViewID="RadPageView1"/>
                                    <telerik:RadTab runat="server" Text="Sales" PageViewID="RadPageView2"/>
                                    <telerik:RadTab runat="server" Text="General Info" PageViewID="RadPageView3"/>
                                    <telerik:RadTab runat="server" Text="System Info" PageViewID="RadPageView4"/>
                                    <telerik:RadTab runat="server" Text="Notes" PageViewID="RadPageView5"/>
                                    <telerik:RadTab runat="server" Text="Shipping" PageViewID="RadPageView6"/>
                                    <telerik:RadTab runat="server" Text="Contact" PageViewID="RadPageView7"/>
                                    <telerik:RadTab runat="server" Text="Configuration" PageViewID="RadPageView8"/>
                                    <telerik:RadTab runat="server" Text="SAM" PageViewID="RadPageView9"/>
                                </Tabs>
                            </telerik:RadTabStrip>
                             
                              <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                                     <telerik:RadPageView runat="server" ID="RadPageView1">
                                            <asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("sid") %>' Visible="false" runat="server" />
                                            <telerik:RadGrid Skin='<%# RadComboBox1.selectedItem.text %>' Width="100%" ID="RadPageViewGrid1" AllowAutomaticUpdates="true"   DataSourceID="SqlDataSource2" HorizontalAlign="Center"  runat="server"
                                                AllowSorting="True" AllowFilteringByColumn="False"  AllowMultiRowSelection="False" ShowGroupPanel="true" AllowPaging="True" autoGenerateColumns="False" GridLines="none">
  
                                     <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                                                        DataKeyNames="recid" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top">
                                                       <CommandItemSettings ShowAddNewRecordButton ="false" />
                                                           <CommandItemTemplate>
                                                                  <div style="padding: 5px 5px;">
                                                                                        <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='true'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" />Edit selected</asp:LinkButton>  
                                                                                        <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='false'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.gif" />Update</asp:LinkButton>  
                                                                                        <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# MasterGrid.EditIndexes.Count > 0 Or MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.gif" />Cancel editing</asp:LinkButton>  
                                                                                        <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# Not MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />Add new</asp:LinkButton>  
                                                                                        <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" />Add this customer</asp:LinkButton>  
                                                                <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected customers?')"
                                                                runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" />Delete selected customers</asp:LinkButton>  
                                                                                        <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" />Refresh customer list</asp:LinkButton>
                                                                                    </div>  
                                                            </CommandItemTemplate
                     
                                                             <Columns>
                                                            <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                                                                <ItemTemplate>
                                                                    <asp:CheckBox id="CheckBox1" runat="server"> </asp:CheckBox>
                                                                </ItemTemplate>
                                                            </telerik:GridTemplateColumn>                                                                   
                                                            <telerik:GridDateTimeColumn EditFormColumnIndex="0" ItemStyle-HorizontalAlign="Left" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" SortExpression="Date" HeaderText="Date" PickerType="DatePicker" HeaderButtonType="TextButton" DataField="Date" UniqueName="Date" DataFormatString="{0:MM/dd/yyyy}"/>
                                                            <telerik:GridDateTimeColumn   EditFormColumnIndex="0" ItemStyle-HorizontalAlign="Left" SortExpression="Date" HeaderText="Time" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderButtonType="TextButton" DataField="Date" UniqueName="Time" DataFormatString="{0:HH:mm tt}"/>
                                                            <telerik:GridBoundColumn EditFormColumnIndex="0" ItemStyle-HorizontalAlign="Left" SortExpression="Duration" HeaderText="Duration" HeaderButtonType="TextButton" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" DataField="Duration" UniqueName="Duration"/>
                                                            <telerik:GridBoundColumn EditFormColumnIndex="0" ItemStyle-HorizontalAlign="Left" SortExpression="Initials" HeaderText="Created By" HeaderButtonType="TextButton" DataField="Initials" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="Initials"/>
                                                            <telerik:GridBoundColumn EditFormColumnIndex="1" ItemStyle-HorizontalAlign="Left" SortExpression="Description" HeaderText="Issue Type" HeaderButtonType="TextButton" DataField="Description" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="Description"/>
                                                            <telerik:GridBoundColumn EditFormColumnIndex="1" ItemStyle-HorizontalAlign="Left" SortExpression="LogStatus" HeaderText="Status" HeaderButtonType="TextButton" DataField="LogStatus" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="LogStatus"/>
                                                            <telerik:GridBoundColumn EditFormColumnIndex="1" ItemStyle-HorizontalAlign="Left" SortExpression="name" HeaderText="Customer Contact" HeaderButtonType="TextButton" DataField="name" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="name"/>
                                                            <telerik:GridBoundColumn EditFormColumnIndex="1" ItemStyle-HorizontalAlign="Left" SortExpression="phone" HeaderText="Call back #" HeaderButtonType="TextButton" DataField="phone" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="phone"/>
                                                            <telerik:GridBoundColumn EditFormColumnIndex="2" ItemStyle-HorizontalAlign="Left" ColumnEditorID="GridTextBoxColumnEditor2" SortExpression="problem" HeaderText="Purpose" HeaderButtonType="TextButton" DataField="problem" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="problem"/>
                                                            <telerik:GridBoundColumn EditFormColumnIndex="2" ItemStyle-HorizontalAlign="Left" ColumnEditorID="GridTextBoxColumnEditor2"  SortExpression="solution" HeaderText="Result" HeaderButtonType="TextButton" DataField="solution" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" UniqueName="resolution"/>
                                                            
                                                        </Columns>
                                                       
                                                       
                                                                         <EditFormSettings UserControlName="~/UserControls/Support.ascx" EditFormType="WebUserControl">
                                                                            <EditColumn UniqueName="EditCommandColumn1">              
                                                                            </EditColumn>
                                                                        </EditFormSettings>
                                                                         
                                        </MasterTableView>
                                         
                                             <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                                                    <Selecting AllowRowSelect="True"></Selecting>
                                                    <Resizing AllowRowResize="False" ResizeGridOnColumnResize="False"></Resizing>
                                                    <ClientEvents OnRowDblClick="RowDblClick" OnColumnClick="ColumnClick" />
                                                </ClientSettings>
                                                <GroupingSettings ShowUnGroupButton="true" />      
                                     </telerik:RadGrid
                                      
                                                <telerik:GridTextBoxColumnEditor TextBoxMode="MultiLine" TextBoxStyle-Width="300px" TextBoxStyle-height="100px" ID="GridTextBoxColumnEditor2" runat="server">
                                                    <TextBoxStyle  BackColor="#edffc3" />
                                                </telerik:GridTextBoxColumnEditor>
                                                 
                                     <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>"
                                                        ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM vw_SupportLogs Where sid = @ScannerId
                                                        Order BY [Date] Desc"
                                                        runat="server">
                                                        <SelectParameters>
                                                            <asp:ControlParameter ControlID="Label1" PropertyName="Text" Type="String" Name="ScannerId" />
                                                        </SelectParameters>
                                      </asp:SqlDataSource
                                      
                                     </telerik:RadPageView>
 
                                       <telerik:RadPageView runat="server" ID="RadPageView2">
                                                                    
                                        </telerik:RadPageView>
                                         
                                       <telerik:RadPageView runat="server" ID="RadPageView3">
                                         
                                        </telerik:RadPageView>
 
                                       <telerik:RadPageView runat="server" ID="RadPageView4">
                                         
                                        </telerik:RadPageView>
                                         
                                       <telerik:RadPageView runat="server" ID="RadPageView5">
                                                    <asp:Label ID="Label2" Font-Bold="true" Font-Italic="true" Text='<%# Eval("sid") %>' Visible="false" runat="server" />
                                          
                                                 <telerik:RadGrid Skin='<%# RadComboBox1.selectedItem.text %>'  runat="server" ID="RadPageViewGrid5" DataSourceID="SqlDataSource3" ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false">
                                                 <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                                                                    DataKeyNames="recid" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top">
                                                                    
                                                                   <CommandItemSettings ShowAddNewRecordButton="false" />
                                                                    <CommandItemTemplate>
                                                                          <div style="padding: 5px 5px;">
                                                                                                <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# MasterGrid.EditIndexes.Count = 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" />Edit selected</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# MasterGrid.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.gif" />Update</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# MasterGrid.EditIndexes.Count > 0 Or MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.gif" />Cancel editing</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# Not MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />Add new</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" />Add this customer</asp:LinkButton>  
                                                                        <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected customers?')"
                                                                        runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" />Delete selected customers</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" />Refresh customer list</asp:LinkButton>
                                                                                            </div>  
                                                                    </CommandItemTemplate
                     
                                                                    <Columns>
                                                                        <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox id="CheckBox1" runat="server"> </asp:CheckBox>
                                                                            </ItemTemplate>
                                                                        </telerik:GridTemplateColumn>                                                                    
                                                                        <telerik:GridDateTimeColumn EditFormColumnIndex="1" ItemStyle-HorizontalAlign="Left" SortExpression="Date" HeaderText="Date" PickerType="DatePicker" HeaderButtonType="TextButton" DataField="Date" UniqueName="Date" DataFormatString="{0:MM/dd/yyyy}"/>
                                                                        <telerik:GridDateTimeColumn   EditFormColumnIndex="1" ItemStyle-HorizontalAlign="Left" SortExpression="Date" HeaderText="Time" HeaderButtonType="TextButton" DataField="Date" UniqueName="Time" DataFormatString="{0:HH:mm tt}"/>
                                                                        <telerik:GridBoundColumn EditFormColumnIndex="1" ItemStyle-HorizontalAlign="Left" SortExpression="LoggedBy" HeaderText="Logged By" HeaderButtonType="TextButton" DataField="LoggedBy" UniqueName="LoggedBy"/>
                                                                        <telerik:GridBoundColumn EditFormColumnIndex="0" ItemStyle-HorizontalAlign="Left" SortExpression="TypeOfNote" HeaderText="Type Of Note" HeaderButtonType="TextButton" DataField="TypeOfNote" UniqueName="TypeOfNote"/>
                                                                        <telerik:GridBoundColumn ColumnEditorID="TextEditor1"  EditFormColumnIndex="0" ItemStyle-HorizontalAlign="Left" SortExpression="Notes" HeaderText="Notes" HeaderButtonType="TextButton" DataField="Notes" UniqueName="Notes"/>
                                                                    </Columns>
                                                                   
                                                                         <EditFormSettings UserControlName="~/UserControls/Notes.ascx" EditFormType="WebUserControl">
                                                                            <EditColumn UniqueName="EditCommandColumn1">              
                                                                            </EditColumn>
                                                                        </EditFormSettings>
                             
                                                    </MasterTableView>
                                                     
                                                                <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                                                                        <Selecting AllowRowSelect="True"></Selecting>
                                                                        <ClientEvents OnRowDblClick="RowDblClick" />
                                                                    </ClientSettings>
                                                 </telerik:RadGrid
                                                  
                                                 
                                                                <telerik:GridTextBoxColumnEditor TextBoxMode="MultiLine" TextBoxStyle-Width="300px" TextBoxStyle-height="100px" ID="TextEditor1" runat="server">
                                                                <TextBoxStyle  BackColor="#edffc3" />
                                                            </telerik:GridTextBoxColumnEditor>
                         
                                                 <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>"
                                                                    ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Notes Where sid = @ScannerID
                                                                    Order BY [Date] Desc"
                                                                    runat="server">
                                                                    <SelectParameters>
                                                                        <asp:ControlParameter ControlID="Label2" PropertyName="Text" Type="String" Name="ScannerID" />
                                                                    </SelectParameters>
                                                  </asp:SqlDataSource>   
                                        </telerik:RadPageView>
 
                                       <telerik:RadPageView runat="server" ID="RadPageView6">
                                         
                                        </telerik:RadPageView>
                                         
                                       <telerik:RadPageView runat="server" ID="RadPageView7">
 
                                                   <asp:Label ID="Label3" Font-Bold="true" Font-Italic="true" Text='<%# Eval("sid") %>' Visible="False" runat="server" />
                                          
                                                 <telerik:RadGrid Skin='<%# RadComboBox1.selectedItem.text %>' runat="server" ID="RadPageViewGrid7" DataSourceID="SqlDataSource4" ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false">
                                                  
                                    
                                                 <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                                                                    DataKeyNames="id" HierarchyLoadMode="ServerOnDemand" CommandItemDisplay="Top">
                                                                    
                                                                    <CommandItemSettings ShowAddNewRecordButton="false" />
                                                                    <CommandItemTemplate>
                                                                          <div style="padding: 5px 5px;">
                                                                                                <asp:LinkButton ID="btnEditSelected" runat="server" CommandName="EditSelected" Visible='<%# MasterGrid.EditIndexes.Count = 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Edit.gif" />Edit selected</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="btnUpdateEdited" runat="server" CommandName="UpdateEdited" Visible='<%# MasterGrid.EditIndexes.Count > 0 %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Update.gif" />Update</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="btnCancel" runat="server" CommandName="CancelAll" Visible='<%# MasterGrid.EditIndexes.Count > 0 Or MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Cancel.gif" />Cancel editing</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="LinkButton2" runat="server" CommandName="InitInsert" Visible='<%# Not MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/AddRecord.gif" />Add new</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="LinkButton3" runat="server" CommandName="PerformInsert" Visible='<%# MasterGrid.MasterTableView.IsItemInserted %>'><img style="border:0px;vertical-align:middle;" alt="" src="Images/Insert.gif" />Add this customer</asp:LinkButton>  
                                                                        <asp:LinkButton ID="LinkButton1" OnClientClick="javascript:return confirm('Delete all selected customers?')"
                                                                        runat="server" CommandName="DeleteSelected"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Delete.gif" />Delete selected customers</asp:LinkButton>  
                                                                                                <asp:LinkButton ID="LinkButton4" runat="server" CommandName="RebindGrid"><img style="border:0px;vertical-align:middle;" alt="" src="Images/Refresh.gif" />Refresh customer list</asp:LinkButton>
                                                                                            </div>  
                                                                    </CommandItemTemplate
                                                                     
                                                                    <Columns>
                                                                        <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                                                                            <ItemTemplate>
                                                                                <asp:CheckBox id="CheckBox1" runat="server"> </asp:CheckBox>
                                                                            </ItemTemplate>
                                                                        </telerik:GridTemplateColumn>                                                                   
                                                                        <telerik:GridBoundColumn  ItemStyle-HorizontalAlign="Left" SortExpression="ContactProfileName" HeaderText="Contact Profile" HeaderButtonType="TextButton" DataField="ContactProfileName" UniqueName="ContactProfileName"/>
                                                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Left" SortExpression="EntityName" HeaderText="Entity Name" HeaderButtonType="TextButton" DataField="EntityName" UniqueName="EntityName"/>
                                                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Left" SortExpression="FullName" HeaderText="Full Name" HeaderButtonType="TextButton" DataField="FullName" UniqueName="FullName"/>
                                                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Left" SortExpression="Phone" HeaderText="Phone" HeaderButtonType="TextButton" DataField="Phone" UniqueName="Phone"/>
                                                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Left" SortExpression="Mobile" HeaderText="Mobile" HeaderButtonType="TextButton" DataField="Mobile" UniqueName="Mobile"/>
                                                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Left" SortExpression="Email" HeaderText="Email" HeaderButtonType="TextButton" DataField="Email" UniqueName="Email"/>
                                                                    </Columns>
                                                                   
                                                                    
                                                                         <EditFormSettings UserControlName="~/UserControls/Contact.ascx" EditFormType="WebUserControl">
                                                                            <EditColumn UniqueName="EditCommandColumn1">              
                                                                            </EditColumn>
                                                                        </EditFormSettings>
                            
                                                    </MasterTableView>
                                                     
                                                                <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                                                                        <Selecting AllowRowSelect="True"></Selecting>
                                                                        <ClientEvents OnRowDblClick="RowDblClick" />
                                                                    </ClientSettings>
                                                 </telerik:RadGrid
                                                  
                                                 
                                                                <telerik:GridTextBoxColumnEditor TextBoxMode="MultiLine" TextBoxStyle-Width="300px" TextBoxStyle-height="100px" ID="GridTextBoxColumnEditor1" runat="server">
                                                                <TextBoxStyle  BackColor="#edffc3" />
                                                            </telerik:GridTextBoxColumnEditor>
                         
                                                 <asp:SqlDataSource ID="SqlDataSource4" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>"
                                                                    ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM vw_Contacts Where sid = @ScannerID Order By CreateDate Desc"
                                                                    runat="server">
                                                                    <SelectParameters>
                                                                        <asp:ControlParameter ControlID="Label3" PropertyName="Text" Type="String" Name="ScannerID" />
                                                                    </SelectParameters>
                                                  </asp:SqlDataSource>
 
                                                 <asp:SqlDataSource ID="SqlDataSource5" ConnectionString="<%$ ConnectionStrings:CMSConnectionString %>"
                                                                    ProviderName="System.Data.SqlClient" SelectCommand="SELECT [ContactProfileId],[ContactProfileName] FROM [ContactProfileMaster]"
                                                                    runat="server">
                                                  </asp:SqlDataSource>
                                                                                                                        
                                        </telerik:RadPageView>
                             
                           <telerik:RadPageView runat="server" ID="RadPageView8">
                             
                            </telerik:RadPageView>
                             
                           <telerik:RadPageView runat="server" ID="RadPageView9">
                             
                            </telerik:RadPageView
                                                                  
                              </telerik:RadMultiPage>
                            </asp:Panel>
                    </fieldset>
                    </NestedViewTemplate>
                                                
                   <Columns>
                        
                       <telerik:GridEditCommandColumn UniqueName="EditCommandColumn">
                       </telerik:GridEditCommandColumn>
                     
                        <telerik:GridBoundColumn EditFormColumnIndex="0" Aggregate="Count" FooterText="Total Records: " SortExpression="Agency" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" HeaderText="Agency" HeaderButtonType="TextButton"
                            DataField="Agency">
                        </telerik:GridBoundColumn>
 
                        <telerik:GridBoundColumn EditFormColumnIndex="0" SortExpression="blsid" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" HeaderText="BLSID"
                         HeaderButtonType="TextButton"
                            DataField="blsid">
                        </telerik:GridBoundColumn>
 
                        <telerik:GridBoundColumn EditFormColumnIndex="0" SortExpression="scannerid" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" HeaderText="LSID" HeaderButtonType="TextButton"
                            DataField="scannerid">
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn EditFormColumnIndex="0" SortExpression="groupnum" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" HeaderText="Group" HeaderButtonType="TextButton"
                            DataField="groupnum">
                        </telerik:GridBoundColumn>
                                  
                        <telerik:GridBoundColumn EditFormColumnIndex="0" SortExpression="maintenance" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" HeaderText="Support Type" HeaderButtonType="TextButton"
                            DataField="maintenance">
                        </telerik:GridBoundColumn
                                
                        <telerik:GridDateTimeColumn EditFormColumnIndex="0" FilterControlWidth="120px" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" DataField="maintExp" HeaderText="Support Exp Date"
                            SortExpression="maintExp" UniqueName="maintExp" PickerType="DatePicker"
                            DataFormatString="{0:MM/dd/yyyy}">
                            <HeaderStyle Width="160px" />
                        </telerik:GridDateTimeColumn>
                         
                        <telerik:GridBoundColumn EditFormColumnIndex="1" SortExpression="Description" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" HeaderText="Scanner Model" HeaderButtonType="TextButton"
                            DataField="Description">
                        </telerik:GridBoundColumn>                                 
 
                        <telerik:GridBoundColumn EditFormColumnIndex="1" SortExpression="buildver" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" HeaderText="SW Version" HeaderButtonType="TextButton"
                            DataField="buildver">
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn EditFormColumnIndex="1" SortExpression="ReleaseDate" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="True" HeaderText="Rel Date" HeaderButtonType="TextButton"
                            DataField="ReleaseDate">
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn EditFormColumnIndex="2" SortExpression="Make" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderText="PC" HeaderButtonType="TextButton"
                            DataField="Make">
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn EditFormColumnIndex="2" SortExpression="ostype" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false" HeaderText="OS" HeaderButtonType="TextButton"
                            DataField="ostype">
                        </telerik:GridBoundColumn>  
                </Columns>
                 
                 
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="19px" />
                    </ExpandCollapseColumn>
                     
                  <EditFormSettings EditFormType="Template">
                             <FormTemplate>
                                <table style="width:100%;">
                                    <tr>
                                        <td width="20%" align="right">
                                            Contact Profile: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox1" Text='<%# Bind("Agency") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Phone: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox7" Text='<%# Bind("scannerid") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Address 1: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox10"  Text='<%# Bind("groupnum") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            Contact Profile: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox2" Text='<%# Bind("Agency") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Phone: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox17" Text='<%# Bind("scannerid") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Address 1: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox18"  Text='<%# Bind("groupnum") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            Contact Profile: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox19" Text='<%# Bind("Agency") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Phone: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox20" Text='<%# Bind("scannerid") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Address 1: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox21"  Text='<%# Bind("groupnum") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            Contact Profile: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox22" Text='<%# Bind("Agency") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Phone: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox23" Text='<%# Bind("scannerid") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Address 1: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox24"  Text='<%# Bind("groupnum") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            Contact Profile: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox25" Text='<%# Bind("Agency") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Phone: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox26" Text='<%# Bind("scannerid") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Address 1: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox27"  Text='<%# Bind("groupnum") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td width="20%" align="right">
                                            Contact Profile: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox28" Text='<%# Bind("Agency") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Phone: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox29" Text='<%# Bind("scannerid") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                        <td width="20%" align="right">
                                            Address 1: </td>
                                        <td width="20%" align="left">
                                            <telerik:RadTextBox ID="RadTextBox30"  Text='<%# Bind("groupnum") %>' Runat="server" Width="300px"></telerik:RadTextBox>
                                        </td>
                                    </tr>                                                                                                                                                                                   
                                </table>
                             </FormTemplate>
                  </EditFormSettings>
            </MasterTableView>
             
            <ClientSettings ReorderColumnsOnClient="True" AllowDragToGroup="True" AllowColumnsReorder="True">
                <Selecting AllowRowSelect="True"></Selecting>
                <Resizing AllowRowResize="False" ResizeGridOnColumnResize="False"></Resizing>
                <ClientEvents OnRowDblClick="RowDblClick" />
            </ClientSettings>           
            <GroupingSettings ShowUnGroupButton="true" />
        </telerik:RadGrid>




Iana Tsolova
Telerik team
 answered on 03 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?