Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
163 views
Dear Telerik-Staff,

in my application, I have an aspx-Page which stores a RadGrid. I am storing all the grid filter (filters, expansions, page) in memory, I am using "Session state" to storing it and i use javaScript for call the method in c#. What should be the right way to apply filters, expansions rows and page? Thanks.
Code: <ClientSettings>
            <ClientEvents OnCommand="RadGridOrders_Command" OnHierarchyCollapsed="RadGridOrders_HierarchyCollapsed" OnHierarchyExpanding="RadGridOrders_HierarchyExpanding" OnDataBound="RadGridOrders_OnDataBound"/>
</ClientSettings> <script> //START SAVE FILTER
function RadGridOrders_Command(sender, args) {
            spinner.spin(spinTarget);
            args.set_cancel(true);
            commandName = args.get_commandName();
            if (commandName == "Page" || commandName == "Filter") {
                for (var i = 0; i < tableView.get_pageSize() ; i++) {
                    tableView.collapseItem(i);
                }
                SaveOrderStatusState(); //Hear i save the filter to memory
            }
} function SaveOrderStatusState() {
            var expandRow = new Array();
            pageIndex = tableView.get_currentPageIndex();
            pageSize = tableView.get_pageSize();
            sortExpression = tableView.get_sortExpressions().toList();
            filterExpression = tableView.get_filterExpressions().toList();
            selectedOrderDate = cbxOrderDateObject.get_selectedIndex();
            selectedOrderStatus = cbxOrderStatusObject.get_selectedIndex();
            selectedOrderStatusOption = cbxOrderStatusOption.get_selectedIndex();
            //Checking the expanded rows
            for (var i = 0; i < tableView.get_dataItems().length; i++) {
                var row = tableView.get_dataItems()[i];
                if (row.get_expanded() == true) {
                    var value = {row: parseInt(row.get_itemIndexHierarchical())};
                    expandRow.push(value);
                }
            }
            state.pageIndex = pageIndex;
            state.pageSize = pageSize;
            state.sortExpression = sortExpression;
            state.filterExpression = filterExpression;
            state.selectedOrderDate = selectedOrderDate;
            state.selectedOrderStatus = selectedOrderStatus;
            state.exandRow = expandRow;
            state.selectedOrderStatusOption = selectedOrderStatusOption;
            var stateJson = JSON.stringify(state);

            Data.Web.Services.Frontend.SaveOrderStatusState(stateJson, callBackSaveSuccess, CallBackError);
} function callBackSaveSuccess() {
//refreshing the Grid
            if (selectedOrderStatusOption == 0) {
    Data.Web.Services.Frontend.GetOpenOrders(tableView.get_currentPageIndex() * tableView.get_pageSize(), tableView.get_pageSize(),   tableView.get_sortExpressions().toList(), tableView.get_filterExpressions().toList(), updateGrid);
            }
            else {
                Data.Web.Services.Frontend.GetOrders(tableView.get_currentPageIndex() * tableView.get_pageSize(), tableView.get_pageSize(), tableView.get_sortExpressions().toList(), tableView.get_filterExpressions().toList(),
                updateGrid);
          }
        } //END SAVE FILTER //STAR GET FILTER AND APPLY //Load the page     $(document).ready(function () {
            tableView = $find("<%= RadGridOrders.ClientID %>").get_masterTableView();
            spinner = new Spinner(spinOptions);
            spinTarget = document.getElementById('<%=RadGridOrders.ClientID %>');
            commandName = "Load"
            spinner.spin(spinTarget);
            GetOrderStatusState(); //here call the filters
        });
        function GetOrderStatusState() {
            Data.Web.Services.Frontend.GetOrderStatusState(successResponse, CallBackError);
        }       function successResponse(jsonString) {
            var jS = JSON.parse(jsonString);
            if (jS) {
                state = JSON.parse(jS);
                pageIndex = state.pageIndex;
                pageSize = state.pageSize;
                sortExpresion = state.sortExpression;
                selectedOrderDate = state.selectedOrderDate;
                selectedOrderStatus = state.selectedOrderStatus;
                selectedOrderStatusOption = state.selectedOrderStatusOption;

                if (selectedOrderStatusOption == null) {
                    selectedOrderStatusOption = 0;
                }

                //Applying the filter for the comboboxes
cbxOrderDateObject.get_items().getItem(selectedOrderDate).select();
                cbxOrderStatusObject.get_items().getItem(selectedOrderStatus).select();
                cbxOrderStatusOption.get_items().getItem(selectedOrderStatusOption).select();

                //re-formatting the date
                if (state.filterExpression.length > 0) {
                    for (var i = 0; i < state.filterExpression.length; i++) {

                        var filter = state.filterExpression[i];
                        if (filter.FieldName == "OrderDate") {
                            filter.FieldValue = isoDateReviver(filter.FieldValue);
                        }
                    }
                }

                filterExpression = state.filterExpression;
}

           //Applying filter
            if (selectedOrderStatusOption == 0) {
                Data.Web.Services.Frontend.GetOpenOrders(pageIndex * pageSize, pageSize,
                    sortExpression, filterExpression,
                       updateGrid);
            }
            else {
                Data.Web.Services.Frontend.GetOrders(pageIndex * pageSize, pageSize,
                    sortExpression, filterExpression,
                       updateGrid);
            } }
 function updateGrid(result) {
            tableView.set_dataSource(result.Data);
            tableView.dataBind();
            if (commandName == "Filter" || commandName == "Load") {
                tableView.set_virtualItemCount(result.Count);
            }
//Applying expanded rows.       if (state.exandRow.length > 0) {
        for (var i = 0; i < state.exandRow.length; i++) {
              var rowItem = state.exandRow[i];
                if (rowItem != null) {
                tableView.expandItem(rowItem.row);
                  }
            }
                        spinner.stop(spinTarget);
} //END GET FILTER AND APPLY


