Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
75 views

I want to use Accordion jquery for collapsing and expending nodes (when click on one parent node then other parent node should be Collapse).i am struggling for the same.

any suggestion ??

Thanks in advance.

 

JYOTI SHANKAR
Top achievements
Rank 1
 asked on 01 Jun 2016
1 answer
118 views

This was working just fine until I decided to move the accordion onto the main page instead of having it on the user control.

The GridEditCommandColumn is not firing any events, even the NeedDataSource event.

The grid appears in a ModalPopUp, which worked fine until I moved the accordion to the main page.

I forced the PopUp to stay visible to check the grid and it is not re-binding, and not hitting any events when the GridEditCommandColumn is clicked.

Here is the main aspx page:

<%@ Register src="../../Common/Controls/SiteAdmin/ServiceType/ucServiceTypes.ascx" tagname="ucServiceTypes" tagprefix="uc1" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <ajax:Accordion ID="Accordion1" runat="server" HeaderCssClass="accordionHeader" HeaderSelectedCssClass="accordionHeaderSelected"
                ContentCssClass="accordionContent" SelectedIndex="-1" FadeTransitions="true"
                SuppressHeaderPostbacks="true" TransitionDuration="250" FramesPerSecond="40"
                RequireOpenedPane="false" AutoSize="None" Width="100%">
            </ajax:Accordion>
        </ContentTemplate>       
    </asp:UpdatePanel>
</asp:Content>

 

The the code behind for the main aspx page:

protected void Page_Load(object sender, System.EventArgs e)
{         
    LoadUserControls();
}
 
private void LoadUserControls()
{  
    string path = "~/Common/Controls/SiteAdmin/ServiceType/ucServiceTypes.ascx";
    Common_Controls_SiteAdmin_ServiceType_ucServiceTypes uc;
    DataTable dt = GetServiceTypes();
    for (int i = 0; i < dt.Rows.Count; i++)
    {
        uc = LoadControl(path) as Common_Controls_SiteAdmin_ServiceType_ucServiceTypes;
        uc.ID = "uc" + dt.Rows[i]["Name"].ToString();
        uc.ServiceTypeID.Value = dt.Rows[i]["ServiceTypeID"].ToString();
        Literal lit = new Literal();
        AccordionPane pane = new AccordionPane();
        pane.ID = "pane" + i.ToString();
        lit = new Literal();
        lit.Text = dt.Rows[i]["Name"].ToString();
        pane.HeaderContainer.Controls.Add(lit);
        pane.ContentContainer.Controls.Add(uc);
        Accordion1.Panes.Add(pane);
    }
}

 

Now for the user control:

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucServiceTypes.ascx.cs" Inherits="Common_Controls_SiteAdmin_ServiceType_ucServiceTypes" %>
<asp:HiddenField ID="hdnServiceTypeID" runat="server" />
<asp:HiddenField ID="hdnServiceDefID" runat="server" />
 
<asp:Panel ID="pnlView" runat="server" Style="display: none;" CssClass="modalPopUpPanel">
    <div style="height: 500px; overflow: auto;">
        <asp:HiddenField ID="hdnViewPopUp" runat="server" />
        <h3 style="text-align: center;" id="header">
            <asp:Label ID="lblServiceDefName" runat="server"></asp:Label></h3>    
        <table style="width: 100%">
            <tr>
                <td style="text-align: left">
    <telerik:RadGrid ID="rgServiceOptionDefs" runat="server" AutoGenerateColumns="False"
        ResolvedRenderMode="Classic" AllowAutomaticUpdates="false" AllowAutomaticInserts="false"
        OnItemCommand="rgServiceOptionDefs_ItemCommand" OnItemCreated="rgServiceOptionDefs_ItemCreated"
        OnNeedDataSource="rgServiceOptionDefs_NeedDataSource" OnItemDataBound="rgServiceOptionDefs_ItemDataBound"
        OnEditCommand="rgServiceOptionDefs_EditCommand" OnPreRender="rgServiceOptionDefs_PreRender"
        OnUpdateCommand="rgServiceOptionDefs_UpdateCommand">
        <MasterTableView DataKeyNames="ServiceOptionDefID" EditMode="InPlace" CommandItemDisplay="Top">
            <Columns>
                <telerik:GridEditCommandColumn />
                <telerik:GridTemplateColumn HeaderText="Name" UniqueName="Name">
                    <ItemTemplate>
                        <asp:Label ID="lblName" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.Name")%>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="txtName" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.Name")%>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemStyle VerticalAlign="Top" HorizontalAlign="Center" />
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Type" UniqueName="Type">
                    <ItemTemplate>
                        <asp:Label ID="lblType" runat="server" Text='<%#DataBinder.Eval(Container, "DataItem.InputType")%>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <telerik:RadListBox ID="ddlType" runat="server"></telerik:RadListBox>
                    </EditItemTemplate>
                    <ItemStyle VerticalAlign="Top" HorizontalAlign="Center" />
                </telerik:GridTemplateColumn>
               
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
                </td>
            </tr>
        </table>
        <p style="text-align: center;">
            <asp:Button ID="btnCloseView" CssClass="Button" runat="server" Text="Close" CausesValidation="false" />
        </p>
    </div>
