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

I have a scenario where I am binding Radgrid at server side in Page Load with default filter criteria and additionally there are some tile buttons for the user to filter the Radgrid list.

Now I have filter enabled in the Radgrid, so whenever the user uses the filter in the Radgrid, it triggers the pageload databinding of the radgrid and uses the default criteria.

Is there a way for the Radgrid not to use the Pageload binding and still apply the filter with the list it has.

Note:I am using the server side binding

Kris
Top achievements
Rank 1
 asked on 09 Jun 2017
1 answer
428 views

Hi, I'm trying to make my Checkbox clickable if that's a word.. I am having trouble because when I try to change it into a <telerik:GridTemplateColumn> with a the ItemTemplate stuff data does not get fetched from the server. To clear it up when I change it to a TemplateColumn the data from the server does not transfer and the checkboxes ARE clickable but checks do not appear where they should be. What I want is the checkboxes to appear as "clickable" and data appears where it should be, and also when a checkbox is checked the data will go to the SQL server. Sorry, if I'm asking for too much.... I'm still learning.:)

 

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
     <telerik:RadGrid ID="CGRUnPaidFees2017" runat="server" AllowAutomaticInserts="True" CGRUnPaidFees2017_Init="true" OnItemDeleted="CGRUnPaidFees2017_ItemDeleted" OnItemInserted="CGRUnPaidFees2017_ItemInserted"
            OnItemUpdated="CGRUnPaidFees2017_ItemUpdated" OnPreRender="CGRUnPaidFees2017_PreRender" AllowAutomaticUpdates="True" AllowPaging="True"
            AutoGenerateColumns="True" DataSourceID="UnPaidFees2017" Height="945px" Width="1380px">
<GroupingSettings CollapseAllTooltip="Collapse all groups" CaseSensitive="False"></GroupingSettings>
    <SortingSettings EnableSkinSortStyles="False" />
 
<ExportSettings ExportOnlyData="True"></ExportSettings>
 
    <ClientSettings>
        <Scrolling AllowScroll="True" UseStaticHeaders="True" />
    </ClientSettings>
    <MasterTableView AutoGenerateColumns="False" DataKeyNames="Paid" DataSourceID="UnPaidFees2017" PageSize="34" AllowFilteringByColumn="True" ShowGroupFooter="True" GridLines="Both">
        <Columns>
            <telerik:GridBoundColumn DataField="School" HeaderButtonType="PushButton" FilterControlAltText="Filter School column" HeaderText="School" SortExpression="School" UniqueName="School">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Student_Matric" HeaderButtonType="PushButton" FilterControlAltText="Filter Student_Matric column" HeaderText="Student_Matric" SortExpression="Student_Matric" UniqueName="Student_Matric" DataType="System.Double">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Name" HeaderButtonType="PushButton" FilterControlAltText="Filter Name column" HeaderText="Name" SortExpression="Name" UniqueName="Name">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Fee_Amount" HeaderButtonType="PushButton" FilterControlAltText="Filter Fee_Amount column" HeaderText="Fee_Amount" SortExpression="Fee_Amount" UniqueName="Fee_Amount" DataType="System.Double">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Fee" FilterControlAltText="Filter Fee column" HeaderButtonType="PushButton" HeaderText="Fee" SortExpression="Fee" UniqueName="Fee">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Date_Issued" DataType="System.DateTime" HeaderButtonType="PushButton" FilterControlAltText="Filter Date_Issued column" HeaderText="Date_Issued" SortExpression="Date_Issued" UniqueName="Date_Issued">
            </telerik:GridBoundColumn>
            <telerik:GridCheckboxColumn DataField="Paid" FilterControlAltText="Filter Paid column" HeaderText="Paid" HeaderButtonType="PushButton" SortExpression="Paid" UniqueName="Paid" AutoPostBackOnFilter="True">
            </telerik:GridCheckboxColumn>
        </Columns>
        <EditFormSettings>
         
        </EditFormSettings>
    </MasterTableView>
 
    <FilterItemStyle HorizontalAlign="Left" VerticalAlign="Middle" />
 
    <PagerStyle PageSizes="30;60;90;120" PageButtonCount="30" />
 