</script>


Thanks.

Vasil
Telerik team
 answered on 03 May 2013
1 answer
127 views
Hi all,

The scenario is as follows:
I have a datasource, which contains a string called "comments" which has rich text. When I bind it to the Grid, I am trying to display the column as an icon and when user hovers over the icon the tooltip is displayed with the text. I used the following code:
My problem is that the tooltip does not show the formatted rich text, it only displays the normal text, without line breaks etc. Is there any way to show rich text on the tooltip or using any other mechanism inside the grid?

<telerik:GridTemplateColumn HeaderStyle-Width="20px" UniqueName="Comments" AllowFiltering="false"
 ItemStyle-VerticalAlign="Bottom" ItemStyle-HorizontalAlign="Left" HeaderText="Comments">
 <ItemTemplate>
 <asp:Image ID="imgInfo" runat="server" ImageUrl="<% $WSSUrl:~info.png%>" />
<telerik:RadToolTipManager runat="server" ID="radTTMgrInfo"  Position="BottomRight" RelativeTo="Element" Width="600px" Height="600px" Animation="Fade" ShowCallout="false" OffsetX="-70" OffsetY="-1" ShowDelay="0" ShowEvent="OnMouseOver" HideEvent="FromCode" OnClientBeforeHide="OnClientBeforeHide" OnClientShow="OnClientShow" Text=' <%# Eval("Comments") %>' ContentScrolling="Y">
<TargetControls>
 <telerik:ToolTipTargetControl TargetControlID="imgInfo" />
 </TargetControls>
 </telerik:RadToolTipManager>
</ItemTemplate>
</telerik:GridTemplateColumn>
Vasil
Telerik team
 answered on 03 May 2013
8 answers
217 views
I'm using a GridHTMLEditorColumn in the RadGrid to enable rich text editing.

It's all within a custom DNN (4.9) module with Ajax enabled.

I'm using ObjectDataSource to enable automatic Edit/Update for the grid, update works fine in IE, but passes OLD data when used in Firefox.

I narrowed it down to RadEditor problem by replacing GridHTMLEditorColumn with GridBoundColumn - worked just fine in both IE and Firefox.

Please help.

p.s. forgot to mention that the problem is with the "Update" being an ImageButton.

The root of the problem is covered in depth in this thread. To make it work, I had to use a "LinkButton" instead of the ImageButton.
Vasil
Telerik team
 answered on 03 May 2013
1 answer
197 views
I need this bar chart to label each bar with the data from the DataXColumn. The Values range from 1000-1200. The problem is that the chart starts the XAxis range at 0 so all my bars are clustered together in the middle of my chart. If I set Auto Scale to False, all my bars disappear and the XAxis range is 1.-7. How do I set the Xaxis plot range?

<telerik:RadChart runat="server" ID="rcBar" DefaultType="Bar" DataSourceID="sdsBar" Width="600px" Height="500px">         
                 <PlotArea>
                    <XAxis></XAxis>
                 </PlotArea>
                 <Series>
                    <telerik:ChartSeries Name="BarVals" DataYColumn="YCol" DataXColumn="XCol" Type="Bar">
                    </telerik:ChartSeries>   
                </Series>
                <ChartTitle>
                 <TextBlock Text="Chart 1">
                 </TextBlock>
                </ChartTitle>