</asp:Panel>
<ajax:ModalPopupExtender ID="mpeView" runat="server" TargetControlID="hdnViewPopUp" PopupControlID="pnlView"
    CancelControlID="btnCloseView" BackgroundCssClass="backgroundColor" DropShadow="true"
    PopupDragHandleControlID="header">
</ajax:ModalPopupExtender>

   
 

 

And 

protected void rgServiceOptionDefs_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
    if (!string.IsNullOrEmpty(hdnServiceDefID.Value))
    {
        int ServiceDefID = int.Parse(hdnServiceDefID.Value);
        DataTable dt = GetServiceOptionDefs(ServiceDefID);
 
        rgServiceOptionDefs.DataSource = dt;
        mpeView.Show();
    }
}
 
protected void rgServiceOptionDefs_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem editedItem = e.Item as GridEditableItem;
        mpeView.Show();
    }
    else if (e.Item is GridDataItem)
    {
        GridDataItem dataItem = e.Item as GridDataItem;
        mpeView.Show();
    }
}
 
protected void rgServiceOptionDefs_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem && !e.Item.IsInEditMode)
    {
        
    }
    else if ((e.Item is GridDataItem || e.Item is GridEditableItem) && e.Item.IsInEditMode)
    {         
 
        //mpeView.Show();
    }
 
    if (e.Item is GridEditFormInsertItem || e.Item is GridDataInsertItem)
    {
        // insert item
    }
}
 
protected void rgServiceOptionDefs_ItemCommand(object sender, GridCommandEventArgs e)
{
    mpeView.Show();
 
}
 
protected void rgServiceOptionDefs_UpdateCommand(object sender, GridCommandEventArgs e)
{
    GridEditableItem item = e.Item as GridEditableItem;
    mpeView.Show();
}
 
protected void rgServiceOptionDefs_EditCommand(object sender, GridCommandEventArgs e)
{
    mpeView.Show();
}
 
protected void rgServiceOptionDefs_PreRender(object sender, EventArgs e)
{
    //if (!string.IsNullOrEmpty(hdnServiceDefID.Value))
    //    mpeView.Show();
}

 

If anyone needs more information, I will provide it.

But I am at an end here trying to find out why this is happening.

And as can be seen, I've tried a few events.

Thanks.

Viktor Tachev
Telerik team
 answered on 01 Jun 2016
1 answer
134 views
I have Added

      ExpandCollapseColumn-CollapseImageUrl="../Images/1450530178_expand2.png"
      ExpandCollapseColumn-ExpandImageUrl="../Images/1450530168_next.png">

for Expand and Collapse button image

it's working for Parent Grid,but not showing for Nested grid

css code and Aspx code as below ...

 
Css Code 
        .rgExpand {
            background: url('../Images/1450530168_next.png') center center no-repeat !important;
        }

        .rgCollapse {
            background: url('../Images/1450530178_expand2.png') center center no-repeat !important;
        }

  