</telerik:RadGrid>
         <asp:SqlDataSource ID="UnPaidFees2017" runat="server" ConnectionString="<%$ ConnectionStrings:pedrolConnectionString %>"
                SelectCommand="SELECT School, [Student Matric] AS Student_Matric, Name, [Fee Amount] AS Fee_Amount, Fee, [Date Issued] AS Date_Issued, Paid FROM UnPaidFees2017"
                UpdateCommand="UPDATE UnPaidFees2017 SET Paid = @Paid" OnSelecting="UnPaidFees2017_Selecting" InsertCommand="INSERT INTO UnPaidFees2017(Paid) VALUES (@Paid)">
              <InsertParameters>
                  <asp:Parameter Name="Paid" Type="Boolean" />
              </InsertParameters>
          
              <UpdateParameters>
                  <asp:Parameter Name="Paid" Type="Boolean" />
              </UpdateParameters>
          
         </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>

 

I know there's a bunch of junk in my <telerik:RadGrid /> I was trying to solve my issue and couldn't, let me know if you need more info, I'll send whatever I can.

Peter
Top achievements
Rank 1
 answered on 08 Jun 2017
1 answer
145 views
I have a RadComboBox that is not showing the more results box. In the markup I have ShowMoreResultsBox="true" and in the OnItemsRequested event I'm setting e.Message but it's not displaying my message in the more results box, although the datasource gets updated and displays properly.  Is there anything simple that I should be looking for to ensure this displays?
Rumen
Telerik team
 answered on 08 Jun 2017
4 answers
253 views

Hello All,  

    I have simple radgrid with to/from date filter option. But when I change the dates in the filter, its not updating the grid. Following is my simple code. I have tried everything in the tutorial, but no luck. Any help is appreciated. 

 

<telerik:RadGrid RenderMode="Lightweight" ID="rgScreening" runat="server" Width="100%" Enabled ="true" 
        FilterItemStyle-BackColor="#e6e6e6" FilterItemStyle-BorderStyle="Solid" OnPreRender="rgScreening_PreRender"
        OnItemCommand="rgScreening_ItemCommand">
        <HeaderStyle CssClass="gridViewHeader" />
        <PagerStyle Mode="NumericPages" CssClass="gridViewPager" />
        <ItemStyle CssClass="gridViewRow" />
        <AlternatingItemStyle CssClass="gridViewAltRow" />
        <SelectedItemStyle CssClass="gridViewSelected" />
        <MasterTableView AllowSorting="true" PageSize="10" AllowPaging="True" Width="100%" AutoGenerateColumns="false" CommandItemDisplay="None" 
            AllowFilteringByColumn="true">
        <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="false" />            
        <Columns>
            <telerik:GridBoundColumn UniqueName="ProviderOrOwner" DataField="ProviderOrOwner" HeaderText="Provider/Owner">
                <FilterTemplate>
                    <telerik:RadComboBox RenderMode="Lightweight" runat="server" ID="rcbProviderOrOwner" 
                        SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ProviderOrOwner").CurrentFilterValue %>' 
                        OnClientSelectedIndexChanged="ProviderOrOwnerSelectedIndexChanged" Width="80px">
                        <Items>
                            <telerik:RadComboBoxItem runat="server" Text="All"/>
                            <telerik:RadComboBoxItem runat="server" Text="Provider" Value="Provider" />
                            <telerik:RadComboBoxItem runat="server" Text="Owner" Value="Owner" />
                        </Items>
                    </telerik:RadComboBox>
                    <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                        <script type="text/javascript">
                            function ProviderOrOwnerSelectedIndexChanged(sender, args) {
                                var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                tableView.filter("ProviderOrOwner", args.get_item().get_value(), "EqualTo");
                            }
                        </script>
                    </telerik:RadScriptBlock>
                </FilterTemplate>
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn UniqueName="ScreeningDate" DataField="ScreeningDate" HeaderText="Screening Date" DataFormatString="{0:D}" >
            <FilterTemplate>
                <span style="width:50px; font-weight:bold; text-align:right">From</span>
                <telerik:RadDatePicker RenderMode="Lightweight" ID="FromScreeningDatePicker" runat="server" Width="120px" ClientEvents-OnDateSelected="FromDateSelected"
                MinDate='<%# Convert.ToDateTime("01/01/1900")%>' MaxDate='<%# Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"))%>'
                DbSelectedDate='<%# startDate %>' FocusedDate="01/01/2016"
                 DateInput-ForeColor="Black" Calendar-CalendarTableStyle-BackColor="#cccccc" Calendar-BackColor="White" Calendar-HeaderStyle-BackColor="White" 
                Calendar-TitleStyle-BackColor="White" DateInput-BorderColor="Black"/> &nbsp;            
                <span style="width:50px; font-weight:bold; text-align:right">To</span>
                <telerik:RadDatePicker RenderMode="Lightweight" ID="ToScreeningDatePicker" runat="server"  Width="120px" ClientEvents-OnDateSelected="ToDateSelected"
                MinDate='<%# Convert.ToDateTime("01/01/1900")%>' MaxDate='<%# Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"))%>'
                DbSelectedDate='<%# endDate %>' FocusedDate='<%# Convert.ToDateTime(DateTime.Now.ToString("MM/dd/yyyy"))%>'
                DateInput-ForeColor="Black" Calendar-CalendarTableStyle-BackColor="#cccccc" Calendar-BackColor="White" Calendar-HeaderStyle-BackColor="White" 
                Calendar-TitleStyle-BackColor="White" DateInput-BorderColor="Black"></telerik:RadDatePicker>
                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                    <script type="text/javascript">
                        function FromDateSelected(sender, args) {
                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                            var ToPicker = $find('<%# ((GridItem)Container).FindControl("ToScreeningDatePicker").ClientID %>');
                            var fromDate = FormatSelectedDate(sender);
                            var toDate = FormatSelectedDate(ToPicker);
                            tableView.filter("ScreeningDate", fromDate + " " + toDate, "Between");
                        }
                        function ToDateSelected(sender, args) {
                        var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                        var FromPicker = $find('<%# ((GridItem)Container).FindControl("FromScreeningDatePicker").ClientID %>');
                        var fromDate = FormatSelectedDate(FromPicker);
                        var toDate = FormatSelectedDate(sender);
                        var dtfilter = fromDate + "  " + toDate
                        tableView.filter("ScreeningDate", tfilter, "Between");
                    }
                    function FormatSelectedDate(picker) {
                        var date = picker.get_selectedDate();
                        var dateInput = picker.get_dateInput();
                        var formattedDate = dateInput.get_dateFormatInfo().FormatDate(date, "MM/dd/yyyy hh:mm:ss tt");
                        return formattedDate;
                    }
                    </script>
                </telerik:RadScriptBlock>
            </FilterTemplate>

        </telerik:GridBoundColumn>

