Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
254 views
Im trying to filter Grid with Javascript

<telerik:radgrid ID="RadGrid1" runat="server" AutoGenerateColumns="True"  AllowSorting="True" ShowGroupPanel="True" GroupingEnabled="True" DataSourceID="SqlDataSource1"                 OnExcelMLWorkBookCreated="RadGrid1_ExcelMLWorkBookCreated" OnGroupsChanging="RadGrid1_OnGroupsChanging"                  AllowFilteringByColumn="true">
                <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                <ClientSettings ReorderColumnsOnClient="false" AllowDragToGroup="True" AllowColumnsReorder="false">
                    <Selecting AllowRowSelect="false"></Selecting>
                    <Resizing AllowRowResize="False" AllowColumnResize="False" EnableRealTimeResize="True"
                        ResizeGridOnColumnResize="False"></Resizing>
                </ClientSettings>
                <GroupingSettings ShowUnGroupButton="true"></GroupingSettings>
</telerik:radgrid>

Here is Javascript
var grid  = $find('ctl00_MainContent_RadGrid1');
var master = $find('ctl00_MainContent_RadGrid1').get_masterTableView();
master.filter("Type", 'SWITCHED', "EqualTo");
master.filter("Resource", 'POWER', "EqualTo");

Only the second filter applies but not first.

Please suggest  how to apply both, and it would be better suggest n filters
Viktor Tachev
Telerik team
 answered on 05 Aug 2014
9 answers
334 views

I have a RadAjaxLoadingPanel specified as follows in my master page:
<telerik:RadAjaxLoadingPanel id="RadAjaxLoadingPanel1" Runat="server" IsSticky="true" skin="Silk" InitialDelayTime="250" Style="position: absolute; top: 0; left: 0; height: 100%; width: 100%;">             
     </telerik:RadAjaxLoadingPanel>

my understanding is that this code will center the panel on the screen. However, it appears it instead centers it in the context of the entire document. That is, if the page is two screens long, the panel will appear cut in half at the bottom of the screen. Is there a solution to make this work as expected?

Princy
Top achievements
Rank 2
 answered on 05 Aug 2014
1 answer
403 views
how to download files to a specified client folder from server without showing open/save promptin asp.net application?




if (e.CommandName == "download_file")        {            string filename=e.CommandArgument.ToString();            string path=MapPath("~/files/" + filename);            byte []bts=System.IO.File.ReadAllBytes(path);            Response.Clear();            Response.ClearHeaders();            Response.AddHeader("Content-Type", "Application/octet-stream");            Response.AddHeader("Content-Length",bts.Length.ToString());            Response.AddHeader("Content-Disposition","attachment; filename=" + filename);            Response.BinaryWrite(bts);            Response.Flush();            Response.End();        }




Angel Petrov
Telerik team
 answered on 05 Aug 2014
1 answer
473 views
I want to get the current edit mode(Html,Design) of a rad Editor control as an alert ,on button click control.And i want to set rad-editor control same mode even after the post back on button click.

i.e if the mode of a rad-editor control is (HTML),i want the rad-editor to be in same mode (HTML)even after  post-back (buttonclick)

Thanks
Sandeep 
Shinu
Top achievements
Rank 2
 answered on 05 Aug 2014
9 answers
468 views

Hello!  I’ve been using the RadAsyncUpload control and it’s been working great.  Provided is an image of what my screen looks like.  As you can see, I’m using RadAsyncUpload’s ruBrowse button to both upload the files clientside and then force a postback in order to upload the images to the database serverside (one button does all).

However, circled are other controls I’m using on my site.  The problem is that when the client clicks “Upload Pictures,” and the files get uploaded clientside (as you can see with the green dots), it takes a little time to insert them into the database (serverside).  Currently, without the implementation of a wait cursor, the client is able to click any of the other controls on the page:

       -  (RadTabStrip)  Click the Entry Content tab which stops the uploading from happening.

       -  (Asp Buttons)  Click Save/Cancel, which leaves the client in a bad state.

       -  (RadAsyncUpload)  Click the “Upload Pictures” button again to upload more pictures.

I was wondering if there was any way to be able to disable other controls while the uploading is still happening?

Princy
Top achievements
Rank 2
 answered on 05 Aug 2014
1 answer
393 views
I am using a RadGrid with a DataSourceID that of a stored procedure.  When the stored procedure returns no rows, the grid is not showing up with the no records text and no headers.  However, when I removed the configuration DataSourceID="SqlDataSource10", the headers and no records text shows up as expected. I can't seem to get this to work so any help would be appreciated.