Aspx code
<telerik:RadGrid RenderMode="Lightweight" ID="radRequestStatus" runat="server" ShowStatusBar="true" MasterTableView-AllowPaging="true" AutoGenerateColumns="False"<br>                                PageSize="10" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="false"<br>                                OnDetailTableDataBind="radRequestStatus_DetailTableDataBind" OnNeedDataSource="radRequestStatus_NeedDataSource" OnItemDataBound="radRequestStatus_ItemDataBound"<br>                                OnPreRender="radRequestStatus_PreRender" OnPageIndexChanged="radRequestStatus_PageIndexChanged"><br>                                <PagerStyle Mode="NumericPages"></PagerStyle><br>                                <MasterTableView DataKeyNames="Request_Number" ExpandCollapseColumn-ButtonType="ImageButton"<br>                                    ExpandCollapseColumn-CollapseImageUrl="../Images/1450530178_expand2.png"<br>                                    ExpandCollapseColumn-ExpandImageUrl="../Images/1450530168_next.png"><br>                                    <DetailTables><br>                                        <telerik:GridTableView DataKeyNames="Br_Issu_Surr_Key" Name="Batches" Width="100%"><br>                                            <HeaderStyle CssClass="InnerHeaderStyle" /><br>                                            <ItemStyle CssClass="InnerItemStyle" /><br>                                            <AlternatingItemStyle CssClass="InnerAlernatingItemStyle" /><br>                                            <ExpandCollapseColumn ButtonType="ImageButton"></ExpandCollapseColumn><br>                                            <DetailTables><br>                                                <telerik:GridTableView DataKeyNames="Name" Name="Templetes" Width="100%"><br>                                                    <HeaderStyle CssClass="InnerHeaderStyle" /><br>                                                    <Columns><br>                                                        <telerik:GridTemplateColumn><br>                                                            <ItemTemplate><br>                                                                <%# Container.DataSetIndex+1 %><br>                                                            </ItemTemplate><br>                                                        </telerik:GridTemplateColumn><br><br>                                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" HeaderText="Name" DataField="Name"><br>                                                        </telerik:GridBoundColumn><br>                                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" HeaderText="Number" DataField="Number"><br>                                                        </telerik:GridBoundColumn><br>                                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" HeaderText="Type" DataField="Type"><br>                                                        </telerik:GridBoundColumn><br>                                                    </Columns><br>                                                </telerik:GridTableView><br>                                            </DetailTables><br>                                            <Columns><br>                                                <telerik:GridTemplateColumn><br>                                                    <ItemTemplate><br>                                                        <%# Container.DataSetIndex+1 %><br>                                                    </ItemTemplate><br>                                                </telerik:GridTemplateColumn><br>                                                <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" HeaderText="sys" DataField="Sys"><br>                                                </telerik:GridBoundColumn><br>                                                <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" HeaderText="Version" DataField="Version"><br>                                                </telerik:GridBoundColumn><br>                                                <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" UniqueName="Status" HeaderText="Status" DataField="Status"><br>                                                </telerik:GridBoundColumn><br>                                            </Columns><br>                                        </telerik:GridTableView><br>                                    </DetailTables><br>                                    <Columns><br>                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="5%" HeaderText="Req.No." DataField="Number"><br>                                        </telerik:GridBoundColumn><br>                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="C" DataField="C"><br>                                        </telerik:GridBoundColumn><br>                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="15%" HeaderText="L" DataField="L"><br>                                        </telerik:GridBoundColumn><br>                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderText="D" DataField="D"><br>                                        </telerik:GridBoundColumn><br>                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderText="L4" DataField="L4"><br>                                        </telerik:GridBoundColumn><br>                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="10%" HeaderText="L5" DataField="L5"><br>                                        </telerik:GridBoundColumn><br>                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%" HeaderText="L6" DataField="L6"><br>                                        </telerik:GridBoundColumn><br>                                        <telerik:GridBoundColumn ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20%" HeaderText="Client" DataField="Client"><br>                                        </telerik:GridBoundColumn><br>                                    </Columns><br>                                </MasterTableView><br>                            </telerik:RadGrid>
Kostadin
Telerik team
 answered on 01 Jun 2016
1 answer
139 views

Hello.

I would like to get the child tabs below the parent tab and it should open only when the parent is clicked. Now , if any other parent tab is clicked , then earlier one should collapse and this parent tab should get open with its child tabs. I tried using ChildGroupCSSClass but it was not working. Moreover, also I would like to change the color, size of tab strip.

Please let me know how can I place the child tab below the parent one and apply the CSS.....

Ivan Danchev
Telerik team
 answered on 01 Jun 2016
1 answer
137 views

Hi,

I am using Radmenu with ImageSprites enabled to give selection options to users on the site. The problem is that the submenu items are overlapping on each other when used with vertical flow, while it works well with the horizontal flow being selected. I want the menu items (buttons/image sprites) to align vertically on top of each other.

