Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
270 views
Hello
I have two rad grids side by side on radpanes seperated by a rad splitter. When ever i am scrolled down and click on a row in  a particular grid, the grid scrolls back to the top. Is there any way to stop this from happening?

 
<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
    <center>
        <table>
            <tr>
                <td style="color:Blue;font-size:large"><strong>Bank Statement Reconciliation</strong><br /></td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="accountLabel" runat="server" Font-Bold="true" Font-Size="Large" ForeColor="Blue"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="dateLabel" runat="server" Font-Bold="true" Font-Size="Large" ForeColor="Blue"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="backButton" runat="server" CssClass="bttnBack"
                        onclick="backButton_Click" />       
                </td>
            </tr>
            <tr>
                <td><asp:Label ID="errorLabel" runat="server" Font-Bold="True" Font-Size="Large"
                        Font-Underline="True" ForeColor="#990000"></asp:Label><br /></td>
            </tr>
        </table>
    </center>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <script type="text/javascript">
    function requestStart(sender, args) {
        if (args.get_eventTarget().indexOf("exportToExcel") >= 0) {
            args.set_enableAjax(false);
        }
    }
</script>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ClientEvents OnRequestStart="requestStart"/>
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="detailGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="dbmotoGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="detailGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="totalsList" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="dbmotoGrid">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="dbmotoGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="detailGrid" LoadingPanelID="RadAjaxLoadingPanel1" />
                        <telerik:AjaxUpdatedControl ControlID="totalsList" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>       
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="WebBlue" />   
<telerik:RadFormDecorator ID="formDec" runat="server" Skin="WebBlue" />
<asp:Button ID="hiddenButton" OnClientClick="return false;" runat="server" style="display:none" visible="false" />
<asp:Panel ID="panel1" runat="server" DefaultButton="hiddenButton">  
<telerik:RadSplitter ID="splitter" runat="server" Height="600" Width="1500" >
    <telerik:RadPane ID="fullPane" runat="server" Height="300" Width="750">    
        <asp:Label ID="headerDbmoto" runat="server" Text="Open Records from AS400" Font-Size="Medium" Font-Bold="true" ForeColor="Blue"></asp:Label>               
        <telerik:RadGrid ID="dbmotoGrid" OnItemCommand="dbmotoGrid_ItemCommand" ShowStatusBar="true" DataSourceID="DBMotoSource" AllowFilteringByColumn="true" ShowFooter="true" OnRowDrop="dbmotoGrid_OnRowDrop"
            runat="server" AutoGenerateColumns="False" PageSize="25" AllowSorting="True" AllowMultiRowSelection="true"  EnableLinqExpressions="false" OnItemDataBound="dbmotoGrid_ItemDataBound"
            AllowPaging="True" GridLines="Vertical" ShowHeader="true" Skin="WebBlue" AlternatingItemStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
            FilterItemStyle-HorizontalAlign="Center">
            <ExportSettings ExportOnlyData="true" HideStructureColumns="true" FileName="AS400 Open Records" IgnorePaging="true" OpenInNewWindow="true" >
                <Excel Format="ExcelML"/>
            </ExportSettings>           
            <ClientSettings AllowRowsDragDrop="true">
                <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
                <ClientEvents OnRowSelected="DbmotoRowSelected" OnRowDeselected="DbmotoRowSelected"/>
            </ClientSettings>           
            <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                <MasterTableView CommandItemSettings-RefreshImageUrl="" HierarchyLoadMode="Client" CommandItemSettings-RefreshText="Refresh" CommandItemDisplay="Top" Name="mainGrid"
                    AllowAutomaticInserts="false" DataSourceID="DBMotoSource" DataKeyNames="CRBACT,CRCKDP,CRCNUM,CRCISO,CRCAMT" ClientDataKeyNames="CRCAMT,CRCKDP" AllowMultiColumnSorting="True" GridLines="Vertical">                                             
                    <SortExpressions>
                        <telerik:GridSortExpression FieldName="CRCISO" SortOrder="Ascending" />
                    </SortExpressions>
                    <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" />                   
                    <CommandItemTemplate>
                            <telerik:RadCodeBlock ID="dbmotoScripts" runat="server">
                                <script type="text/javascript">
                                    
                            </telerik:RadCodeBlock>
                        <table align="left">
                            <tr>
                                <td>
                                    <asp:Label ID="sumLabel" runat="server" ForeColor="White" Text="Selected Sum: " Font-Size="Large"></asp:Label>
                                </td>
                            </tr>
                        </table>
                        <table align="right">
                            <tr>
                                <td>
                                    <asp:Button ID="voidButton" runat="server" Text="Void" CommandName="Void" style="cursor:pointer" OnClientClick="if(!CanVoid()) return true;" />
                                </td>
                                <td> </td>
                                <td> </td>
                                <td>
                                    <asp:Button ID="exportToExcel" runat="server" Text="Export" CommandName="ExportToExcel" style="cursor:pointer" />
                                </td>
                                <td> </td>
                                <td> </td>
                                <td>
                                    <asp:Button ID="refreshButton" runat="server" Text="Refresh" CommandName="Refresh" style="cursor:pointer" />
                                </td>
                            </tr>
                        </table>                                              
                    </CommandItemTemplate>        
                    <Columns>                       
                        <telerik:GridTemplateColumn SortExpression="CRCKDP" HeaderText="Type" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="EqualTo"
                            DataField="CRCKDP" UniqueName="CRCKDP" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="true">
                            <ItemTemplate>
                                    <asp:Label ID="detailTypeLabelDbmoto" runat="server" Text='<%# Eval("typeText") %>'></asp:Label>
                            </ItemTemplate>
                            <FilterTemplate>
                                <telerik:RadComboBox ID="detailTypeFilterDbmoto" runat="server" DataSourceID="typeSource" DataTextField="Text" DataValueField="Value" Width="60px"
                                    AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("CRCKDP").CurrentFilterValue %>'
                                    OnClientSelectedIndexChanged="SelectedIndexChangedDbmoto">
                                    <Items>
                                        <telerik:RadComboBoxItem runat="server" Text="Types" Value="" />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="filterScriptBlockDbmoto" runat="server">
                                    <script type="text/javascript">
                                        function SelectedIndexChangedDbmoto(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            tableView.filter("CRCKDP", args.get_item().get_value(), "EqualTo");
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>         
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn SortExpression="CRCNUM" HeaderText="Check #" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="EqualTo"
                        DataField="CRCNUM" UniqueName="CRCNUM" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="true"></telerik:GridBoundColumn>                           
                        <telerik:GridBoundColumn SortExpression="CRPAYE" HeaderText="Description" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="Contains"
                        DataField="CRPAYE" UniqueName="CRPAYE" AutoPostBackOnFilter="false" ShowFilterIcon="true" AllowFiltering="true">
                        <ItemStyle Wrap="false" HorizontalAlign="Left" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="CRCAMT" HeaderText="Amount" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="EqualTo"
                        DataField="CRCAMT" UniqueName="CRCAMT" AutoPostBackOnFilter="false" ShowFilterIcon="true" AllowFiltering="true" DataFormatString="{0:C}"></telerik:GridBoundColumn>                           
                        <telerik:GridBoundColumn DataField="CRCISO" AllowFiltering="true" AutoPostBackOnFilter="false" SortExpression="CRCISO" UniqueName="CRCISO" FilterDelay="8000" DataFormatString="{0:MM/dd/yyyy}" HeaderText="Date" HeaderStyle-HorizontalAlign="Center">
                        <FilterTemplate>                           
                            <table>
                                <tr>
                                    <td align="center">
                                        <telerik:RadDatePicker ID="RadDatePickerRecStart" Skin="WebBlue" runat="server" Width="100px" DateInput-EmptyMessage="Start Date"
                                            DbSelectedDate='<%# startDate %>'  SelectedDate="12/15/2009"  ClientEvents-OnDateSelected="FromRecStartSelected" >
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <telerik:RadDatePicker ID="RadDatePickerRecEnd" Skin="WebBlue" runat="server" Width="100px" DateInput-EmptyMessage="End Date"
                                            DbSelectedDate='<%# endDate %>'  SelectedDate="12/15/2010"  ClientEvents-OnDateSelected="ToRecEndSelected">
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                            </table>                           
                            <telerik:RadScriptBlock ID="filterScriptBlockEntryDate" runat="server">
                                <script type="text/javascript">
                                    
                                </script>
                            </telerik:RadScriptBlock>
                        </FilterTemplate>
                        </telerik:GridBoundColumn>                                                                      
                    </Columns>
                </MasterTableView>
        </telerik:RadGrid>              
    </telerik:RadPane>
    <telerik:RadSplitBar ID="splitbar" runat="server"></telerik:RadSplitBar>
    <telerik:RadPane ID="rightPane" runat="server" Height="300" Width="750">   
        <telerik:RadCodeBlock ID="clientCode" runat="server">
            <script type="text/javascript">
                
            </script>
        </telerik:RadCodeBlock>
        <asp:Label ID="detailRecordsLabel" runat="server" Text="Bank Statement Detail Records" Font-Size="Medium" Font-Bold="true" ForeColor="Blue"></asp:Label>               
        <telerik:RadGrid ID="detailGrid" OnItemCommand="detailGrid_ItemCommand" ShowStatusBar="true" DataSourceID="detailSource" AllowFilteringByColumn="true" ShowFooter="true" OnRowDrop="detailGrid_OnRowDrop"
            runat="server" AutoGenerateColumns="False" PageSize="25" AllowSorting="True" AllowMultiRowSelection="true" EnableLinqExpressions="false" OnItemDataBound="detailGrid_ItemDataBound"
            AllowPaging="True" GridLines="Vertical" ShowHeader="true" Skin="WebBlue" AlternatingItemStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"
            FilterItemStyle-HorizontalAlign="Center">
            <ExportSettings ExportOnlyData="true" FileName="BankStatementExport" HideStructureColumns="true" IgnorePaging="true" OpenInNewWindow="true" >
                <Excel Format="ExcelML" />
            </ExportSettings>
            <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
            <ClientSettings>
                <Selecting AllowRowSelect="true" EnableDragToSelectRows="true" />
                <ClientEvents OnRowSelecting="RowSelecting" OnRowSelected="DetailRowSelected" OnRowDeselected="DetailRowSelected" />
            </ClientSettings>                           
                <MasterTableView EditMode="PopUp" CommandItemSettings-RefreshImageUrl="" HierarchyLoadMode="Client" CommandItemSettings-RefreshText="Refresh" CommandItemDisplay="Top" Name="mainGrid"
                    AllowAutomaticInserts="false" DataSourceID="detailSource" DataKeyNames="ID,account,Combined_Flag" ClientDataKeyNames="ID,status,Combined_Flag,amount,type" AllowMultiColumnSorting="True" GridLines="Vertical">                         
                    <CommandItemSettings ShowExportToExcelButton="true" /> 
                    <CommandItemTemplate>
                        <table align="left">
                            <tr>
                                <td>
                                    <asp:Label ID="bnkSumLabel" runat="server" ForeColor="White" Text="Selected Sum: " Font-Size="Large"></asp:Label>
                                </td>
                            </tr>
                        </table>
                        <table align="right">
                            <tr>
                                <td>
                                    <asp:Button ID="addButton" runat="server" Text="Add New" CommandName="InitInsert" style="cursor:pointer" />
                                </td>
                                <td> </td>
                                <td> </td>
                                <td>
                                    <asp:Button ID="combineButton" runat="server" Text="Combine" CommandName="Combine" style="cursor:pointer" OnClientClick="if(!IsMultiSelected()) return true;" />
                                </td>
                                <td> </td>
                                <td> </td>
                                <td>
                                    <asp:Button ID="separateButton" runat="server" Text="Separate" CommandName="Separate" style="cursor:pointer" OnClientClick="if(!CanSeparate()) return true;" />
                                </td>
                                <td> </td>
                                <td> </td>
                                <td>
                                    <asp:Button ID="exportToExcel" runat="server" Text="Export" CommandName="ExportToExcel" style="cursor:pointer" />
                                </td>
                                <td> </td>
                                <td> </td>
                                <td>
                                    <asp:Button ID="refreshButton" runat="server" Text="Refresh" CommandName="Refresh" style="cursor:pointer" />
                                </td>
                            </tr>
                        </table>                                              
                    </CommandItemTemplate>                                     
                    
                         
                                         
                    <DetailTables>
                        <telerik:GridTableView DataKeyNames="CRBACT,CRCKDP,CRCNUM,CRCISO,CRCAMT,CRSTM#" Name="reconcileGrid" ShowFooter="true" DataSourceID="recSource" Width="100%" GridLines="Vertical" BorderWidth="20" BorderColor="#cae4ff"
                        runat="server" AllowPaging="false">                               
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="CRSTM#" MasterKeyField="ID" />
                        </ParentTableRelation>
                        <Columns>                                                       
                            <telerik:GridTemplateColumn SortExpression="CRCKDP" HeaderText="Type" HeaderButtonType="TextButton"
                            DataField="CRCKDP" UniqueName="CRCKDP" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="false">
                                <ItemTemplate>
                                    <asp:Label ID="recTypeLabel" runat="server" Text='<%# Eval("description") %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn SortExpression="CRCNUM" HeaderText="Check #" HeaderButtonType="TextButton"
                            DataField="CRCNUM" UniqueName="CRCNUM" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="false"></telerik:GridBoundColumn>                           
                            <telerik:GridBoundColumn SortExpression="CRPAYE" HeaderText="Description" HeaderButtonType="TextButton"
                            DataField="CRPAYE" UniqueName="CRPAYE" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="false">
                                <ItemStyle Wrap="false" HorizontalAlign="Left" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="CRCAMT" HeaderText="Amount" HeaderButtonType="TextButton"
                            DataField="CRCAMT" UniqueName="CRCAMT" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="false" DataFormatString="{0:C}"></telerik:GridBoundColumn>                          
                            <telerik:GridBoundColumn SortExpression="CRCISO" HeaderText="Date" HeaderButtonType="TextButton"
                            DataField="CRCISO" UniqueName="CRCISO" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="false" DataFormatString="{0:MM/dd/yyyy}"></telerik:GridBoundColumn>    
                            <telerik:GridTemplateColumn AllowFiltering="false" UniqueName="unmatch">
                                <ItemTemplate>
                                    <asp:Button ID="unrecButton" runat="server" Text="Unmatch" CommandName="Unmatch" OnClientClick="if(!confirm('Are you sure you want to unmatch this record?')) return true;" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                        </telerik:GridTableView>
                    </DetailTables>
                    <Columns>                       
                        <telerik:GridTemplateColumn SortExpression="Type" HeaderText="Type" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="EqualTo"
                        DataField="Type" UniqueName="Type" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="true">
                            <ItemTemplate>
                                    <asp:Label ID="detailTypeLabel" runat="server" Text='<%# Eval("typeText") %>' Visible='<%#!(Eval("status").ToString() == "U") %>'></asp:Label>
                                    <asp:Button ID="detailButton" CommandName="Edit" runat="server" Text='<%# Eval("typeText") %>' Visible='<%#(Eval("status").ToString() == "U") %>'></asp:Button>
                            </ItemTemplate>
                            <FilterTemplate>
                                <telerik:RadComboBox ID="detailTypeFilter" runat="server" DataSourceID="typeSource" DataTextField="Text" DataValueField="Value" Width="60px"
                                    AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Type").CurrentFilterValue %>'
                                    OnClientSelectedIndexChanged="SelectedIndexChanged">
                                    <Items>
                                        <telerik:RadComboBoxItem runat="server" Text="Types" Value="" />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="filterScriptBlock" runat="server">
                                    <script type="text/javascript">
                                        function SelectedIndexChanged(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            tableView.filter("Type", args.get_item().get_value(), "EqualTo");
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>         
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn SortExpression="Location" HeaderText="Location" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="EqualTo"
                        DataField="Location" UniqueName="Location" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="true">
                            <FilterTemplate>                       
                                <telerik:RadComboBox Height="300px" ID="locFilterBox" runat="server" DataSourceID="locSource" DataTextField="lmloc" DataValueField="lmloc"
                                    AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Location").CurrentFilterValue %>'
                                    OnClientSelectedIndexChanged="SelectedIndexChangedLoc" Width="50px">
                                    <Items>
                                        <telerik:RadComboBoxItem Value="" Text="All" />
                                        <telerik:RadComboBoxItem Value="0" Text="0" />                                   
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="filterScriptBlockLocation" runat="server">
                                    <script type="text/javascript">
                                        function SelectedIndexChangedLoc(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            tableView.filter("Location", args.get_item().get_value(), "EqualTo");
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>                         
                        </telerik:GridBoundColumn>                           
                        <telerik:GridTemplateColumn SortExpression="Check_Num" HeaderText="Check #" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="EqualTo"
                        DataField="Check_Num" UniqueName="Check_Num" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="true">
                            <ItemTemplate>
                                <asp:Label ID="checkNumLabel" runat="server" Text='<%# Eval("check_num") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>                                                       
                        <telerik:GridBoundColumn SortExpression="Amount" HeaderText="Amount" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="EqualTo"
                        DataField="Amount" UniqueName="Amount" AutoPostBackOnFilter="false" ShowFilterIcon="true" AllowFiltering="true" DataFormatString="{0:C}"></telerik:GridBoundColumn>                          
                        <telerik:GridBoundColumn SortExpression="Date" HeaderText="Date" HeaderButtonType="TextButton"
                        DataField="Date" UniqueName="Date" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="true" DataFormatString="{0:MM/dd/yyyy}">
                        <FilterTemplate>
                            <table>
                                <tr>
                                    <td align="center">
                                        <telerik:RadDatePicker ID="detailStart" Skin="WebBlue" runat="server" Width="100px" DateInput-EmptyMessage="Start Date"
                                            DbSelectedDate='<%# detailStartDate %>'  SelectedDate="12/15/2009"  ClientEvents-OnDateSelected="detailStartSelected" >
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="center">
                                        <telerik:RadDatePicker ID="detailEnd" Skin="WebBlue" runat="server" Width="100px" DateInput-EmptyMessage="End Date"
                                            DbSelectedDate='<%# detailEndDate %>'  SelectedDate="12/15/2010"  ClientEvents-OnDateSelected="detailEndSelected">
                                        </telerik:RadDatePicker>
                                    </td>
                                </tr>
                            </table>
 
                            <telerik:RadScriptBlock ID="filterScriptBlockEntryDate" runat="server">
                               
                        </FilterTemplate>
                        </telerik:GridBoundColumn>       
                        <telerik:GridTemplateColumn SortExpression="Status" HeaderText="Status" HeaderButtonType="TextButton" FilterDelay="8000" CurrentFilterFunction="EqualTo"
                        DataField="Status" UniqueName="Status" AutoPostBackOnFilter="false" ShowFilterIcon="false" AllowFiltering="true">
                            <ItemTemplate>
                                    <asp:Label ID="detailStatusLabel" runat="server" Text='<%# Eval("statusText") %>'></asp:Label>
                            </ItemTemplate>
                            <FilterTemplate>
                                <telerik:RadComboBox ID="statusFilter" runat="server" DataSourceID="statusSource" DataTextField="text" DataValueField="value" Width="90px"
                                    AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Status").CurrentFilterValue %>'
                                    OnClientSelectedIndexChanged="SelectedIndexChanged2">
                                    <Items>
                                        <telerik:RadComboBoxItem runat="server" Text="Statuses" Value="" />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="filterScriptBlock2" runat="server">
                                    <script type="text/javascript">
                                        function SelectedIndexChanged2(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                            tableView.filter("Status", args.get_item().get_value(), "EqualTo");
                                        }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>         
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <EditFormSettings EditFormType="Template" PopUpSettings-Modal="true" InsertCaption="Insert Bank Statement Detail Record" CaptionFormatString="Edit Bank Statement Detail Information">
                        <FormTemplate>
                            <center>
                            <table>
                                <tr>
                                    <td align="right">Type: </td>
                                    <td align="left">
                                        <telerik:RadComboBox ID="typeBox" runat="server" SelectedValue='<%# Bind("type") %>' DataSourceID="typeSource"  DataTextField="Text" ValidationGroup="insert" DataValueField="Value" Width="60px"
                                            AppendDataBoundItems="true" CausesValidation="true">                                           
                                        </telerik:RadComboBox>
                                    </td>
                                    <td align="left"><asp:CompareValidator ValueToCompare="Types" Operator="NotEqual" ControlToValidate="typeBox" ValidationGroup="insert"  ErrorMessage="* Must select a value" runat="server" ID="typeBoxValidator"></asp:CompareValidator> </td>
                                </tr>
                                <tr>
                                    <td align="right">Location: </td>
                                    <td align="left">
                                        <telerik:RadComboBox Height="300px" SelectedValue='<%# Bind("location") %>' ID="locBox" runat="server" ValidationGroup="insert"  DataSourceID="locSource" DataTextField="lmloc" DataValueField="lmloc"
                                            AppendDataBoundItems="true" Width="50px">
                                            <Items>
                                                <telerik:RadComboBoxItem Value="0" Text="N/A" />                                   
                                                <telerik:RadComboBoxItem Value="0" Text="0" />                                   
                                            </Items>
                                        </telerik:RadComboBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right">Check Num: </td>
                                    <td align="left"><telerik:RadNumericTextBox ID="checkBox" Text='<%# Bind("check_num") %>' runat="server" ValidationGroup="insert"  NumberFormat-DecimalDigits="0" NumberFormat-GroupSeparator="" CausesValidation="true"></telerik:RadNumericTextBox></td>
                                    <td align="left"><asp:RequiredFieldValidator ID="checkBoxValidator" runat="server" ControlToValidate="checkBox" ValidationGroup="insert" ErrorMessage="* Cannot be empty" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator></td>
                                </tr>
                                <tr>
                                    <td align="right">Amount: </td>
                                    <td align="left"><telerik:RadNumericTextBox ID="amountBox" Text='<%# Bind("amount") %>'  runat="server"  CausesValidation="true" ValidationGroup="insert" DataType="double"></telerik:RadNumericTextBox></td>
                                    <td align="left"><asp:RequiredFieldValidator ID="amountBoxValidator" runat="server" ControlToValidate="amountBox" ErrorMessage="* Cannot be empty" ValidationGroup="insert" Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator></td>
                                </tr>
                                <tr>
                                    <td align="right">Post Date: </td>
                                    <td align="left"><telerik:RadDatePicker ID="postDatePicker" DbSelectedDate='<%# Bind("date") %>'  runat="server" ValidationGroup="insert" ></telerik:RadDatePicker></td>
                                    <td align="left"><asp:RequiredFieldValidator ID="postDatePickerValidator" runat="server" ControlToValidate="postDatePicker" ValidationGroup="insert" ErrorMessage="* Select a date " Display="Dynamic" ForeColor="Red"></asp:RequiredFieldValidator></td>
                                </tr>
                                <tr>
                                 <td align="right"><asp:Label ID="StatusLabel" runat="server" Visible='<%# (Container is GridEditFormInsertItem) ? false : true %>' Text="Status:"></asp:Label></td>
                                 <td align="left"><asp:CheckBox ID="VoidCheckBox" runat="server" Visible='<%# (Container is GridEditFormInsertItem) ? false : true %>' Text="Void" /></td>
                                </tr>
                                <tr>
                                    <td colspan="2" align="center">
                                        <table>
                                            <tr>
                                                <td align="right">
                                                    <asp:Button ID="insertDetailButton" CommandName='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'  runat="server" CausesValidation="true" ValidationGroup="insert"></asp:Button>
                                                </td>
                                                <td align="left">
                                                    <asp:Button ID="detailCancelButton" Text="Cancel" runat="server" CausesValidation="False"
                                                        CommandName="Cancel"></asp:Button>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>                                   
                                </tr>
                            </table>
                            </center>
                        </FormTemplate>
                    </EditFormSettings>                   
                </MasterTableView>
        </telerik:RadGrid>         
    </telerik:RadPane>            
</telerik:RadSplitter>
</asp:Panel>
 
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder3" Runat="Server">
</asp:Content>
Justin
Top achievements
Rank 1
 answered on 12 Oct 2012
1 answer
117 views
I have a web page using the following rad controls:

1. radAdjaxLoadingPanel
2. radAjaxPanel
3. radAjaxTabStrip
4. radGrid

I have enabled the icons to display the ability to export to MS Excel, pdf, and MS Word.  I have added all the code as in the example on the telerik site.

When I click the icon to export to MS Excel  The header that shows the icons disappears and nothing happens.  No pop-up to save, open, etc. displays.

I determine in code, which tab is currently selected to determine the right grid to set the following properties:

                        gridImportStatistics.ExportSettings.ExportOnlyData = true;
                        gridImportStatistics.ExportSettings.IgnorePaging = true;
                        gridImportStatistics.ExportSettings.OpenInNewWindow = true;

I have stepped through the code with no errors and there is nothing on the browser stating a pop-up is blocked.  I cannot find any solution to this issue and this is an important capability to the site I am building.


Thanks...Brian
Kostadin
Telerik team
 answered on 12 Oct 2012
1 answer
154 views
Hello,

Is it possible to hide empty row or column in the PG?
Tsvetina
Telerik team
 answered on 12 Oct 2012
3 answers
95 views
Hi,

I want to do the following with docking zones.
I want to split the page in 4 zones (as an example) -> 1=left top, 2=right top, 3=left bottom, 4 =right bottom
In each zone a control will be placed.

If a control is unpinned then for example:
if zone 3 is unpinned then zone 4 should resize and merge with zone 3. If i drag the control from 4 to 1 then 1 should be placed in zone 4(=3+4) . If i drag 1 to 2 then the controls are swapped. etc
If zone 2 and 4 is unpinned then 1 should merge with zone 2 and 3 with 4.(or 1 merge with 3 and 4 with 2)

Is there an example where I can start to do this kind of functionality?

ps: It would be nice if Telerik could design wysiwyg layout manager where you can define (forbidden)zones with properties like draggable, resizable (and automatic resizing the area when a zone is unpinned), etc.

Thanks,

Henk
Slav
Telerik team
 answered on 12 Oct 2012
2 answers
140 views
Hi,

I am unable to export a rad grid with nested grid in it. When I export it, only master table data is being exported but not the data from nested grid. I tried using all the suggestions like making inner grid's hierarchydefaultexpanded to true as well but nothing really did the trick. please let me know on how to proceed further. Appreciate your help.

Regards,
Syam.
Swamy
Top achievements
Rank 1
 answered on 12 Oct 2012
4 answers
342 views
Good Day 
 
i am using a AsyncUpload(telerik), i am in a point where i am supposed to save the File to a certain Folder. 


First i check if the directory exist 
 
 
Dim baseDire As String = Server.MapPath("~/MyFILES/")
If IO.Directory.Exists(baseDire & Request("Req_ID").ToString()) = False Then
               IO.Directory.CreateDirectory(baseDire & Request("Req_ID").ToString())
           End If

 
Because i am doing multiple Upload  , i will have to loop through the items of the Upload control and save to a folder. 


For Each file As UploadedFile In UploadPropDoc.UploadedFiles
              Dim bytes(file.ContentLength - 1) As Byte
              file.InputStream.Read(bytes, 0, file.ContentLength)
               'Save the File to the disk
              file.SaveAs(baseDire + file.GetName())
          Next



Now when ever i debug this , when it comes to this line 


file.SaveAs(baseDire + file.GetName())
 


i get an Error 
 
 The process cannot access the file because it is being used by another process 
 


I have removed the Readonly in the Folder that it supposed to write to and gave everyone permission , but still the error persist.


Thanks


Rowi
Top achievements
Rank 1
 answered on 12 Oct 2012
3 answers
98 views

Hi,

I am using radgrid with grouping options,the problem it loads fine ,however after that it never binds even on paging,sorting or on other controls.when i remove grouping  it works fine. can you please reply soon.its very urgent.

below is my code

  <telerik:RadGrid ID="RgrdConsultantVacationweek" AutoGenerateColumns="false" AllowPaging="true"
                    PageSize="8" runat="server" DataMember="ConsultantID" OnNeedDataSource="RgrdConsultantVacationweek_NeedDataSource"
                    AllowSorting="true" OnItemCommand="RgrdConsultantVacationweek_ItemCommand" ShowGroupPanel="true"
                    ShowFooter="True">
                    <ExportSettings HideStructureColumns="true" />
                    <ClientSettings>
                        <Selecting AllowRowSelect="true" />
                        <ClientEvents OnRowDblClick="OnRowDblClick" />
                    </ClientSettings>
                    <MasterTableView CommandItemDisplay="Top" ClientDataKeyNames="VacationRequestID"
                        ShowGroupFooter="true" EnableViewState ="true">
                        <CommandItemTemplate>
                            <table width="100%">
                                <tr>
                                    <td style="text-align: right">
                                        <asp:LinkButton ID="LnkExportToexcel" runat="server" CommandName="ExportToExcel">
                                            <asp:Image ID="imgexportToexcel" ImageUrl="~/Img/Export to excel.gif" runat="server" />
                                        </asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="LnkExportTopdf" runat="server" CommandName="ExportTopdf">
                                            <asp:Image ID="ImgPdf" ImageUrl="~/Img/ExportToPDF.gif" runat="server" />
                                        </asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="LnkExporrtToCsv" runat="server" CommandName="ExporrtToCsv">
                                            <asp:Image ID="Imgcsv" ImageUrl="~/Img/ExportToCSV.gif" runat="server" />
                                        </asp:LinkButton>
                                        &nbsp;
                                        <asp:LinkButton ID="LnkExportToWord" runat="server" CommandName="ExportToWord">
                                            <asp:Image ID="ImgWord" ImageUrl="~/Img/ExportToWord.gif" runat="server" />
                                        </asp:LinkButton>
                                    </td>
                                </tr>
                            </table>
                        </CommandItemTemplate>
                        <GroupHeaderTemplate>
                            <asp:Label runat="server" ID="Label1" Text='<%#Eval("vacationmonth") %>' Visible="true">
                            </asp:Label>
                        </GroupHeaderTemplate>
                        <GroupFooterTemplate>
                          
                            <asp:Label ID="lblBusinessdaystext" Text="Total  " runat="server"></asp:Label>
                            <asp:Label ID="lblBusinessdays" runat="server" Text='<%# Eval("Businessdays") %>'>
                            </asp:Label>
                        </GroupFooterTemplate>
                        <Columns>
                            <telerik:GridBoundColumn DataField="VacationRequestID" HeaderText="VacationRequestID"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ConsultantID" HeaderText="ConsultantID" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ConsultantName" HeaderText="Resource" SortExpression="ConsultantName">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn ItemStyle-Width="15%" HeaderText="Dates">
                                <ItemTemplate>
                                    <asp:Label ID="lblDates" runat="server" Text='<%#String.Format("{0}-{1}", Eval("startdate").ToString(),Eval("enddate").ToString()) %>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn Aggregate="Sum" DataField="Businessdays" HeaderText="Business Days"
                                Visible="true" FooterText="Total   ">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Approved" HeaderText="Approved" Visible="true">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <GroupByExpressions>
                            <telerik:GridGroupByExpression>
                                <GroupByFields>
                                    <telerik:GridGroupByField FieldName="vacationmonth" />
                                </GroupByFields>
                            </telerik:GridGroupByExpression>
                        </GroupByExpressions>
                    </MasterTableView>
                </telerik:RadGrid>




protected void RgrdConsultantVacationweek_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            try
            {
                BindRgrdConsultantVacationweek();
            }
            catch (Exception ex)
            {


            }
        }


        protected void BindRgrdConsultantVacationweek()
        {
            try
            {
                //DateTime lastDate = GetLastDateOfWeek((DateTime.Now).Date, DayOfWeek.Saturday);
                DataTable dt = GetConsultantRequest(Convert.ToInt32(Session["CRUserID"]), true, Convert.ToInt32(Session["UserType"]), Convert.ToInt32(ddlTypeOfLeave.SelectedValue), rdpProjectStartDate.SelectedDate, rdpProjectEndDate.SelectedDate, Convert.ToInt32(ddlPractices.SelectedValue));
                RgrdConsultantVacationweek.DataSource = dt;
               
            }
            catch (Exception ex)
            {


            }
        }
thanks in advance.
Eyup
Telerik team
 answered on 12 Oct 2012
1 answer
179 views
Hi ,

I have a requirement to show realfont sizes in pt.  I used the trick already mentioned in many other threads:-

function OnClientSelectionChange(editor, args) {
 
 
    var tool = editor.getToolByName("RealFontSize");
    if (tool ) {
        setTimeout(function () {
            debugger;
            var value = tool.get_value(); 
            if (!value || value.indexOf('pt') >= 0)
                return;
            value.replace('px''');
            var newSize = parseInt(value) * 0.75;
            if (newSize.toString().indexOf('.25') >= 0) {
                newSize -= 0.25;
            } else if (newSize.toString().indexOf('.75') >= 0) {
                newSize += 0.25;
            }
            tool.set_value(newSize + 'pt');
        }, 0);
    }
}


The problem comes when i use style builder over some text and set the font size to some other metric say cm/mm. i don't see the converted value in pt in the real font size dropdown in pt. this works fine in Chrome and Firefox but on in IE.

I am using radeditor in ribbonbar mode. Is there a way to fix this.

Thanks,
AM

Rumen
Telerik team
 answered on 12 Oct 2012
1 answer
151 views
Hello,

To Print  Grid Data With all paging  & Filter Data, i use this program (from : http://www.telerik.com/community/forums/aspnet-ajax/grid/how-to-print-grid-data-with-all-paging.aspx ) :
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Testing.aspx.vb" Inherits="Aspen.Testing" %>
 
<%@ 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>Telerik Print Fucntion</title>
<telerik:RadCodeBlock runat ="server" ID= "ClientExport">
<script type = "text/javascript" >
          
    function getOuterHTML(obj){
           if (typeof (obj.outerHTML) == 'undefined')
                {
                      var divWrapper = document.createElement("div");
                      var copyOb = obj.cloneNode(true);
                      divWrapper.appendChild(copyOb);
                      return divWrapper.innerHTML
                }
            else
         return obj.outerHTML;
 }
 function PrintRadGrid( ){  
            var radGrid = $find('RadGrid1');
             
            var previewWnd = window.open('about:blank', '', '', false);
            var sh = '<%= ClientScript.GetWebResourceUrl(RadGrid1.GetType(),String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css",radGrid1.Skin)) %>';
            var styleStr = "<html><head><link href = '" + sh + "' rel='stylesheet' type='text/css'></link></head>";
            var htmlcontent = styleStr + '<body>' + getOuterHTML($find('RadGrid1').get_element()) + '</body></html>'; 
            previewWnd.document.open();
            previewWnd.document.write(htmlcontent);
            previewWnd.document.close();
            previewWnd.print();
            previewWnd.close();       
 }  
     
 </script>
 </telerik:RadCodeBlock>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
      <AjaxSettings >
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID ="btnExport">
            <UpdatedControls >
                <telerik:AjaxUpdatedControl ControlID ="btnExport" />
            </UpdatedControls>
            </telerik:AjaxSetting>
           </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging ="true"
            Width="493px" >
        <ExportSettings FileName ="Hello" Excel-FileExtension ="xls" OpenInNewWindow ="true" IgnorePaging ="true" ></ExportSettings>
            <MasterTableView>
                 <RowIndicatorColumn>
                     <HeaderStyle Width="20px"></HeaderStyle>
                </RowIndicatorColumn>
 
                <ExpandCollapseColumn>
                     <HeaderStyle Width="20px"></HeaderStyle>
                </ExpandCollapseColumn>
            </MasterTableView>
            <ClientSettings>
                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    <input ID="btnPrint" runat="server" type="button"   onclick="PrintRadGrid();" value="Print Grid Data5" />
    </form>
</body>
</html>


this solution works in IE and Firefox but it does not work in chrome. The result is empty.
Do you have this problem in Chrome? Do you have a solution in chrome?

Pavlina
Telerik team
 answered on 12 Oct 2012
1 answer
105 views
Hello!

I am having a disagreement with a co-worker on the design of web pages that are using the RadGrid as the primary control. In his design he suggests that the grid should be build dynamically, adding columns and properties, etc. in the on_Init event. My suggested design is that the layout for the grid be done in the web page markup and using the page/grid events for only functionality and binding. The radgrid on the page needs to do some very complicated tasks and act like an excel spreadsheet. In our spreadsheet style control it will have a master/detail view and include custom filtering and incorporate event handling such as the double click event and right click event. Now, in my version of the design I plan to use the NeedDataSource to bind a datatable; however, he believes that the datafield can be set dynamically as well. Can you provide a brief list of pro's and con's for each of the two approaches to designing the webpage grid layouts?

Thanks,

Steve Holdorf
Maria Ilieva
Telerik team
 answered on 12 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?