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

Hello,

I've created a small page with a RadGrid on it. Now the problem is, that the event OnNeedDataSource is only fired if i set ViewState=false(I found this solution on an other thread). Now the grid does work, but if I also habe 2 GridButtonColumn's in the grid. Now if I click them, the OnNeedDataSource event is only called bevore the method "RadGrid1_ItemCommand". So any changes I make to the database are not shown in the grid!

aspx code:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="QU_R17_ASP_Testproject.WebForm1" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="a" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2017.2.711.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server" />
         
        <div class="demo-container">
            <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
            </telerik:RadAjaxLoadingPanel>
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
            <telerik:RadDatePicker ID="StartDateTimePicker" runat="server" AutoPostBack="false" Culture="en-US" >
                <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" EnableWeekends="True" FastNavigationNextText="&lt;&lt;"></Calendar>
                <DateInput DisplayDateFormat="yyyy-MM-dd" DateFormat="yyyy-MM-dd" LabelWidth="40%" AutoPostBack="True" runat="server">
                    <EmptyMessageStyle Resize="None" />
                    <ReadOnlyStyle Resize="None" />
                    <FocusedStyle Resize="None" />
                    <DisabledStyle Resize="None" />
                    <InvalidStyle Resize="None" />
                    <HoveredStyle Resize="None" />
                    <EnabledStyle Resize="None" />
                </DateInput>
                <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
            </telerik:RadDatePicker>
 
                <telerik:RadDatePicker ID="EndDateTimePicker" runat="server" AutoPostBack="false" Culture="en-US" >
                <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" EnableWeekends="True" FastNavigationNextText="&lt;&lt;"></Calendar>
                <DateInput DisplayDateFormat="yyyy-MM-dd" DateFormat="yyyy-MM-dd" LabelWidth="40%" AutoPostBack="True">
                    <EmptyMessageStyle Resize="None" />
                    <ReadOnlyStyle Resize="None" />
                    <FocusedStyle Resize="None" />
                    <DisabledStyle Resize="None" />
                    <InvalidStyle Resize="None" />
                    <HoveredStyle Resize="None" />
                    <EnabledStyle Resize="None" />
                </DateInput>
                <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
            </telerik:RadDatePicker>
                 
                <telerik:RadTextBox ID="ResultTextBox" BorderStyle="None" runat="server" Resize="Both" Width="1000px"></telerik:RadTextBox>
                                             
                <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid2" runat="server" AllowPaging="True" AllowSorting="True" AllowFilteringByColumn="True" ShowGroupPanel="True" DataKeyNames="ID"
                OnItemCommand="RadGrid1_ItemCommand" OnNeedDataSource="RadGrid2_NeedDataSource" EnableViewState="False">
                <MasterTableView AutoGenerateColumns="false" ShowFooter="True">
                    <PagerStyle AlwaysVisible="true" />
                    <CommandItemSettings ShowAddNewRecordButton="False" ShowRefreshButton="False" />
                    <Columns>
                        <telerik:GridBoundColumn FilterControlWidth="120px" DataField="Status" HeaderText="Status"
                            AutoPostBackOnFilter="false" CurrentFilterFunction="Contains"
                            ShowFilterIcon="false">
                            <FilterTemplate>
                                <telerik:RadComboBox RenderMode="Lightweight" ID="RadComboBoxStatus"
                                    Width="110px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("Status").CurrentFilterValue %>'
                                    runat="server" OnClientSelectedIndexChanged="StatusIndexChanged">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="All" />
                                        <telerik:RadComboBoxItem Text="Assigned" Value="Assigned" />
                                        <telerik:RadComboBoxItem Text="Idle" Value="Idle" />
                                        <telerik:RadComboBoxItem Text="CLOSED" Value="CLOSED" />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
                                    <script type="text/javascript">
                                        function StatusIndexChanged(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("Status", args.get_item().get_value(), "EqualTo");
                                    }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                        </telerik:GridBoundColumn>
 
                        <telerik:GridBoundColumn FilterControlWidth="150px" DataField="System" HeaderText="System"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                            ShowFilterIcon="false">
                            <FilterTemplate>
                                <telerik:RadComboBox RenderMode="Lightweight" ID="RadComboBoxSystem"
                                    Width="150px" AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("System").CurrentFilterValue %>'
                                    runat="server" OnClientSelectedIndexChanged="SystemIndexChanged">
                                    <Items>
                                        <telerik:RadComboBoxItem Text="All" />
                                        <telerik:RadComboBoxItem Text="Printing" Value="Printing" />
                                        <telerik:RadComboBoxItem Text="Wet" Value="Wet" />
                                        <telerik:RadComboBoxItem Text="Assembly" Value="Assembly" />
                                    </Items>
                                </telerik:RadComboBox>
                                <telerik:RadScriptBlock ID="RadScriptBlock2" runat="server">
                                    <script type="text/javascript">
                                        function SystemIndexChanged(sender, args) {
                                            var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                        tableView.filter("System", args.get_item().get_value(), "EqualTo");
                                    }
                                    </script>
                                </telerik:RadScriptBlock>
                            </FilterTemplate>
                        </telerik:GridBoundColumn>
 
                        <telerik:GridMaskedColumn DataField="SystemId" HeaderText="SystemId" Display="False" />
                         
                        <telerik:GridMaskedColumn DataField="JobId" HeaderText="JobId"
                            FilterControlWidth="80px" AutoPostBackOnFilter="false" CurrentFilterFunction="EqualTo"
                            FilterDelay="2000" ShowFilterIcon="false" Display="False">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridMaskedColumn>
                         
                        <telerik:GridBoundColumn FilterControlWidth="80px" DataField="Job" HeaderText="Job"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                            ShowFilterIcon="false">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
 
                        <telerik:GridMaskedColumn DataField="UniqueID" HeaderText="UniqueID"
                            FilterControlWidth="110px" AutoPostBackOnFilter="false" CurrentFilterFunction="EqualTo"
                            FilterDelay="1000" ShowFilterIcon="false">
                        </telerik:GridMaskedColumn>
 
                        <telerik:GridBoundColumn FilterControlWidth="70px" DataField="Lot" HeaderText="Lot"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                            ShowFilterIcon="false">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>
                         
                        <telerik:GridBoundColumn FilterControlWidth="95px" DataField="LogDateTime" HeaderText="LogDateTime" ShowFilterIcon="false" AllowFiltering="False">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridBoundColumn>                       
 
                        <telerik:GridMaskedColumn DataField="ProductID " HeaderText="ProductID "
                            FilterControlWidth="50px" AutoPostBackOnFilter="false" CurrentFilterFunction="EqualTo"
                            FilterDelay="2000" ShowFilterIcon="false">
                            <ItemStyle HorizontalAlign="Right" />
                        </telerik:GridMaskedColumn>
 
                        <telerik:GridBoundColumn FilterControlWidth="310px" DataField="Product" HeaderText="Product"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains"
                            ShowFilterIcon="false">
                        </telerik:GridBoundColumn>
 
                        <telerik:GridButtonColumn ButtonType="PushButton" CommandName="DeleteItem" Text="DeleteItem" UniqueName="DeleteItem" HeaderText="DeleteItem">
                        </telerik:GridButtonColumn>
                         
                        <telerik:GridButtonColumn ButtonType="PushButton" CommandName="VerifyItem" Text="VerifyItem" UniqueName="VerifyItem" HeaderText="VerifyItem" >
                        </telerik:GridButtonColumn>
                    </Columns>
                    <HeaderStyle Font-Bold="True" />
                </MasterTableView>
                <ExportSettings>
                    <Pdf PageWidth="">
                    </Pdf>
                </ExportSettings>
                <ClientSettings EnableRowHoverStyle="true" AllowDragToGroup="True">
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                <GroupingSettings CollapseAllTooltip="Collapse all groups" />
                <SortingSettings SortedBackColor="#FFF6D6" EnableSkinSortStyles="false" />
                <HeaderStyle Width="100px" />
                <FilterMenu RenderMode="Lightweight" />
                <HeaderContextMenu RenderMode="Lightweight" />
            </telerik:RadGrid>
            </telerik:RadAjaxPanel>
        </div
 
    </form>