Code for Horizontal Menu Style

 

01.<telerik:RadMenu ID="MenuQ3" runat="server" CssClass="RadMenu_Fixed2016" Flow="Vertical" CollapseDelay="10" EnableImageSprites="True">
02.<Items>
03.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSPrintMenu.png" BorderStyle="None">
04.<Items>
05.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSQuotation.png" Owner="" NavigateUrl="ZLPPrintSummary.aspx?refLPQ3=1">
06.</telerik:RadMenuItem>
07.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSCompatativeStatement.png" Owner="" NavigateUrl="ZLPPrintSummary.aspx?refLPQ3=2">
08.</telerik:RadMenuItem>
09.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSCFASanction.png" Owner="" NavigateUrl="ZLPPrintSummary.aspx?refLPQ3=3">
10.</telerik:RadMenuItem>
11.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSSupplyOrder.png" Owner="" NavigateUrl="ZLPPrintSummary.aspx?refLPQ3=4">
12.</telerik:RadMenuItem>
13.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSGFRCert.png" Owner="" NavigateUrl="ZLPPrintSummary.aspx?refLPQ1=11">
14.</telerik:RadMenuItem>
15.</Items>
16.</telerik:RadMenuItem>
17.</Items>
18.<DefaultGroupSettings ExpandDirection="Left" Flow="Horizontal" RepeatDirection="Horizontal" OffsetX="1" OffsetY="1" />
19.</telerik:RadMenu>

 

 
    Code for Vertical Menu Style (desired, but buttons/menu items are overlapping each other)

01.<telerik:RadMenu runat="server" CollapseDelay="1" EnableAutoScroll="True" EnableImageSprites="True">
02.<Items>
03.<telerik:RadMenuItem runat="server" ImageUrl="~/ImagesSys/swTSSPrintMenu.png">
04.<GroupSettings ExpandDirection="Down" Flow="Vertical" RepeatDirection="Vertical" OffsetX="45" OffsetY="5" />
05.<Items>
06.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSQuotation.png">
07.<GroupSettings OffsetX="45" OffsetY="5" />
08.</telerik:RadMenuItem>
09.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSCRV.png">
10.<GroupSettings OffsetX="45" OffsetY="5" />
11.</telerik:RadMenuItem>
12.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSSupplyOrder.png">
13.</telerik:RadMenuItem>
14.<telerik:RadMenuItem runat="server" EnableImageSprite="True" ImageUrl="~/ImagesSys/swTSSGFRCert.png" Owner="">
15.</telerik:RadMenuItem>
16.</Items>
17.</telerik:RadMenuItem>
18.</Items>
19.</telerik:RadMenu>

CSS

01..RadMenu_Fixed2016
02.      {
03.          position: fixed !important;
04.          height: 28px;
05.          width: 139px; /* link goes at the bottom of the page */
06.          top: 100%;
07.          margin-top: -120px; /*140 = height + preferred bottom margin */ /* link is moved to the right */
08.          right: 0%;
09.          margin-right: 2px; /* = half of width */
10.          cursor: hand !important;
11.      }

Please help me with the code to stop the buttons in the vertical menu from over lapping on each other.

Veselin Tsvetanov
Telerik team
 answered on 01 Jun 2016
7 answers
80 views
I am using the RadSeachBox in the EditItemTemplate to find a value and then I copy this to the label in the ItemTemplate but receive the following error when I navigate between any other cells in the grid:

Microsoft JScript runtime error: 'null' is null or not an object
in dynamic module MicrosoftAjax.js

The code raising the error is unreadable to me.

I have had great difficulty in referencing the label from the client-side javascript onSearch function but using the only reference that I found that gives access to the label's innerHTML which causes the error after the innerHTML has been changed.  Is there a better way of doing this and not raising an error?

I have attached the aspx file below but not the aspx.vb as this is a problem with the client-side javascript.

Any help will be appreciated.

Terry.