<telerik:RadGrid ID="rgExternalSensors" HeaderStyle-BorderStyle="None" HeaderStyle-BackColor="WhiteSmoke"
    GridLines="None" DataSourceID="SqlDataSource10" AllowSorting="False" OnItemCreated="rgExternalSensors_ItemCreated"
    OnItemDataBound="rgExternalSensors_ItemDataBound" PageSize="5" AllowPaging="True" AutoGenerateColumns="False" runat="server"
    OnDeleteCommand="rgExternalSensors_DeleteCommand" OnInsertCommand="rgExternalSensors_InsertCommand"
    OnUpdateCommand="rgExternalSensors_UpdateCommand">                           
    <PagerStyle Mode="NextPrevAndNumeric" PageSizeControlType="None"></PagerStyle>
    <MasterTableView Width="100%" EditMode="InPlace" CommandItemDisplay="Top" AutoGenerateColumns="false"
        InsertItemDisplay="Bottom" InsertItemPageIndexAction="ShowItemOnLastPage">
        <Columns>
            <telerik:GridEditCommandColumn>
            </telerik:GridEditCommandColumn>
           <%-- <telerik:GridBoundColumn DataField="sensor_type_desc" UniqueName="SensorType" HeaderText="Type">
            </telerik:GridBoundColumn>--%>
            <telerik:GridDropDownColumn DataField="sensor_type_desc" UniqueName="ddlSensorType"
                DataSourceID="SqlDataSource11" ListTextField="sensor_type_desc" ListValueField="sensor_type_serial_num" HeaderText="Type">                                   
            </telerik:GridDropDownColumn>
            <telerik:GridBoundColumn DataField="sensor_make_and_model" UniqueName="SensorMake" HeaderText="Make and Model"
                MaxLength="50">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="sensor_serial_num" UniqueName="SensorSerial"
                HeaderText="Serial Number" MaxLength="50">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="sensor_location" UniqueName="SensorLoc" HeaderText="Location"
                MaxLength="50">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="external_sensors_serial_num" UniqueName="SerialNum" HeaderText="SerialNum" Display="false">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="sensor_type_serial_num" UniqueName="TypeSerialNum" HeaderText="TypeSerialNum" Display="false">
            </telerik:GridBoundColumn>
            <telerik:GridButtonColumn CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
            </telerik:GridButtonColumn>
        </Columns>
        <CommandItemSettings AddNewRecordText="Add New" RefreshText="Refresh"></CommandItemSettings>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
    </ClientSettings>
</telerik:RadGrid>
Mark
Top achievements
Rank 1
 answered on 04 Aug 2014
2 answers
158 views
I have a modal that has a source ListBox and a selected ListBox with AllowTransfer="true". I also have AutoPostBackOnTransfer="true" because otherwise the selected items didn't persist. the problem I'm having is that when I transfer an item and there is a postback, the ListBox of selected items moves from the right side of the source to directly below it. I can't figure out why this is happening. See the attached screen shots.

Here is the modal and the button that opens it:

                                            <asp:LinkButton ID="btnDeptDCVL" runat="server" Style="cursor: pointer; text-decoration: underline; padding-left: 10px" Text="Select" />
                                            <ajaxtoolkit:ModalPopupExtender ID="mPopupDept" runat="server" PopupControlID="pnlDept"
                                                TargetControlID="btnDeptDCVL" BackgroundCssClass="modalProgressGreyBackground"
                                                DropShadow="false">
                                            </ajaxtoolkit:ModalPopupExtender>
                                            <asp:Panel ID="pnlDept" runat="server" Height="450px" Width="514px" Style="display: none; background-color: AntiqueWhite;">
                                                <div style="padding: 20px">
                                                    Select Departments from the left. Double-click, drag and drop, or click the arrows to select.<br />
                                                    <telerik:RadAjaxPanel runat="server" ID="rap1">
                                                        <telerik:RadListBox ID="rlbDeptDCVL" runat="server" Width="250" Height="350" TransferMode="Copy"
                                                            AllowTransfer="true" AllowTransferOnDoubleClick="true" EnableDragAndDrop="true" AutoPostBackOnTransfer="true"
                                                            TransferToID="rlbSelectedDeptDCVL">
                                                            <ButtonSettings Position="Right" />
                                                        </telerik:RadListBox>
                                                        <telerik:RadListBox ID="rlbSelectedDeptDCVL" runat="server" Width="220" Height="350">
                                                        </telerik:RadListBox>
                                                    </telerik:RadAjaxPanel>
                                                    <p style="text-align: center;">
                                                        <asp:LinkButton ID="lnkOKDeptDCVL" runat="server" Text="OK" class="label" />
                                                        &nbsp;&nbsp;
                                                        <asp:LinkButton ID="lnkCancelDeptDCVL" runat="server" Text="Cancel" class="label" />
                                                    </p>
                                                </div>
                                            </asp:Panel>
Hristo Valyavicharski
Telerik team
 answered on 04 Aug 2014
1 answer
119 views
I have a SharePoint 2013 Visual Web part which I'm using with a RadHtmlChart and a RadGrid. When the user clicks on a slice of the pie chart I've created, the RadGrid ought to populate with details about that slice. The actual AJAX call itself works as it is supposed to but the RadAjaxManager object appears to not be wrapping anything in UpdatePanels when it renders the HTML. As a result, I get this message:

