Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
167 views
I've had a request to have the grid grouping option to ignore paging for the last group on a page if a group is to be continued on next page and wondered if anyone knows how to do this?

For instance, if I have my paging set to 10 items per page, have grouping applied, and there are three groups, each containing 4 items, I want the final group to show all 4 items (just like the first 2) instead of displaying

"(Showing 2 of 4 items.Group continues on the next page.)"

I know there could be a speed issue if the third group has a large number of items, but thats what I need.
Maria Ilieva
Telerik team
 answered on 10 Nov 2010
7 answers
275 views
Any word on when a Scheduler HeaderTemplate is coming out? From what I can see searching, I'm not the only one who really really really needs this.

For the record, my needs are:
1. Date is *centered*
2. Left and right navigation arrows are spread out and on either side of the date, as one would intuitively expect.
3. 2 additional tabs that go to new pages (example "109828_CustomView.zip" from another post helps with this)
4. Get rid of that "today" link.

Thanks!
Peter
Telerik team
 answered on 10 Nov 2010
2 answers
131 views
Hi,

I have added button column to radGrid. On click,  I want to move that data to another radGrid. HOW DO I GET THAT "ON CLICK" event ?

Please help.....
Smiely
Top achievements
Rank 1
 answered on 10 Nov 2010
1 answer
83 views
I have a RadListBox where I drag from it to a RadTreeView, so EnableDragAndDrop is set to "true".  While I'm dragging over my RadListBox, or any other RadListBox on the page with EnableDragAndDrop = "true", a small arrow appears to the left of the RadListBoxItem that I'm hovering over.  (See attached screenshot).

I don't know if this matters but AllowReorder is also set to "false" on all the RadListBoxes.

It seems to the user like the arrow is trying to indicate that the RadListBoxItem can be dropped in a different position or on another RadListBox even though that is not the case.

Is there a way I can hide the small arrow?
Genady Sergeev
Telerik team
 answered on 10 Nov 2010
5 answers
829 views
Hey everyone,

i have a radgrid.I want to filter radgrid manually.i have a radcombobox consisting of name of columns of radgrid.and a textbox and a search button.I want to filter grid according to the value selected in the combobox and written in textbox on search button click event.for every column name present in the combobx.how to achieve this?..Is there a demo explaining this kind of scenario?...

thanks
Amit
Tsvetina
Telerik team
 answered on 10 Nov 2010
3 answers
167 views
Hello everyone, I have a problem with the javarscript in the grid :

if I put the grid inside an <ASP:Panel> to bring up a screen of data loading:

<telerik:RadAjaxManager ID="RadAjaxManager2" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <ClientEvents OnRequestStart="RequestStart" OnResponseEnd="RequestEnd"></ClientEvents>
        <AjaxSettings>
                  <telerik:AjaxSetting AjaxControlID="Panel1">
                         <UpdatedControls>
                              <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" />
                        </UpdatedControls>
                 </telerik:AjaxSetting>
      </AjaxSettings>
</telerik:RadAjaxManager>
<asp:Panel ID="Panel1" runat="server"
        <telerik:RadGrid ID="GriEleRec" runat="server"
            AllowAutomaticUpdates="True" AllowPaging="True"
            AutoGenerateEditColumn="True" DataSourceID="MySQLDataSource"
            GridLines="None" Skin="Web20" PageSize="12"
            AllowAutomaticDeletes="True" AutoGenerateColumns="False"
            style="margin-right: 23px"
            Width="100%"
            OnInsertCommand="InsRep"
            OnDeleteCommand="DelRep"
            OnUpdateCommand="UpdRep"
            AutoGenerateDeleteColumn="True"
            AllowSorting="True">
 
             .......
             ......
 
     </telerik:RadGrid>
 
 