<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Timesheet.aspx.vb" Inherits="Timesheet" %>
<%@ 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">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<link rel="Stylesheet" href="App_Themes/Site.css" type="text/css" />
<%-- This displays the logo mini icon next to the web address --%>
<link rel="Shortcut Icon" href="App_Themes/bmtlogo.ico" />
<title>Timesheet</title>
</head>
<body>
<form id="form1" runat="server">
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
</telerik:RadAjaxManager>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function ValidatePostTimesheet(sender, args) {
var grid = $find("<%=RadGrid1.ClientID%>");
//var masterTable = grid.get_masterTableView();
}
function onSearch(sender, args) {
var masterTable = $find("<%= RadGrid1.ClientID %>").get_masterTableView();
var num = masterTable.get_dataItems().length;
if (num >= 1) {
num = num - 1;
// This gets the label control lbl_Project from the ItemTemplate.
var dataItem = masterTable.get_dataItems()[num].get_element();
//This copies the RadSearchBox item text inthe EditItemTemplate to the ItemTemplate label and is the cause of the error.
dataItem.all[num].innerText = args.get_text();
}
}
</script>
</telerik:RadCodeBlock>

<asp:SqlDataSource ID="ds_weeks" runat="server"
ConnectionString="<%$ ConnectionStrings:PandaConnection %>"
SelectCommand="Select_Calendar" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

<!--Select Week dropdown-->
<telerik:RadDropDownList ID="cbo_weeks" runat="server" DataSourceID="ds_weeks" DataTextField="WeekNo" DataValueField="WeekEnding" AutoPostBack="True">
</telerik:RadDropDownList>

<asp:SqlDataSource ID="ds_Timesheet" runat="server"
ConnectionString="<%$ ConnectionStrings:PandaConnection %>"
SelectCommand="Select_Timesheet" SelectCommandType="StoredProcedure"
UpdateCommand="Update_Booking" UpdateCommandType="StoredProcedure"
InsertCommand="Insert_Booking" insertCommandType="StoredProcedure"
DeleteCommand="Delete_Booking" DeleteCommandType="StoredProcedure">

<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="User_Id" SessionField="TimesheetUserID" Type="Int64" />
<asp:SessionParameter DefaultValue="ABC123" Name="staff_timesheet_id" SessionField="StaffTimesheet_Id" Type="String" />
<asp:ControlParameter ControlID="cbo_weeks" DefaultValue="26/07/2013" Name="WBdate" PropertyName="SelectedValue" Type="String" />
</SelectParameters>

<UpdateParameters>
<asp:Parameter Name="f_time_id" DbType="Int32" />
<asp:Parameter Name="f_task_id" DbType="Int32" />
<asp:Parameter Name="f_hrs_monday" DbType="Double" />
<asp:Parameter Name="f_hrs_tuesday" DbType="Double" />
<asp:Parameter Name="f_hrs_wednesday" DbType="Double" />
<asp:Parameter Name="f_hrs_thursday" DbType="Double" />
<asp:Parameter Name="f_hrs_friday" DbType="Double" />
<asp:Parameter Name="f_hrs_saturday" DbType="Double" />
<asp:Parameter Name="f_hrs_sunday" DbType="Double" />
<asp:Parameter Name="f_notes" DbType="String" />
<asp:Parameter Name="f_booking_type_id" DefaultValue="4" DbType="Int32" />
</UpdateParameters>

<InsertParameters>
<asp:Parameter Name="f_task_id" DbType="Int32" />
<asp:Parameter Name="f_user_id" DbType="Int32" />
<asp:Parameter Name="f_staff_name" DbType="String" />
<asp:ControlParameter ControlID="cbo_weeks" DefaultValue="01/01/2000" Name="f_WBdate" PropertyName="SelectedValue" Type="String" />
<asp:Parameter Name="f_hrs_monday" DbType="Double" />
<asp:Parameter Name="f_hrs_tuesday" DbType="Double" />
<asp:Parameter Name="f_hrs_wednesday" DbType="Double" />
<asp:Parameter Name="f_hrs_thursday" DbType="Double" />
<asp:Parameter Name="f_hrs_friday" DbType="Double" />
<asp:Parameter Name="f_hrs_saturday" DbType="Double" />
<asp:Parameter Name="f_hrs_sunday" DbType="Double" />
<asp:Parameter Name="f_notes" DbType="String" />
<asp:Parameter Name="f_booking_type_id" DbType="Int32" />
</InsertParameters>

<DeleteParameters>
<asp:Parameter DefaultValue="0" Name="f_time_id" DbType="Int64" />
<asp:SessionParameter DefaultValue="0" Name="f_user_id" SessionField="UserID" Type="Int64" />
<asp:Parameter DefaultValue="ABC123" Name="f_staff_name" Type="String" />
<asp:ControlParameter ControlID="cbo_weeks" DefaultValue="01/01/2000" Name="f_WBdate" PropertyName="SelectedValue" Type="String" />
</DeleteParameters>