</body>
</html>

 

aspx.cs code:

public partial class WebForm1 : System.Web.UI.Page
 {
     protected void Page_Load(object sender, EventArgs e)
     {
         if (!IsPostBack)
         {
             StartDateTimePicker.SelectedDate = DateTime.Now.AddDays(-14);
             EndDateTimePicker.SelectedDate = DateTime.Now;
             LoadDataForRadGrid1();
         }
     }
 
     private void LoadDataForRadGrid1()
     {
 
         RadGrid2.DataSource = GetDataTable(StartDateTimePicker.FocusedDate, EndDateTimePicker.FocusedDate);
         RadGrid2.DataBind();
     }
 
     public DataTable GetDataTable(DateTime startDateTime, DateTime endDateTime)
     {
         string query = @"select * from [dbo].[ufGetList]()";
 
         String connectionString = ConfigurationManager.ConnectionStrings["ProjectConnectionString"].ConnectionString;
         DataTable myDataTable = new DataTable();
 
         using (SqlConnection conn = new SqlConnection(connectionString))
         {
             SqlCommand cmd = new SqlCommand(query, conn);
             conn.Open();
             SqlDataAdapter adapter = new SqlDataAdapter
             {
                 SelectCommand = new SqlCommand(query, conn)
             };
             adapter.Fill(myDataTable);
             conn.Close();
         }
 
         return myDataTable;
     }
 
     protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
     {
         if (e.CommandName == "DeleteItem")
         {
 
         }
     }
 
     protected void RadGrid2_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
     {
         (sender as RadGrid).DataSource = GetDataTable(StartDateTimePicker.SelectedDate.Value, EndDateTimePicker.SelectedDate.Value);
     }
 
 }

 