<script language="javascript" type="text/javascript">
         var currentLoadingPanel = null;
 
         function RequestStart(sender, eventArgs) {
             check = InStr(eventArgs.EventTarget, "btnEli");
             //alert(check);
             if (check > 0) {
                 eventArgs.EnableAjax = false;
             }
             else {
                 eventArgs.EnableAjax = true;
                 centerElementOnScreen($get("<%= RadAjaxLoadingPanel1.ClientID %>"));
                 HideFrame();
             }
 
         }
 
         function RequestEnd(sender, eventArgs) {
             ShowFrame();
         }
 
         function centerElementOnScreen(element) {
             var scrollTop = document.body.scrollTop;
             var scrollLeft = document.body.scrollLeft;
             var viewPortHeight = document.body.clientHeight;
             var viewPortWidth = document.body.clientWidth;
             if (document.compatMode == "CSS1Compat") {
                 viewPortHeight = document.documentElement.clientHeight;
                 viewPortWidth = document.documentElement.clientWidth;
                 scrollTop = document.documentElement.scrollTop;
                 scrollLeft = document.documentElement.scrollLeft;
             }
             var topOffset = Math.ceil(viewPortHeight / 2 - element.offsetHeight / 2);
             var leftOffset = Math.ceil(viewPortWidth / 2 - element.offsetWidth / 2);
             var top = scrollTop + topOffset - 40;
             var left = scrollLeft + leftOffset - 70;
             element.style.position = "absolute";
             element.style.top = top + "px";
             element.style.left = left + "px";
         }   
     </script></telerik:RadCodeBlock>


in which case the grid to do an javascript windows.open or an export to excel gives me a runtime error and I reload the same page

I do something wrong?
Veli
Telerik team
 answered on 10 Nov 2010
6 answers
889 views
I'm setting the CssClass of the HeaderStyle in all of my columns, so that the columns can be styled completely through CSS (i.e. someone could target the entirety of a specific column, or just the header of a specific column).

However, when setting that, I no longer get the default CSS classes that I would expect from the grid.  For example, the rgSorted class does not get added when a column is being sorted, and the rgHeader class is not present on any of the headers.

I'm using the 2009.3.1103.35 version of the controls.

Firstly, is there any way to get those styles added back without doing it manually?  Obviously I can add rgHeader to everything pretty easily, but having to keep track of the dynamically added styles will be painful.

Secondly, is there a way that I can add my custom CSS classes to the <col/> elements, instead of the Header (which would at least allow someone to hide the entire column if they wanted).

Thanks in advance for the help,
Dimo
Telerik team
 answered on 10 Nov 2010