</asp:SqlDataSource>
<asp:SqlDataSource ID="ds_UserProjects" runat="server"
ConnectionString="<%$ ConnectionStrings:PandaConnection %>"
SelectCommand="Select_UserProjects" SelectCommandType="StoredProcedure" EnableCaching="True" CacheDuration="480">
<SelectParameters>
<asp:SessionParameter DefaultValue="0" Name="User_Id" SessionField="UserID" Type="Int64" />
<asp:Parameter Name="Search" DefaultValue="%" Type="String" />
</SelectParameters>
</asp:SqlDataSource>

<asp:SqlDataSource ID="ds_Tasks" runat="server"
ConnectionString="<%$ ConnectionStrings:PandaConnection %>"
SelectCommand="Select_TasksForJob" SelectCommandType="StoredProcedure">

<SelectParameters>
<asp:Parameter Name="f_opportunity_id" defaultValue="46" Type="Int32" />
</SelectParameters>
</asp:SqlDataSource>

<asp:SqlDataSource ID="ds_BookingType" runat="server"
ConnectionString="<%$ ConnectionStrings:PandaConnection %>"
SelectCommand="Select_BookingTypes" SelectCommandType="StoredProcedure">
</asp:SqlDataSource>

<asp:Button ID="cmd_post" runat="server" Text="Post Timesheet" OnClientClick="ValidatePostTimesheet" />
<asp:Label ID="Label1" Width="200px" runat="server" Text=""></asp:Label>

<asp:Button ID="cmd_Approve" runat="server" Text="Approve Timesheet" OnClientClick="ValidatePostTimesheet" Visible="False" />
<asp:Label ID="Label2" runat="server" Text=""></asp:Label>

<asp:Button ID="cmd_Admin" runat="server" Text="Timesheet Admin" OnClientClick="ValidatePostTimesheet" Visible="False" />
<asp:Label ID="Label3" runat="server" Text=""></asp:Label>
<asp:HiddenField ID="hid_ConHours" runat="server" />

<!--Geoff's grid-->
<div>
<telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel2">

<telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" Skin="Metro"
ShowFooter="True" AutoGenerateColumns="False" Width="750px"
DataSourceID="ds_Timesheet" AllowFilteringByColumn="False" CellSpacing="0">