</Columns>
        </MasterTableView>
    </telerik:RadGrid>

Devang
Top achievements
Rank 1
 answered on 08 Jun 2017
0 answers
160 views
Hi , I have a grid, that binds with List<> of objects but when I try to add the filtering, sorting, paging features, the grid binds to nothing or it dissapear from my page, do you know how I can have my grids with List<> and to have filters and sorting etc features... thanks in advance
Carlos
Top achievements
Rank 1
 asked on 08 Jun 2017
4 answers
606 views

Hello, 

 

I am just having some issues creating a simple submit button that will save an uploaded file to a specified folder upon the clicking of the button. 

 

If anyone could assist me in pointing me the right direction or how you could go about doing this, it would be greatly appreciated. 

 

 <telerik:radasyncupload runat="server" CssClass="async-attachment" ID="AsyncUpload1"
                HideFileInput="True" EnableInlineProgress="True" MultipleFileSelection="Automatic" DropZones=".dropzone" />    
            <asp:Button runat="server" ID="Button1" Text="Submit" OnClick= "fileUpload" />

 

What would the code behind look like etc?

 

Thanks so much

David
Top achievements
Rank 1
 answered on 08 Jun 2017
1 answer
83 views

Hello,

I'm converting my diagram to image or PDF, but on the result I would like to set margins or padding for correct printing. But I could not find any built-in functionality to achieve this. Is this possible to implement?

Kind regards,

Vessy
Telerik team
 answered on 08 Jun 2017
1 answer
206 views

We used to be able to enable JavaScript Intellisense prior VS 2017 via the link below

http://docs.telerik.com/devtools/aspnet-ajax/general-information/using-jquery/jquery-intellisense

Now, switching to VS 2017, the option indicated at the link above don't seem to be available any more.

Anyone know what is the correct way now ?

 

Rumen
Telerik team
 answered on 08 Jun 2017
0 answers
133 views

The RadEditor appears to be adding a <br> after every <p> when you press [Enter] in design mode. When saved and displayed as Html, this looks like two blank lines are between each line, instead of one.

The attached screenshot shows the editor in the bottom half, where the spacing looks correct, and the top half shows the text bound to a grid, where the spacing is doubled. 