SCRIPT5022: Sys.InvalidOperationException: Could not find UpdatePanel with ID <panel ID related to control I attempt to attach>. If it is being updated dynamically then it must be inside another UpdatePanel.

I removed the AjaxSettings part of the RadAjaxManager object entirely to make sure that the rest of the page was running OK and it was (of course, it didn't render anything but the method executed successfully). I tried pointing the AjaxUpdatedControl attribute ControlID at any number of things: the original RadGrid, an ASP Panel wrapped around the RadGrid, an empty panel elsewhere on the page, and a button I'd created to test the code behind. In each and every one of these cases, I received the message above. I also explicitly set the RadGrid's "Visible" property to "true", even though in the code behind the OnNeedDataSource event feeds it an empty set and I have a NoRecordsTemplate setting (so it should be visible on its own at all times anyway) but the issue persists.

Below is my ASP page:

01.<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2014.2.618.45, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
02. 
03.<div id="webpart">
04.<telerik:RadAjaxManager runat="server" ID="radAjaxManager1" OnAjaxRequest="radAjaxManager1_AjaxRequest">
05.    <AjaxSettings>
06.        <telerik:AjaxSetting AjaxControlID="radAjaxManager1">
07.            <UpdatedControls>
08.                <telerik:AjaxUpdatedControl ControlID="rgPhaseDetails"></telerik:AjaxUpdatedControl>
09.            </UpdatedControls>
10.        </telerik:AjaxSetting>
11.    </AjaxSettings>
12.</telerik:RadAjaxManager>
13. 
14.<telerik:RadCodeBlock ID="codeBlock" runat="server">
15.    <script type="text/javascript">
16.        function FillDealsRadGrid(sender, args) {
17.            var phase = args.get_category();
18.            $find("<%= radAjaxManager1.ClientID %>").ajaxRequest(phase);
19.        }
20. 
21.    </script>
22.</telerik:RadCodeBlock>
23. 
24.<div id="chartpaneldiv">
25.    <telerik:RadHtmlChart runat="server" ID="rhcDealsByPhase" Width="900" Height="500" Transitions="true" OnClientSeriesClicked="FillDealsRadGrid">
26.        <Appearance>
27.            <FillStyle BackgroundColor="White" />
28.        </Appearance>
29.        <ChartTitle Text="Deals By Phase">
30.            <Appearance Align="Center" BackgroundColor="White" Position="Top"></Appearance>
31.        </ChartTitle>
32.        <Legend>
33.            <Appearance BackgroundColor="White" Position="Right" Visible="true"></Appearance>
34.        </Legend>
35.        <PlotArea>
36.            <Appearance>
37.                <FillStyle BackgroundColor="White" />
38.            </Appearance>
39.        </PlotArea>
40.    </telerik:RadHtmlChart>
41.</div>
42. 
43.<telerik:RadGrid runat="server" ID="rgPhaseDetails" OnNeedDataSource="rgPhaseDetails_NeedDataSource" AutoGenerateColumns="false" EnableAjaxSkinRendering="true" Visible="true" Enabled="true" >
44.    <MasterTableView Visible="true">
45.        <NoRecordsTemplate>
46.            <asp:Label runat="server" Text="No records to display. Please click on a slice of the pie chart above to view this control."></asp:Label>
47.        </NoRecordsTemplate>
48.        <Columns>
49.            <telerik:GridHyperLinkColumn HeaderText="Deal Name" DataTextField="TextField" DataNavigateUrlFields="TextlURL" DataNavigateUrlFormatString="{0}"></telerik:GridHyperLinkColumn>
50.        </Columns>
51.    </MasterTableView>
52.</telerik:RadGrid>
53. 
54.<telerik:RadAjaxLoadingPanel runat="server" ID="rlpLoadingPanel" Height="77px" Width="113px" Skin="Metro"></telerik:RadAjaxLoadingPanel>
55.</div>
Maria Ilieva
Telerik team
 answered on 04 Aug 2014
1 answer
145 views
Hi

I have a pivotgrid with for levels of rows. Is it possible to have sub totals at only certain levels such as the first and second levels? The third and fourth levels are information only.

Thanks in advance for your time.
Chris 
Maria Ilieva
Telerik team
 answered on 04 Aug 2014
1 answer
110 views
Hi

I added some snippets containing HTML5 elements, such as a quote:

<figure>
   
<blockquote>Inset quote</blockquote>
   
<figcaption>Insert source</figcaption>
</figure>

These were wrapped in CDATA tags but when used in the editor, all I got in the source code was <div></div>.

I then wrapped my snippet in <div> tags and got the expected result.


So, should snippets always be wrapped in <div> tags, or this only necessary for those containing HTML5 tags?

Thanks
Ianko
Telerik team
 answered on 04 Aug 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?