3 answers
198 views
I want to pass UpdatebuttonClientID on to javacript method in item databound.. to make update button  enable or  disable it if quantity assinged is more than the  available quantity. so detail bind method onfocusout event i need to pass the button client id. how to know which row is expaned or not.... i need to pass details of radtextbox id and update buttonid and available quantity.. please give solution it z very urgent...
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostBasisLotSelection.aspx.cs" Inherits="CostBasis.CostBasisLotSelection" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title>Cost Basis Lot Selection Screen</title>
    <link href="css/Default.css" rel="stylesheet" type="text/css" />
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
 
        <script type="text/javascript">
 
 
            var sumInput = null;
            var tempValue = 100;
 
            function Load(sender, args) {
                sumInput = sender;
                sumInput.set_value(tempValue);
            }
 
            function Blur(sender, args) {
                alert(tempValue);
                sumInput.set_value(tempValue - sender.GetValue());
            }
             
            function Focus(sender, args) {
                tempValue = sumInput.get_value() - sender.get_value();
            }
             
            function letternumber(e) {
 
               
                var key;
                var keychar;
 
                if (window.event)
                    key = window.event.keyCode;
                else if (e)
                    key = e.which;
                else
                    return true;
                keychar = String.fromCharCode(key);
                keychar = keychar.toLowerCase();
 
                // control keys
                if ((key == null) || (key == 0) || (key == 8) || (key == 9) || (key == 13) || (key == 27))
                    return true;
 
                // alphas and numbers
                else if ((("abcdefghijklmnopqrstuvwxyz0123456789").indexOf(keychar) > -1))
                    return true;
                else
                    return false;
            }
 
            function ClientValidate(source, arguments) {
                var DateTo = document.getElementById("dtToDate_dateInput_text").value;
                var DateFrom = document.getElementById("dtFromDate_dateInput_text").value;
                var dtto = new Date(DateTo);
                var dtFrom = new Date(DateFrom);
                if (DateFrom == undefined) {
                    arguments.IsValid = true;
 
                } else {
                    if (DateFrom > DateTo) {
                        arguments.IsValid = false;
                    } else {
                        arguments.IsValid = true;
                    }
                }
            }
            function OnKeyPress(sender, eventArgs) {
                var c = eventArgs.get_keyCode();
                if ((c < 47) || (c > 57))
                    eventArgs.set_cancel(true);
            }
            function calculate(price, quantity) {
                var text1 = $find(price).get_value(); //I used Asp.net Ajax find method
                var text2 = quantity;
                //alert(text1 + " == "+text2)
                if (text1 >= text2) {
                    //alert("here");
                   
                    text1.focus();
                   
                }
//                var text3 = $find(totalAmount);
//                var total = text1.GetValue() * text2.GetValue();
//                text3.SetValue(total);
            }  
 
   
        </script>
    </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="Scriptmanager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnGo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlTaxLotsSearch" LoadingPanelID="LoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="btnTaxLotsGo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgCostBasisTrades"  />
                    <telerik:AjaxUpdatedControl ControlID="pnlTaxLotsSearch"  />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rgCostBasisTrades">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgCostBasisTrades" LoadingPanelID="LoadingPanel3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="LoadingPanel1" runat="server" Style="padding-top: 45px;padding-left: 35px;"
        Height="75px" Width="75px" IsSticky="false" Transparency="30">
        <img alt="Loading..." src="img/loadingReport.gif" style="border: 0;" />
    </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxLoadingPanel ID="LoadingPanel2" runat="server" Style="padding-top: 85px;padding-left: 15px;"
        Height="75px" Width="75px" IsSticky="false" Transparency="30">
        <img alt="Loading..."  src="img/loadingReport.gif"  style="border: 0;" />
    </telerik:RadAjaxLoadingPanel>
    </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxLoadingPanel ID="LoadingPanel3" runat="server"
        Style="padding-top: 65px;padding-left: 20px;" IsSticky="false"
        Transparency="30">
        <img alt="Loading..."  src="img/loadingReport.gif"  style="border: 0;" />
    </telerik:RadAjaxLoadingPanel>
     <table border="0" cellpadding="4" cellspacing="0" width="100%">
        <tr class="PageTitle" valign="middle">
            <td>
                <span id="lblTitle" class="PageTitle">• Cost Basis Lot Selection Screen â€¢</span>
            </td>
        </tr>
        <tr>
            <td>
                <table width="100%">
                    <tr>
                        <td>
                            <table width="100%">
                                <tr>
                                    <td style="width: 33%">
                                        <asp:Panel runat="server" ID="pnlCustAcctNo" Visible="true" GroupingText="Customer Account Number"
                                            Height="55px" Width="100%" HorizontalAlign="Center">
                                            <table>
                                                <tr valign="middle">
                                                    <td style="height: 35px;width:65%">
                                                        <asp:RequiredFieldValidator ID="rfdtxtCustAcctNo" Display="None" runat="server" ControlToValidate="txtCustAcctNo"
                                                            ValidationGroup="gpUser" ErrorMessage=" Enter Account Number"></asp:RequiredFieldValidator>
                                                        <telerik:RadTextBox ID="txtCustAcctNo" MaxLength="12" Skin="Office2007" CssClass="SMALLERTEXT" OnKeyPress="return letternumber(event);"
                                                            runat="server">
                                                        </telerik:RadTextBox>
                                                        <cc1:ValidatorCalloutExtender ID="valrqdFname_ValidatorCalloutExtender" runat="server"
                                                            Width="15px" TargetControlID="rfdtxtCustAcctNo">
                                                        </cc1:ValidatorCalloutExtender>
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="btnGo" Enabled="true"  OnClick="btnGo_Click" ValidationGroup="gpUser"
                                                                        runat="server" BorderStyle="None" CssClass="Buttons2" Text="Go" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                    <td style="width: 67%">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                   
                    <tr>
                        <td>
                            <table width="100%">
                                <tr>
                                    <td style="width: 83%">
                                        <asp:Panel runat="server" ID="pnlTaxLotsSearch" Enabled="false" Visible="true" GroupingText="Tax Lots Search"
                                            Height="110px" HorizontalAlign="Center">
                                            <table class="selectedPage" width="97%" style="height: 70px">
                                                <tr>
                                                    <td>
                                                        <asp:CustomValidator ID="cstValFrmDate" runat="server" ControlToValidate="dtFromDate"
                                                            ClientValidationFunction="ClientValidate" Display="None" ErrorMessage="From Date should be Less than To Date"
                                                            ValidationGroup="GpTaxLot">      
                                                        </asp:CustomValidator>
                                                    </td>
                                                </tr>
                                                <tr align="left" >
                                                    <td style="width: 24%">
                                                        <asp:Label ID="lblTaxLots" CssClass="SMALLERTEXTBOLD1" runat="server" Text="Tax Lots :"></asp:Label>
                                                    </td>
                                                    <td style="width: 26%">
                                                        <asp:RadioButtonList ID="rblSymbolCusip" Height="5px" CssClass="SMALLERTEXTBOLD1" runat="server" RepeatDirection="Horizontal">
                                                            <asp:ListItem Selected="True" Text="Symbol" Value="S"></asp:ListItem>
                                                            <asp:ListItem Text="Cusip" Value="C"></asp:ListItem>
                                                        </asp:RadioButtonList>
                                                    </td>
                                                    <td style="width: 24%">
                                                        <asp:Label ID="lblFromDate" CssClass="SMALLERTEXTBOLD1" runat="server" Text="From :"></asp:Label>
                                                    </td>
                                                    <td style="width: 24%">
                                                        <asp:Label ID="lblToDate" CssClass="SMALLERTEXTBOLD1" runat="server" Text="To :"></asp:Label>
                                                    </td>
                                                    <td style="width: 2%">
                                                    </td>
                                                </tr>
                                                <tr valign="top" align="left">
                                                    <td >
                                                        <telerik:RadComboBox ID="cmdTaxLots" runat="server" Width="110px" MarkFirstMatch="True"
                                                            Skin="Office2007" ToolTip="Select Tax Lots">
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="All" />
                                                                <telerik:RadComboBoxItem Text="Open Lots" />
                                                                <telerik:RadComboBoxItem Text="Closed Lots" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                    </td>
                                                    <td style="width: 23%" >
                                                        <telerik:RadTextBox ID="txtSymbolCusip" Width="110px" Skin="Office2007" CssClass="SMALLERTEXT"
                                                            runat="server">
                                                        </telerik:RadTextBox>
                                                    </td>
                                                    <td>
                                                        <telerik:RadDatePicker ID="dtFromDate" Width="110px" runat="server" ToolTip="Select Date" Skin="Office2007"
                                                            Culture="English (United States)" >
                                                            <dateinput labelcssclass="radLabelCss_Office2007" DateFormat="MM/dd/yyyy"  skin="Office2007">
                                                            <ClientEvents OnKeyPress="OnKeyPress" />
                                                            </dateinput>
                                                            <calendar showrowheaders="False" skin="Office2007"
                                                                usecolumnheadersasselectors="False" userowheadersasselectors="False"
                                                                viewselectortext="x">
                                                                <specialdays>
                                                                <telerik:RadCalendarDay Date="" IsToday="True" Repeatable="Today">
                                                                    <ItemStyle CssClass="rcToday" BorderColor="Red" BorderStyle="NotSet" />
                                                                    </telerik:RadCalendarDay>
                                                                </specialdays>
                                                            </calendar>                                                           
                                                            <datepopupbutton cssclass="radPopupImage_Office2007" />
                                                        </telerik:RadDatePicker>
                                                    </td>
                                                    <td>
                                                        <telerik:RadDatePicker ID="dtToDate" Width="110px" ShowRowHeaders="false" runat="server"
                                                            ToolTip="Select Date" Skin="Office2007" Culture="English (United States)">
                                                            <dateinput labelcssclass="radLabelCss_Office2007" DateFormat="MM/dd/yyyy"  skin="Office2007">
                                                            <ClientEvents OnKeyPress="OnKeyPress" />
                                                            </dateinput>
                                                            <calendar showrowheaders="False" skin="Office2007"
                                                                usecolumnheadersasselectors="False" userowheadersasselectors="False"
                                                                viewselectortext="x">
                                                                <specialdays>
                                                                <telerik:RadCalendarDay Date="" IsToday="True" Repeatable="Today">
                                                                    <ItemStyle CssClass="rcToday" BorderColor="Red" BorderStyle="Solid" />
                                                                    </telerik:RadCalendarDay>
                                                                </specialdays>
                                                            </calendar>
                                                            <datepopupbutton cssclass="radPopupImage_Office2007" />
                                                        </telerik:RadDatePicker>
                                                        <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" Width="30 px"
                                                            TargetControlID="cstValFrmDate">
                                                        </cc1:ValidatorCalloutExtender>
                                                    </td>
                                                    <td>
                                                        <asp:Button ID="btnTaxLotsGo" runat="server" BorderStyle="None" CausesValidation="true"
                                                            ValidationGroup="GpTaxLot" CssClass="Buttons2" OnClick="btnTaxLotGo_Click" Text="Go" />
                                                    </td>
                                                     <td style="width: 100px">
                                                    </td>
                                                </tr>
                                            </table>
                                        </asp:Panel>
                                    </td>
                                    <td style="width: 17%">
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                <table width="90%" style="height:100%">
                    <tr>
                        <td>
                            <telerik:RadGrid ID="rgCostBasisTrades" runat="server" AllowMultiRowSelection="false"
                                AllowPaging="false" ShowHeader="true"  OnItemCommand="rgCostBasisTrades_ItemCommand" AllowSorting="false" OnNeedDataSource="rgCostBasisTrades_NeedDataSource"
                                OnItemDataBound="rgCostBasisTrades_ItemDataBound"
                                OnItemUpdated="rgCostBasisTrades_UpdateCommand" OnDetailTableDataBind="rgCostBasisTrades_DetailTableDataBind"
                                AutoGenerateColumns="False" GridLines="None" Height="200px" LoadingTemplateTransparency="25"
                                AlternatingItemStyle-BackColor="AliceBlue" Visible="true"
                                Skin="Office2007" Width="100%"
                                onupdatecommand="rgCostBasisTrades_UpdateCommand1">
                                <MasterTableView TableLayout="Fixed" Name="TaxlotsMain"  >
                                    <PagerStyle Mode="NumericPages" Visible="False" />
                                    <DetailTables>
                                        <telerik:GridTableView Name="Taxlots" ShowHeader="true" runat="server" Width="100 %" ShowFooter="true">
                                            <Columns>
                                                <telerik:GridBoundColumn DataField="Symbol" HeaderButtonType="TextButton" HeaderText="Symbol"
                                                    SortExpression="Symbol" UniqueName="Symbol">
                                                    <HeaderStyle HorizontalAlign="left" Width="20%" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn  DataField="Shares" HeaderButtonType="TextButton" HeaderText="Shares"
                                                    SortExpression="Shares" UniqueName="Shares">
                                                    <HeaderStyle HorizontalAlign="left" Width="20%" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblShares" runat="server" Text='<%# Eval("Shares") %>' /> 
                                                 </ItemTemplate
 
                                                </telerik:GridTemplateColumn >
                                                <telerik:GridBoundColumn DataField="LotID" HeaderButtonType="TextButton" HeaderText="LotID"
                                                    SortExpression="LotID" UniqueName="LotID">
                                                    <HeaderStyle HorizontalAlign="left" Width="20%" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                </telerik:GridBoundColumn>
                                                <telerik:GridTemplateColumn DataField="Allocation" HeaderButtonType="TextButton"
                                                    HeaderText="Allocation" SortExpression="Allocation" UniqueName="Shares">
                                                    <ItemTemplate>
                                                    <telerik:RadNumericTextBox ID="txtAllocation" Font-Size="xx-small" runat="server"
                                                        Width="80%" MinValue="1" MaxValue="999999999"  Text='<%#DataBinder.Eval(Container.DataItem, "Allocation")%>'>
                                                        <ClientEvents OnBlur="Blur" />
                                                        <NumberFormat GroupSeparator="" DecimalDigits="0" />
                                                    </telerik:RadNumericTextBox>
                                                    <asp:CompareValidator ID="CmptxtAllocation" runat="server" ErrorMessage="Enter Value Less Than Shares" 
                                                          ControlToValidate="txtAllocation"  Display="None"  Operator="LessThanEqual"></asp:CompareValidator>
                                                          <cc1:ValidatorCalloutExtender ID="ValidatorCalloutExtender1" runat="server" Width="50 px"
                                                            TargetControlID="CmptxtAllocation" >
                                                        </cc1:ValidatorCalloutExtender>
                                           
                                                    </ItemTemplate>
                                                    <HeaderStyle HorizontalAlign="left" Width="20%" />
                                                    <ItemStyle HorizontalAlign="left" />
                                                    <FooterStyle HorizontalAlign="Left" Width="20%" />
                                                    <FooterTemplate>
                                                       <telerik:RadNumericTextBox ID="txtTotalAllocation" Font-Size="xx-small" runat="server"  MinValue="1" MaxValue="999999999" Width="80%">
                                                        <ClientEvents OnLoad="Load" />
                                                        <NumberFormat GroupSeparator="" DecimalDigits="0" />
                                                        </telerik:RadNumericTextBox>
                                                      </FooterTemplate>
 
                                                </telerik:GridTemplateColumn>
                                            </Columns>
                                        </telerik:GridTableView>
                                    </DetailTables>
                                    <Columns>
                                        <telerik:GridBoundColumn DataField="Trade" HeaderButtonType="TextButton" HeaderText="Trade #"
                                            SortExpression="Trade" UniqueName="Trade">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="left" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="BS" HeaderButtonType="TextButton" HeaderText="B / S"
                                            SortExpression="BS" UniqueName="BS">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="left" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn DataField="Allocation" HeaderButtonType="TextButton"
                                            HeaderText="Allocation" SortExpression="Allocation" UniqueName="Shares">
                                        </telerik:GridTemplateColumn>
                                        <telerik:GridBoundColumn DataField="Symbol" HeaderButtonType="TextButton" HeaderText="Description"
                                            SortExpression="Symbol" UniqueName="Symbol">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="left" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Price" HeaderButtonType="TextButton" HeaderText="Price"
                                            SortExpression="Price" UniqueName="Price">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="left" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn DataField="Shares" HeaderButtonType="TextButton" HeaderText="Shares"
                                            SortExpression="Shares" UniqueName="Shares">
                                            <HeaderStyle HorizontalAlign="left" />
                                            <ItemStyle HorizontalAlign="left" />
                                        </telerik:GridBoundColumn>
                                        <telerik:GridButtonColumn   ButtonType="LinkButton"  CommandName="Update"  Text="Update" UniqueName="LotUpdate">
                                        <HeaderStyle Width="60px" />
                                        
                                        </telerik:GridButtonColumn>
 
                                    </Columns>
                                </MasterTableView>
                               
                                <ClientSettings>
                <ClientEvents  />
             <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                    <Selecting AllowRowSelect="True" />
            </ClientSettings>
                                <FilterMenu NotSelectedImageUrl="~/Skins/GridSkin/Ice/NotSelectedMenu.gif" SelectedImageUrl="~/Skins/GridSkin/Ice/SelectedMenu.gif">
                                </FilterMenu>
                            </telerik:RadGrid>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="center">
                <%--<asp:Button ID="btnGridUpdate" runat="server" CssClass="Buttons" Text="Update" BorderStyle="None"
                    Height="21px" Width="67px" />
                <asp:HiddenField ID="hdnActionButtonClicked" Value="false" runat="server" />--%>
            </td>
        </tr>
    </table>
    </form>