Thanks.

Peter Milchev
Telerik team
 answered on 31 Aug 2017
1 answer
205 views

Hello,

we are using a RadEditor to save from content dynamically inserted into web pages.

 

Recently, some html tags inserted into the Html window of the RadEditor have started to be stripped (was working before). I have tried all options suggested around, and I finally found where the problem is coming from.

We upgraded our version of Word. Word now seems to have switched to html content, so some html code (<iframe> code) is now stripped away from the text.

 

This happens during the javascript call to OnClientSubmit :

    function OnClientSubmit(editor) {
        alert(editor.get_html()); // code is here
        editor.fire("FormatStripper", { value: "WORD" });
        alert(editor.get_html()); // code is not here anymore
    }

The code typed in the editor is this :

<b>Before Iframe</b>

<iframe src="http://alpedhuez.roundshot.com/3060/" scrolling="no" seamless="" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" width="640" height="360" frameborder="0"></iframe>

<b>After Iframe</b>

 

The first javascript alert gives this :

<b>Before Iframe</b>

<iframe src="http://alpedhuez.roundshot.com/3060/" scrolling="no" seamless="" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" width="640" height="360" frameborder="0"></iframe>

<b>After Iframe</b><br class="t-last-br">

 

The second alert, after the FormatStripped, gives this :

<b>Before Iframe</b>



<b>After Iframe</b><br class="t-last-br">

 

Is there a way so that the stripped does not remove html tags, and only REAL Word formating ?

I tried several FormatStripped options without success.

We cannot switch back to old Word versions, the editing window is used by several of our customers and we do not have control over their Word version.

 