<mastertableview autogeneratecolumns="False" commanditemdisplay="Top" ClientDataKeyNames="f_time_id, f_project_title"
commanditemsettings-showsavechangesbutton="True" datakeynames="f_time_id, f_project_title"
datasourceid="ds_Timesheet" editmode="Batch" horizontalalign="NotSet"
showheaderswhennorecords="true" HierarchyLoadMode="Client">
<commanditemsettings showsavechangesbutton="True" />
<Columns>
<telerik:GridTemplateColumn UniqueName="ProjectNo" HeaderText="Project" DataField="f_project_title" HeaderStyle-Width="315px" >
<ItemTemplate>
<asp:Label ID="lbl_Project" Text='<%# Eval("f_project_title") %>' runat="server" />
</ItemTemplate>
<EditItemTemplate>
<telerik:RadSearchBox runat="server" ID="RadSearchBox1" ShowSearchButton="False"
DataSourceID="ds_UserProjects"
DataValueField="f_opportunity_id"
DataTextField="f_project_title"
Width="250px" Culture="en-GB" OnClientSearch="onSearch">
<DropDownSettings Width="250px">
</DropDownSettings>
</telerik:RadSearchBox>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridDropDownColumn DataField="f_task_id" DataSourceID="ds_tasks"
FooterStyle-Wrap="False" HeaderStyle-Width="165px" HeaderStyle-Wrap="False"
HeaderText="Task" ItemStyle-Width="160px" ItemStyle-Wrap="False"
ListTextField="f_task_no" ListValueField="f_task_id" UniqueName="cbo_OpCode">
<FooterStyle Wrap="False" />
<HeaderStyle Width="170px" Wrap="False" />
</telerik:GridDropDownColumn>
<telerik:GridNumericColumn ColumnEditorID="NumberEditorBox"
DataField="f_hrs_saturday" HeaderStyle-Width="40px" HeaderText="Sat"
SortExpression="f_hrs_saturday" UniqueName="f_hrs_saturday">
<HeaderStyle Width="40px" />
</telerik:GridNumericColumn>
<telerik:GridNumericColumn ColumnEditorID="NumberEditorBox"
DataField="f_hrs_sunday" HeaderStyle-Width="40px" HeaderText="Sun"
SortExpression="f_hrs_sunday" UniqueName="f_hrs_sunday">
<HeaderStyle Width="40px" />
<ColumnValidationSettings>
</ColumnValidationSettings>
</telerik:GridNumericColumn>
<telerik:GridNumericColumn ColumnEditorID="NumberEditorBox"
DataField="f_hrs_monday" HeaderStyle-Width="40px" HeaderText="Mon"
SortExpression="f_hrs_monday" UniqueName="f_hrs_monday">
<HeaderStyle Width="40px" />
</telerik:GridNumericColumn>
<telerik:GridNumericColumn ColumnEditorID="NumberEditorBox"
DataField="f_hrs_tuesday" HeaderStyle-Width="40px" HeaderText="Tue"
SortExpression="f_hrs_tuesday" UniqueName="f_hrs_tuesday">
<HeaderStyle Width="40px" />
</telerik:GridNumericColumn>
<telerik:GridNumericColumn ColumnEditorID="NumberEditorBox"
DataField="f_hrs_wednesday" HeaderStyle-Width="40px" HeaderText="Wed"
SortExpression="f_hrs_wednesday" UniqueName="f_hrs_wednesday">
<HeaderStyle Width="40px" />
</telerik:GridNumericColumn>
<telerik:GridNumericColumn ColumnEditorID="NumberEditorBox"
DataField="f_hrs_thursday" HeaderStyle-Width="40px" HeaderText="Thu"
SortExpression="f_hrs_thursday" UniqueName="f_hrs_thursday">
<HeaderStyle Width="40px" />
</telerik:GridNumericColumn>
<telerik:GridNumericColumn ColumnEditorID="NumberEditorBox"
DataField="f_hrs_friday" HeaderStyle-Width="40px" HeaderText="Fri"
SortExpression="f_hrs_friday" UniqueName="f_hrs_friday">
<HeaderStyle Width="40px" />
</telerik:GridNumericColumn>
<telerik:GridCalculatedColumn DataFields="f_hrs_saturday, f_hrs_sunday, f_hrs_monday, f_hrs_tuesday, f_hrs_wednesday, f_hrs_thursday, f_hrs_friday"
DataType="System.Int16" expression="{0}+{1}+{2}+{3}+{4}+{5}+{6}"
HeaderStyle-Width="45px" HeaderText="Total Hours" UniqueName="f_total_hours">
<HeaderStyle Width="45px" />
</telerik:GridCalculatedColumn>
<telerik:GridBoundColumn ColumnEditorID="CommentsEditorBox" DataField="f_notes"
FooterStyle-Width="210px" HeaderStyle-Width="210px" HeaderText="Comments"
ItemStyle-Width="210px" MaxLength="255" SortExpression="f_notes"
UniqueName="f_notes">
</telerik:GridBoundColumn>
<telerik:GridDropDownColumn AllowSorting="False"
DataField="f_time_booking_type_id" DataSourceID="ds_BookingType"
FooterStyle-Wrap="False" HeaderStyle-Width="165px" HeaderStyle-Wrap="False"
HeaderText="Booking Type" ItemStyle-Width="160px" ItemStyle-Wrap="False"
ListTextField="f_time_booking_type_name"
ListValueField="f_time_booking_type_id" UniqueName="cbo_BookingType">
<FooterStyle Wrap="False" />
<HeaderStyle Width="165px" Wrap="False" />
<ItemStyle Width="160px" Wrap="False" />
</telerik:GridDropDownColumn>
<telerik:GridButtonColumn ButtonType="ImageButton" Exportable="False"
CommandName="Delete" ConfirmDialogType="RadWindow" ConfirmText="Delete this row?"
ConfirmTitle="Delete" HeaderStyle-Width="50px" HeaderText="Delete"
Text="Delete" UniqueName="DeleteColumn">
<HeaderStyle Width="50px" />
</telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="f_task_id" DataType="System.Int64"
Display="False" Exportable="False"
FilterControlAltText="Filter f_task_id column" HeaderText="f_task_id"
ReadOnly="True" SortExpression="f_task_id" UniqueName="f_task_id"
Visible="false">
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="StatusName" DataType="System.String" Display="True" Exportable="True" HeaderText="StatusName" UniqueName="StatusName" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="f_project_no" DataType="System.String" Display="False" Exportable="True" HeaderText="Project No" UniqueName="f_project_no" >
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="f_staff_name" DataType="System.String" Display="False" Exportable="True" HeaderText="Staff Name" UniqueName="f_staff_name" >
</telerik:GridBoundColumn>
</Columns>
<sortexpressions>
<telerik:GridSortExpression FieldName="f_time_id" SortOrder="Descending" />
</sortexpressions>
</mastertableview>
<ClientSettings AllowKeyboardNavigation="true">
<Selecting CellSelectionMode="SingleCell"></Selecting>
</ClientSettings>
</telerik:RadGrid>