</telerik:RadChart>
Alex
Top achievements
Rank 1
 answered on 03 May 2013
1 answer
121 views
I have a grid with one template that contains a fieldset tag that doesn't get exported (even if it's entirely empty). The grid has no other columns. Why isn't it showing up? Thanks.

PS Mild concern: It took about five minutes to create this thread, or at least for the response to get back to me, and it's pretty consistent about that.
Kostadin
Telerik team
 answered on 03 May 2013
1 answer
197 views
I have a RadWindow that is loading a URL (i.e. iFrame). The page that is loaded uses a sticky RadAjaxLoadingPanel (setup to cover the entire page). However, I am able to scroll the contents of the RadWindow while the loading panel is being shown over the page. And this gives me access to areas that should be protected by the loading panel. Is there any way to move or center the loading panel when a scroll happens in the RadWindow? Maybe somehow get a reference to the RadWindow's iFrame from the inner page so I can bind to the scroll event and change the top attribute of the loading panel accordingly? Or is there some way to put a loading panel in the RadWindow and trigger it from the inner page?
Eyup
Telerik team
 answered on 03 May 2013
13 answers
1.2K+ views
In RadEditor Prometheus we removed the need for RadControls folder by integrating all dialogs inside the Telerik.Web.UI assembly. However, the dialogs have to be displayed in separate page, so you need to add a setting in your root web.config:
<httpHandlers>
 <add path="Telerik.Web.UI.DialogHandler.aspx" verb="*"
  type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI,
  Version=2007.2.918.0, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
  validate="false" />
</httpHandlers>

Note that if you use newer Telerik.Web.UI assembly, you might need to update its version (highlighted above).

To make the job easier, RadEditor Prometheus has a verb for adding this setting in its smart tag (it is shown only if the setting is not already present):



I hope this helps,

Valeri Hristov
Rumen
Telerik team
 answered on 03 May 2013
3 answers
73 views
I use Asp_Calendar Control to set Scheduler SelectedDate. In Edit or Insert Form if EndTime and StartTime do not change everything is ok and selected Date in e.Appointment.Start.Date and e.Appointment.End.Date is equal to Calendar and Scheduler selectedDate.
But when user changes startTime and endTime in Edit or Insert Form, e.Appointment.Start.Date and e.Appointment.End.Date are equal to first initialized scheduler selectedDate
Plamen
Telerik team
 answered on 03 May 2013
1 answer
151 views
Hi,

Does radtextbox got any inbuilt password strength checking mechanism?

Thanks,
Henry.
Shinu
Top achievements
Rank 2
 answered on 03 May 2013
7 answers
194 views
I've already submitted cases regarding the following bugs, but I'm posting this so that the community is aware of a multitude of issues with the RadInputManager's MaskedTextBoxSetting. This aspect of the RadInputManager was clearly not ready for release, and needs to be addressed immediately.

1. RadInputManager MaskedTextBoxSetting Fails to Persist Data if TargetInput is never focused

RadInputManager's MaskedTextBoxSetting fails to persist data (TextBox.Text) to a postback if the TargetInput is never focused.  If you set the TargetInput's value at design time, populate it in code-behind, or bind it via a data source, then submit the page without ever focusing the target control, the value does not persist to postback.

HTML:
<asp:ScriptManager ID="sm" runat="server">
</asp:ScriptManager>
<rad:RadInputManager ID="ram" runat="server">
    <rad:MaskedTextBoxSetting BehaviorID="phone" Mask="(###) ###-####">
        <TargetControls>
            <rad:TargetInput ControlID="txtPhone" />
        </TargetControls>
    </rad:MaskedTextBoxSetting>
</rad:RadInputManager>
<asp:TextBox ID="txtPhone" runat="server" Text="1234567890" />
<asp:Button ID="btn" runat="server" Text="Submit" />

VB.Net
Protected Sub btn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn.Click
 
    Dim phone As String = txtPhone.Text
 
End Sub

2. RadInputManager SelectionOnFocus="None" does not work in IE

No matter where in the textbox you place the cursor, it moves the caret to the beginning.
Link to Feedback Portal

3. Number pad does not input text into RadInputManager with MaskedTextBoxSetting

When setting a MaskedTextBoxSetting, RadInputManager prevents numeric values to be entered from the keyboard's number pad into the extended text box.
Link to Feedback Portal

4. Highlighting the mask of a textbox with a RadInputManager MaskedTextBoxSetting prevents text entry

When setting a MaskedTextBoxSetting and the mask in the extended text box is highlighted, RadInputManager prevents any value from being entered.
Link to Feedback Portal
Vasil
Telerik team
 answered on 03 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?