Do you have any solution to make the stripper work properly (because I don't think the way it is working now is normal).

Regards and thanks

Eric

 

 

Eric
Top achievements
Rank 1
 answered on 31 Aug 2017
2 answers
146 views

Hi All,

I have the following requirement, and looking for some help to see if possible to achieve.

I have an Hierarchy Grid (Declartive Hierarchy).

We need, when the user click add new record on the parent it need to open a row on the parent and child simultaneously (and make the relation between the parent and child).

Moreover we need to be able to add more rows on the child grid (DetailTable) and keep them all open for edit (including the parent grid).

Is it possible to that?

Omer
Top achievements
Rank 1
 answered on 30 Aug 2017
5 answers
180 views
I have a scenario where I'm editing the descriptions of products via an ajax-enabled UI where the user selects a product, and then edits the description for that product.  Each image has its own image gallery, which I am handling through a custom FileBrowserContent Provider in order to be able to provide access to the specific product's images while editing the description.

I've chosen to set the ViewPaths of the editor to tell the image manager which image library to access.

Since this is done via a completely Ajax-enabled interface, I need to be able to set the ViewPaths from the client when the user selects the product (at the same time an Ajax function is called to get the current description from the database and populate the editor with that content).

Of course, I'm open to any other suggestions for passing the Product ID to the Image Manager if there's a better way.

I thought of setting a session variable when the Ajax method is called, but that would interfere with the ability to have two windows open at the same time, and I'd prefer not to have that sort of limitation.

Thank you for your assistance.
Trevor
Top achievements
Rank 1
 answered on 30 Aug 2017
3 answers
187 views

Hello,

I have a radeditor on my page and I am utilizing the image upload feature. Works fine and speedy when running local, but when I run off of our production server, I can select an image to upload from the image manager that pops up from the rad editor.

I select my image, and then the image name is on the Upload control, but has a Yellow circle to the left of the image name (see attached). There appears to be a progress bar (thin line under the image name) that goes to the end, yet the system just hangs there. Only think I can do is to cancel out of the upload.

Any ideas why this would hang?

Thank you - Lynn

Rumen
Telerik team
 answered on 30 Aug 2017
1 answer
584 views

I have defined a RadGrid code behind completely only using a PlaceHolder in the aspx file that adds the myRadGrid objects. I Also definde the event handlers for "NeedDataSource" and "DetailTableDataBind":

myRadGrid.NeedDataSource += new GridNeedDataSourceEventHandler(needDataSource);
myRadGrid.DetailTableDataBind += new GridDetailTableDataBindEventHandler(detailTableDataBind);

I also want to define the event handler for PreRender, however, I cannot find the appropriate initialisation class handler to set myRadGrid.PreRender += ...?

I suppose it must be something like  GridPRerenderEventHandler(...) but I do not find it in the RadGrid.. !?!?!?!?

Any help is appreciated.

Many Thanks!

Eyup
Telerik team
 answered on 30 Aug 2017
1 answer
154 views

Is there a way to connect shapes to connectors, rather than simply shapes to shapes? I have a requirement that needs a shape to connect to the mid-point of a connector between two shapes. I've tried a work around having 2 connectors from the same point on one shape without any success.

Attached is a rough idea of what I want to do, so want to connect the vertical line from the horizontal connector to the bottom shape.

Any suggestions gratefully received! Thanks.

 

Vessy
Telerik team
 answered on 30 Aug 2017
8 answers
412 views
Hello,

I have exprienced an issue with the Rad Window whereas, when its opened (using any method) and it appears partially off screen (outside of the browser window; maybe it loads at top or your browser window is minimized, etc.), you cannot scroll to see the top of the rad window; it's like hidden under the browser itself (favorites bar, menu bar, etc.). Is there a way to move the window or scroll to the top to see the full window (for example you might have a title or options like close, minimize, etc. in the window).

Anyone else have a similiar issue or a work around -- would be much appreciated and great!!

Thank you very much.
Anders
Top achievements
Rank 1
 answered on 30 Aug 2017
0 answers
71 views

Use Case: Client has 3D files and Video Files.

1. Is uploading 900 GB (Yes GB) file possible with this, AsyncUpload control?

2. In case of such a large file, what would happen to the server resources - does it directly write to the IO stream or keeps the file in memory? 

 

S
Top achievements
Rank 1
 asked on 30 Aug 2017
1 answer
116 views
We are using the latest Telerik UI controls for asp.net Ajax. We have an IE only issue. When have a Grid that is batch editing enabled. When clicking the cell, it is supposed to open the RadComboBox dropdown. But For IE (I'm using IE11) this dropdown doesn’t stay open for user to choose an item, immediately closes itself when trying to edit. This issue doesn’t happen in other browsers. Any ideas please?
Fakhrul
Top achievements
Rank 1
Iron
 answered on 30 Aug 2017
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?