<telerik:GridNumericColumnEditor ID="NumberEditorBox" NumericTextBox-Width="30px" runat="server">
</telerik:GridNumericColumnEditor>

<telerik:GridTextBoxColumnEditor ID="CommentsEditorBox" runat="server">
<TextBoxStyle Width="200px" />
</telerik:GridTextBoxColumnEditor>

</telerik:RadAjaxPanel>
</div>
</form>
</body>

</html>
Angel Petrov
Telerik team
 answered on 01 Jun 2016
8 answers
2.2K+ views
I imagine someone else must have run into this problem in the past.  I have a radGrid that has a phone number column.  Sometimes the phone numbers are long - 12 digits with no dashes or spaces.  Exporting the grid to excel converts the number to scientific notation which obviously isn't going to work.

I've tried a couple things - setting the DataFormatString and DataType on the GridBoundColumn.

Is there a good way around this?  Changing the format of the phone numbers is not an option.

Thanks,
DJ
Daniel
Telerik team
 answered on 31 May 2016
0 answers
103 views

Hi Telerik

I Use IIS 8 and i want to enable RadCompression  in my application .

in App_Browsers

<browsers>
  <browser refID="Default">
    <controlAdapters>
      <adapter controlType="System.Web.UI.Page" adapterType="Telerik.Web.UI.RadHiddenFieldPageStateCompression" />
      <adapter controlType="System.Web.UI.Page" adapterType="Telerik.Web.UI.RadSessionPageStateCompression" />
    </controlAdapters>
  </browser>
</browsers>

 

in web.config

<system.web
.
.
  
   
    <httpModules>
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression"/>
    </httpModules>
  </system.web>

 

 

How can i  optimize viewstate and  compressing AJAX and Web Service responses  in my application ?

please help me ...

Thanks .

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

حمید
Top achievements
Rank 1
 asked on 31 May 2016
0 answers
193 views

Hi Telerik

I  want to customize ErrorMessage and EmptyMessage for each controls but when set ErrorMessage , that apply for all controls in <TargetControls > .

1) How can i customize for each controls ?

2) I want to after validate the message errors apear in ValidationSummary and ErrorMessage not show in controls !

3) How can i hise ErrorMessage after validating in control ?

please help me 

Thanks.

<telerik:RadInputManager ID="RadInputManager1"  runat="server">       
        <telerik:RegExpTextBoxSetting BehaviorID="Setting3"  EmptyMessage="..... how can customize this message for any controls ..." 
            ErrorMessage="..... how can customize this message for any controls ..." Validation-IsRequired="true" Validation-ValidationGroup="Search">
                <TargetControls >
                    <telerik:TargetInput ControlID="txtFirstName"  />
                    <telerik:TargetInput ControlID="txtLastName"  />
                    <telerik:TargetInput ControlID="txtEmail"  />
                    <telerik:TargetInput ControlID="txtZipCode"  />
                </TargetControls>
            </telerik:RegExpTextBoxSetting
    </telerik:RadInputManager>

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

حمید
Top achievements
Rank 1
 asked on 31 May 2016
2 answers
97 views

I am pulling in dates from a database to highlight holidays in RadCalendar1_DayRender.  When I mouseover a highlighted date, the highlight disappears.  Is there a setting I need to keep the highlight date highlighted?

Thank you

Jeff
Top achievements
Rank 1
 answered on 31 May 2016
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?