Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
106 views

This is going to be a bit of odd one but here s what I am trying to do.  I have a aps.net page and on this page is  a radgrid.  The radgrid uses a Template for the Edit Form.  In this template I have a radtab strip.  On one tab is all the detail information for the record and the user can edit and save changes.  On the other table is a fileExplorer.  Now depending on which record is being entered the file paths need to be different, but for some reason when I am setting the ViewPath and UploadPaths in code it does not work, but if I set a static page in the html write up it work fine.

I am trying to set the folder on the Radgrid databound event.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
       {
           if (e.Item is GridEditableItem && e.Item.IsInEditMode)
           {
               RadFileExplorer marketingFiles = (RadFileExplorer)formItem.FindControl("FileExplorer1");
 
               string clientID = Session["AdvisorClientID"].ToString();
               string id = ((RadTextBox)editItem.FindControl("MarketingCode")).Text;
 
               if (!Directory.Exists(Server.MapPath("~/FileManager/") + clientID + "\\marketing\\" + id + "\\"))
                         Directory.CreateDirectory(Server.MapPath("~/FileManager/") + clientID + "\\marketing\\" + id + "\\");
               string[] folder = new string[] { Server.MapPath("~/FileManager/") + clientID + "\\marketing\\" + id + "\\"};
 
               marketingFiles.Configuration.ViewPaths = folder;
               marketingFiles.Configuration.UploadPaths = folder;
           }

It will create the folder if it does not exist.
 and this is the pageview html
<telerik:RadPageView ID="RadPageView2" runat="server" BorderStyle="Inset" BorderWidth="1px" BorderColor="LightBlue">                                        
   <telerik:RadFileExplorer runat="server" ID="FileExplorer1" Width="600px" Height="250px" AllowPaging="true" PageSize="20" Skin="WebBlue">
         <Configuration EnableAsyncUpload="true" /></telerik:RadFileExplorer></telerik:RadPageView>

the screen is also ajaxed, so I am not sure if that is the issue.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
       EnablePageHeadUpdate="False" OnAjaxRequestquest="RadAjaxManager1_AjaxRequest"
       OnAjaxRequest="RadAjaxManager1_AjaxRequest">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="FilterButton">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="RemoveFilterButton">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                   <telerik:AjaxUpdatedControl ControlID="TypeListBox" />
                   <telerik:AjaxUpdatedControl ControlID="StatusListBox" />
                   <telerik:AjaxUpdatedControl ControlID="DescriptionTxt" />
                   <telerik:AjaxUpdatedControl ControlID="StartDate" />
                   <telerik:AjaxUpdatedControl ControlID="EndDate" />
               </UpdatedControls>
           </telerik:AjaxSetting>
           <telerik:AjaxSetting AjaxControlID="RadGrid1">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManager>

thanks,
Eric
Eric Klein
Top achievements
Rank 1
 answered on 12 Oct 2012
6 answers
155 views

So, I am unable to assign a MultiLine Message as my Confirmation Text for a Delete ImageButton.

The below code, when not REM'd out, does not throw an error but when I hit Delete, the confirmation does not appear at all and it merely Deletes the record.  If I use a single Line of text, it appears and prompts for confirmation.

Not a deal breaker for me but I thought I would mention it.

Private Sub RecipientsGrid_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RecipientsGrid.ItemCreated
If TypeOf e.Item Is GridDataItem Then
Dim item As GridDataItem = DirectCast(e.Item, GridDataItem)
Dim DeleteBtn As GridButtonColumn = TryCast(RecipientsGrid.MasterTableView.GetColumn("DeleteOrganization"), GridButtonColumn)
Dim DeleteMsg As New StringBuilder
'DeleteMsg.Append("Delete this Organization?")
'DeleteMsg.Append(ControlChars.NewLine)
'DeleteMsg.Append("Note: This will DELETE all Contacts for this Organization!")
'DeleteBtn.ConfirmText = DeleteMsg.toString
DeleteBtn.ConfirmText = "DELETE ME!"
End If
End Sub
Tim
Top achievements
Rank 1
 answered on 12 Oct 2012
1 answer
241 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
98 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
133 views
Hello,

Is it possible to hide empty row or column in the PG?
Tsvetina
Telerik team
 answered on 12 Oct 2012
3 answers
75 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
119 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
293 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
82 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
130 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?