</body>
</html>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using System.IO;
using System.Configuration;
 
namespace CostBasis
{
    public partial class CostBasisLotSelection : System.Web.UI.Page
    {
        //Button btnTaxLotGo;
        //Button btnCustAcctNoGo;
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
              
                //UserControl ucCustAcctNo = (UserControl)FindControl("ucCustAcctDetails");
                //ucCustAcctDetails.
                //CustAcctNo ucCostBasisDetail = (CustAcctNo)ucCustAcctNo;
                //ucCustAcctDetails.btnCustAcctNoHandler += new CustAcctNo.OnCustAcctNoButtonClick(ucCostBasisDetail_btnCustAcctNoHandler);
               // ucCustAcctDetails.btnCustAcctNoHandler += new CustAcctNo.OnCustAcctNoButtonClick(ucCustAcctDetails_btnCustAcctNoHandler);
                //TaxLotsSearch ucTaxLotSearch = (TaxLotsSearch)FindControl("ucTaxLotsSearch");
             //   ucTaxLotsSearch.btnHandler += new TaxLotsSearch.OnButtonClick(ucTaxLotSearch_btnHandler);
              //  ucTaxLotsSearch.btnHandler += new TaxLotsSearch.OnButtonClick(ucTaxLotsSearch_btnHandler);
                //UserControl ucTaxLots = (UserControl)FindControl("ucTaxLotsSearch");
               // btnTaxLotGo = (Button)ucTaxLotsSearch.FindControl("btnGo");
 
 
               // btnCustAcctNoGo = (Button)ucCustAcctDetails.FindControl("btnGo");
              //  RadTextBox txtCustAcctNo = (RadTextBox)ucCustAcctDetails.FindControl("txtCustAcctNo");
 
 
                if (!IsPostBack)
                {
                    rgCostBasisTrades.Visible = false;
                    //btnUpdate.Visible = false;
                    btnTaxLotsGo.Enabled = false;
                }
                else
                {
                    if (!txtCustAcctNo.Text.Equals(string.Empty))
                    {
                        btnGo.Enabled = true;
                    }
                }
            }
            catch (Exception ex)
            {
 
 
            }
 
        }
        protected void rgCostBasisTrades_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.ExpandCollapseCommandName)
            {
                GridDataItem dataItem = (GridDataItem)e.Item;
                LinkButton btnLotUpdate = (LinkButton)dataItem["LotUpdate"].Controls[0];
               
                //insert custom logic here
                if (e.Item.Expanded)
                {
                    btnLotUpdate.Enabled = false;
 
                }
            }
        }
        protected void btnGo_Click(object sender, EventArgs e)
        {
            btnTaxLotsGo.Enabled = true;
            pnlTaxLotsSearch.Enabled = true;
        }
        void ucTaxLotsSearch_btnHandler(string strValue)
        {
            
        }
 
        void ucCustAcctDetails_btnCustAcctNoHandler(string strValue)
        {
             
        }
        protected void btnTaxLotGo_Click(object sender, EventArgs e)
        {
            PopulateGrid();
        }
      
 
        //void ucTaxLotSearch_btnHandler(string strValue)
        //{
             
        //}
 
        //void ucCostBasisDetail_btnCustAcctNoHandler(string strValue)
        //{
             
        //}
 
        protected void rgCostBasisTrades_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {
            if (Session["ReportDefinitionGridView1"] != null)
            {
                DataSet gridViewRptDef = this.Session["ReportDefinitionGridView1"] as DataSet;
                rgCostBasisTrades.DataSource = gridViewRptDef;
                rgCostBasisTrades.DataMember = "catalog";
            }
           
        }
 
        void PopulateGrid()
        {
            rgCostBasisTrades.Visible = true;
            //btnUpdate.Visible = true;
 
            string myXMLfile = ConfigurationManager.AppSettings["CBLotSelection"];
            DataSet ds = new DataSet();
            try
            {
                ds.ReadXml(myXMLfile);
                this.Session["ReportDefinitionGridView1"] = ds;
                rgCostBasisTrades.Rebind();
                 
            }
            catch (Exception ex)
            {
            }
        }
     
        protected void rgCostBasisTrades_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item.OwnerTableView.Name == "TaxlotsMain") // check with name of DetailTable
            {
                if (e.Item is GridDataItem)
                {
                    GridDataItem dataItem = (GridDataItem)e.Item;
                    LinkButton btnLotUpdate = (LinkButton)dataItem["LotUpdate"].Controls[0];
                    if (e.Item.Expanded)
                    {
                        btnLotUpdate.Enabled = true;
                    }
                    else
                    {
                        btnLotUpdate.Enabled = false;
                    }
                }
            }
            else if (e.Item.OwnerTableView.Name == "Taxlots")
            {
                if (e.Item is GridDataItem)
                {
                    GridDataItem item = (GridDataItem)e.Item;
                    RadNumericTextBox txtAllocation = item.FindControl("txtAllocation") as RadNumericTextBox;
                    Label SharesLabel = item["Shares"].FindControl("lblShares") as Label;
                    CompareValidator cmp = item.FindControl("CmptxtAllocation") as CompareValidator;
                    //cmp.ValueToCompare = Math.Round(Convert.ToDecimal(SharesLabel.Text.ToString()), 2).ToString();
                    cmp.ValueToCompare = Convert.ToString(Convert.ToInt32(SharesLabel.Text.ToString()));
                    //cmp.ValueToCompare = "100";
                   // cmp.c
                    // Get the textbox for column Price   
                    //txtAllocation.Attributes.Add("onFocusout", "return calculate('" + txtAllocation.ClientID + "','" + 100 + "','" + txtTotalAmount.ClientID + "')");
                   // txtAllocation.Attributes.Add("onFocusout", "return calculate('" + txtAllocation.ClientID + "','" + 100 + "')");
                    //    txtPrice.Attributes.Add("onFocusout", "return calculate('" + txtPrice.ClientID + "','" + txtQuantity.ClientID + "','" + txtTotalAmount.ClientID + "')");
                    //    txtQuantity.Attributes.Add("onFocusout", "return calculate('" + txtPrice.ClientID + "','" + txtQuantity.ClientID + "','" + txtTotalAmount.ClientID + "')");
                    //    txtTotalAmount.Attributes.Add("onfocus", "return calculate('" + txtPrice.ClientID + "','" + txtQuantity.ClientID + "','" + txtTotalAmount.ClientID + "')");
                    //}  
 
 
                }
 
                //GridDataInsertItem insertItem = (GridDataInsertItem)e.Item;
                //GridDataItem parentitem = (GridDataItem)insertItem.OwnerTableView.ParentItem;
                //GridTableView tableView = (GridTableView)parentitem.ChildItem.NestedTableViews[0];
                //tableView.GetColumn("EditcolumnUniqueName").Visible = true;
                //GridDataItem dataItem = (GridDataItem)ParentItem;
                //foreach (GridDataItem dataItem in rgCostBasisTrades.Items)
                //    ((LinkButton)dataItem["EditcolumnUniqueName"].Controls[0]).Visible = false;
            }
            //else
            //{
            //    foreach (GridDataItem parentitem in rgCostBasisTrades.Items)
            //    {
            //        if (parentitem.Expanded)
            //        {
            //            LinkButton btnLotUpdate = (LinkButton)parentitem["LotUpdate"].Controls[0];
            //            btnLotUpdate.Enabled = false;
            //            //GridTableView tableView = (GridTableView)parentitem.ChildItem.NestedTableViews[0];
            //            //tableView.GetColumn("EditcolumnUniqueName").Visible = false;
            //        }
            //    }
            //}
          
            //if (e.Item is GridDataItem)
            //{
            //    GridDataItem dataItem = (GridDataItem)e.Item;
            //    LinkButton btnLotUpdate = (LinkButton)dataItem["LotUpdate"].Controls[0];
            //    btnLotUpdate.Enabled = false;
            //}  
 
        }
 
        protected void rgCostBasisTrades_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
 
         
            switch (e.DetailTableView.Name)
            {
                case "Taxlots":
                    {
                        LinkButton btnLotUpdate = (LinkButton)dataItem["LotUpdate"].Controls[0];
                        btnLotUpdate.Enabled = true;
                        string myXMLfile = ConfigurationManager.AppSettings["CBLotSelection2"];//Path.Combine(Environment.CurrentDirectory, @"CostBasis\XML\SampleXML21.xml"); //"C:\\Documents and Settings\\SPuttappa\\My Documents\\Visual Studio 2008\\Projects\\CostBasis\\XML\\SampleXML21.xml";
                        DataSet ds = new DataSet();
                        try
                        {
                            ds.ReadXml(myXMLfile);
                            e.DetailTableView.DataSource = ds;
                            e.DetailTableView.DataMember = "catalog";
                        }
                        catch (Exception ex)
                        {
                        }
                         break;
                    }
            }
        }
 
        protected void rgCostBasisTrades_UpdateCommand(object source, GridUpdatedEventArgs e)
        {
            
        }
 
        protected void rgCostBasisTrades_UpdateCommand1(object source, GridCommandEventArgs e)
        {
            //e.Item.OwnerTableView.ParentItem.OwnerTableView.Rebind();
        }
    }
}


Tsvetina
Telerik team
 answered on 10 Nov 2010
5 answers
67 views
I've noticed in both my code and demos that when you drag an existing appointment in month view from one day to another the start and end times are reset to midnight and one AM respectively. No event (client side) is jumping out at me to hold the existing time of day values. Is there a way to either capture that event and handle the time of day stuff or just disable drag and drop in month view?
Veronica
Telerik team
 answered on 10 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Hiba
Top achievements
Rank 1
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?