If I inspect the markup I can see:

<p>line 1</p><br><br><p>line 2</p><br><br><p>line 3</p></br>

The config I'm initially using for the RadEditor is:

 <telerik:RadEditor RenderMode="Lightweight" ID="tbSummary" <br>                               runat="server" <br>                               StripFormattingOnPaste="NoneSupressCleanMessage" <br>                               NewLineMode="P" <br>                               EditModes="Design" <br>                               EmptyMessage="" <br>                               Width="639px" <br>                               BackColor="White" <br>                               OnClientLoad="OnClientLoad" >

 

I would have expected just the <p> tags, not the additional <br> tags. Any suggestions on how this can be resolved?

K

 

Jason
Top achievements
Rank 1
 asked on 08 Jun 2017
3 answers
70 views

hi, i am using a radeditor in my asp:Repeater. when user tried to add a new row in the repeater, a JS error was thrown

 

screen shot of error

refer to JSError.png

 

code

01.<asp:UpdateProgress ID="updateProgress6" runat="server" AssociatedUpdatePanelID="pnlModular2">
02.     <ProgressTemplate>
03.         <div style="; text-align: center; height: 100%; width: 100%; top: 0; right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
04.              <span style="border-width: 0px; ; padding: 50px; background-color: #FFFFFF; font-size: 36px; left: 40%; top: 40%;">Loading ...</span>
05.         </div>
06.     </ProgressTemplate>
07.</asp:UpdateProgress>
08.<asp:UpdatePanel ID="pnlModular2" runat="server" UpdateMode="Conditional">
09.      <ContentTemplate>
10.            <asp:Repeater ID="rptStructureModular2" runat="server" OnItemCommand="rptStructureModular2_ItemCommand" OnItemDataBound="rptStructureModular2_ItemDataBound">
11.                 <HeaderTemplate>
12.                       <table cellpadding="0px" cellspacing="0px" style="width: 95%;">
13.                 </HeaderTemplate>
14.                 <ItemTemplate>
15.                     <tr>
16.                        <td style="padding: 1em 1em;">
17.                              <table style="width: 106%;" cellpadding="0px" cellspacing="0px" class="repeaterTable">
18.                                  <tr>
19.                                    <td colspan="2" style="padding: 1em 1em;">
20.                                                    <asp:Label runat="server" ID="lblModular">Module <%# Container.ItemIndex+1 %></asp:Label>
21.                                                    <asp:LinkButton ID="btnRemoveModular2" runat="server"
22.                                                    CommandName="remove" CommandArgument='<%# Container.ItemIndex %>'>
23.                                                        <span aria-hidden="true" class="glyphicon glyphicon-trash"></span>
24.                                                    </asp:LinkButton>
25.                                                </td>
26.                                            </tr>
27.                                            <tr style="overflow: hidden;" class="<%# Container.ItemIndex+1 %>">
28.                                                <td style="padding: 1em 1em; width: 20%">Title</td>
29.                                                <td style="padding: 1em 1em;">
30.                                                    <asp:TextBox ID="txtTitle" onchange="disableNext()" CssClass="adminText" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "title") %>'></asp:TextBox>
31.                                                </td>
32.                                            </tr>
33.                                            <tr style="overflow: hidden;" class="<%# Container.ItemIndex+1 %>">
34.                                                <td style="padding: 1em 1em;">Description</td>
35.                                                <td style="padding: 1em 1em;">
36.                                                    <telerik:RadEditor ID="txtDescription" runat="server" Content='<%# DataBinder.Eval(Container.DataItem, "description") %>' DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd" OnClientLoad="OnClientLoad">
37.                                                    </telerik:RadEditor>
38.                                                </td>
39.                                            </tr>
40.                                            </table>
41.                                            </td>
42.                                        </tr>
43.                                    </ItemTemplate>
44.                                    <FooterTemplate>
45.                                    <tr>
46.                                    <td style="padding: 1em 1em;" align="right">
47.                                    <asp:Button ID="btnAddModular2" runat="server" Text="Add Module" OnClick="btnAddModular2_Click" />
48.                             </td>
49.                           </tr>
50.                        </table>
51.                   </FooterTemplate>
52.              </asp:Repeater>
53.      </ContentTemplate>
54.</asp:UpdatePanel>
Benjamin
Top achievements
Rank 1
 answered on 08 Jun 2017
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?