Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
346 views

I'm trying to use RadListView with client side binding, everything works well, including the filters, bu they are always concatenated as ANDs and I need some of them to be ORs, so I'm trying to use the builder() featured in this article:
http://www.telerik.com/blogs/client-side-databinding-with-radlistview-for-asp-net-ajax---part-3#filtering

Here's an example of the JSON source this is filtering:
[{"OpportunityId":1,"OpportunityTitle":"\r\nMainframe Programmer for Giftware, Jewellery & Tableware","OpportunityType":"Realocation","ClientImageUrl":"/Client/Images/intel.jpg","ClientName":"Intel","PublishDate":"2016-04-27T00:00:00","PublishDaysSince2000":5961,"ExpiryDaysSince2000":6046,"CountryName":"Portugal","CityName":"Braga","SkillsList":[11,12,13],"Skills":"-11-12-13-","Salary":15000,"ContractTypeId":6,"ScheduleTypeId":2,"CityId":9,"ClientId":7,"ExperienceLevelId":null,"AcademicLevelId":3,"Reference":"AI5MU5PK3CWD","RequestDateDays":5961,"OpportunityStateId":4,"ManagerId":123,"RecruiterId":123,"CategoryId":20},{"OpportunityId":2,"OpportunityTitle":"Microprocessor Researcher","OpportunityType":"Project","ClientImageUrl":"/Client/Images/intel.jpg","ClientName":"Intel","PublishDate":"2016-04-27T00:00:00","PublishDaysSince2000":5961,"ExpiryDaysSince2000":6046,"CountryName":"Portugal","CityName":"Algarve","SkillsList":[11],"Skills":"-11-","Salary":15000,"ContractTypeId":4,"ScheduleTypeId":2,"CityId":10,"ClientId":7,"ExperienceLevelId":null,"AcademicLevelId":3,"Reference":"6PPH62GCRGWP","RequestDateDays":5961,"OpportunityStateId":3,"ManagerId":123,"RecruiterId":123,"CategoryId":21}

...

if I use the add: filterExpressions.add("OpportunityId", Telerik.Web.UI.RadListViewFilterFunction.Contains, 2); the filtering works as expected with ANDs, but no matter what expression i put using the builder, no records ever show.

i.e. if I use this filter: filterExpressions.add("OpportunityId", Telerik.Web.UI.RadListViewFilterFunction.GreaterThanOrEqualTo, 2);

all items with id > 2 show up, but if I use this filter: filterExpressions.build().greaterThan("OpportunityId", 2);

nothing shows up, and the same items should be showing up because its the same expression

attached is a print of what chrome shows as the tree for the filterExpressions object, when using a composite builder expression with one OR

Maria Ilieva
Telerik team
 answered on 17 Jun 2016
12 answers
250 views
Hi,

I've gotten a simple radmenu to work fine on my development computer, but when it is uploaded to the production machine, the RadMenu will not respond to postback.  The radmenu is embedded in a master page that will then control what web pages the user goes to based on the selection from the menu.  Right now the 'Login' and 'Default' pages don't have anything but a marker to see if they load...

I'm just trying to get the basic framework working before fleshing out the menus and pages...

Since it works in VS2010 on my dev machine, I can't see why I would be having trouble on the production computer... (2008R2/ IIS7)

See below for code sample.

Thanks so much for looking at it... I'm stumped.

Master.Master
<%@ Master Language="VB" CodeFile="Master.master.vb" Inherits="Master" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
    <head runat="server">
        <title> Pc. </title>
        <link href="~/Styles/Pc/Site.css" rel="stylesheet" type="text/css"/>
        <asp:ContentPlaceHolder id="head" runat="server">
        </asp:ContentPlaceHolder>
    </head>
    <body>
        <script type="text/javascript"> var flag = false;</script>
        <script type="text/javascript">
            var AjaxIsActive = false;
 
            function RequestSent() {
                if (!AjaxIsActive) {
                    AjaxIsActive = true;
                }
                else {
                    alert('Wait for Page to Load');
                    return false;
                }
            }
 
            function ResponseEnd() {
                AjaxIsActive = false;
            }
        </script>
 
        <form id="form1" runat="server">
            <center>
                <div id="Header">
                    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
                    </telerik:RadScriptManager>
                    <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Office2010Blue" EnableRoundedCorners="true"/>
                    <table id="header">
                        <tr>
                            <td align="left" style="width:300px">
                                <img src="./Images/Pc/Logo.png" alt=""/>
                            </td>
                            <td valign="bottom" align="right">
                                <table>
                                    <tr>
                                        <td>
                                            <telerik:RadMenu ID="Menu1" Runat="server" EnableRoundedCorners="true">
                                            </telerik:RadMenu>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </div>
                <div>
                    <asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">
 
                    </asp:ContentPlaceHolder>
                </div>
                <asp:Label ID="Label1" runat="server" Text=""></asp:Label>
            </center>
        </form>
        <script type="text/javascript"> flag = true;</script>
    </body>
</html>


Master.Master.VB
Imports System
Imports System.Web.UI.WebControls
 
Imports Telerik.Web.UI
 
Partial Class Master
    Inherits System.Web.UI.MasterPage
 
    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load
  
        If Not IsPostBack Then
            Menu1.LoadContentFile("~/App_Data/InMenu.xml")
        End If
 
        If HttpContext.Current.User.Identity.IsAuthenticated = True Then
            Try
                Menu1.FindItemByText("Login").Text = "Logout"
            Catch
            End Try
            'MenuToggle("Gap", True, True)
        End If
        ' Label1.Text += "1"
    End Sub
 
    Private Sub MenuToggle(ByVal theButton As String, ByVal theStatus As Boolean, ByVal theVisibility As Boolean)
        Menu1.FindItemByText(theButton).Enabled = theStatus
        Menu1.FindItemByText(theButton).Visible = theVisibility
    End Sub
 
    Protected Sub Menu1_ItemClick(sender As Object, e As Telerik.Web.UI.RadMenuEventArgs) Handles Menu1.ItemClick
        Label1.Text += "2"
        Select Case e.Item.Text
            Case "Login" : Response.Redirect("~/Login.aspx")
            Case "Logout" : FormsAuthentication.SignOut()
                Response.Redirect("~/Default.aspx")
        End Select
        Label1.Text += "3"
    End Sub
End Class

Nencho
Telerik team
 answered on 17 Jun 2016
3 answers
206 views

In the following masterpage setup AJAX is working correctly but the LoadingPanel is not showing:

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Skin="Default" runat="server" />

<telerik:RadAjaxManager EnableAJAX="true" ID="RadAjaxManager1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RecordOverview">
            <UpdatedControls>
           <telerik:AjaxUpdatedControl ControlID="RecordOverview" LoadingPanelID="RadAjaxLoadingPanel1"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

<asp:contentplaceholder id="RecordOverview" runat="server"></asp:contentplaceholder>

 

Any clue?

 

Marc

Maria Ilieva
Telerik team
 answered on 17 Jun 2016
3 answers
84 views

In a page, we have 9 tabs and we are using radtabstrip and rad multipage to implement this functionality. Now Users are asking split tabs into 3 section and display the pages associated to that below the tab selection as shown in attached images.

Is itpossible to achieve this with single Radtabstrip and rad multipage? if yes can you share a sample code?

Since this is an existing functionality it will be too much work to split into multiple tabs. Also, for some users we need to hide some tab, so it should automatically shift to above tabstrip.

 

 

Ivan Danchev
Telerik team
 answered on 17 Jun 2016
3 answers
200 views

Hi,

I am trying raddiagram to generate dynamic organizational charts.

Every thing worked fine with version 2015.03.930.

But when we upgrade to any other version such as 2015.03.1111 the diagram does not render properly.

here is the markup used for raddiagram:

<telerik:RadDiagram ID="_rdUnit1" ClientIDMode="Static" runat="server" Editable="False" EnableViewState="False"
         OnItemDataBound="_rdUnit1_OnItemDataBound">
 
        <clientevents onclick="OnClick" onload="diagram_load" />
        <%--<layoutsettings enabled="True" type="Tree" subtype="TipOver"></layoutsettings>--%>
        <shapedefaultssettings type="rectangle" height="35" width="110" visual="visualizeShape">
            <StrokeSettings DashType="Solid" Color="Black" Width="0.9"></StrokeSettings>
            <ContentSettings Align="center" Color="Black" FontSize="18" FontFamily="Byekan"></ContentSettings>
            <FillSettings Color="White"></FillSettings>
        </shapedefaultssettings>
        <bindingsettings>
                <ShapeSettings DataIdField="UnitId" DataContentTextField="Name" DataTypeField="ShapeType" DataFillColorField="BackColor"
                     DataStrokeDashTypeField="BorderType" DataXField="Xposition" DataYField="Yposition"
                    DataWidthField="WidthShape" DataHeightField="HeightShape" DataStrokeColorField="BorderColor"
                    DataContentAlignField="FontSize"/>
                <ConnectionSettings DataFromShapeIdField="ParentId" DataToShapeIdField="UnitId" />
            </bindingsettings>
    </telerik:RadDiagram>

I've attached the correct rendering and the one that does not render properly.

Am I doing something wrong?

Vessy
Telerik team
 answered on 17 Jun 2016
3 answers
394 views
Hello!

 

I have a grid with RadComboBox in an EditItemTemplate:

 
<telerik:GridTemplateColumn DataField="Value" HeaderText="Wert">
   <EditItemTemplate>
      <telerik:RadComboBox ID="cboFeatureValue" runat="server" DataSourceID="odsFeatureValueList"
         SelectedValue='<%# Bind("Value") %>' DataTextField="Text" DataValueField="Value"
         Skin="Default">
      </telerik:RadComboBox>
   </EditItemTemplate>
   <ItemTemplate>
      <asp:Label ID="lblFeatureValue" runat="server" Text='<%# Eval("Value") %>'></asp:Label>
   </ItemTemplate>
</telerik:GridTemplateColumn>

 

On some rows, depending on the data, I need a TextBox instead of the RadComboBox. Any idea how to achieve this?

 

I tried adding the TextBox in the EditITemTemplate and disabling the not wanted control:

<asp:TextBox runat="server" Text='<%# Bind("Value") %>' ID="txtFeatureValue"/>

and in here I disable the not wanted control:

Private Sub grdFeatureList_ItemDataBound(sender As Object, e As GridItemEventArgs) Handles grdFeatureList.ItemDataBound
   If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
      Dim dataItem As GridEditableItem = TryCast(e.Item, GridEditableItem)
      If _FeatureParameter.Contains("Enum") Then
         Dim textBox As TextBox = CType(dataItem.FindControl("txtFeatureValue"), TextBox)
         textBox.Enabled = False
         textBox.Visible = False
      Else
         Dim radComboBox As RadComboBox = CType(dataItem.FindControl("cboFeatureValue"), RadComboBox)
         radComboBox.Enabled = False
         radComboBox.Visible = False
      End If
   End If
End Sub

 

 

The problem is, that the Selecting event of the RadComboBox is called before I can disable the ComboBox. And as I don't have any data for the combo box I get an "Selection out of range" exception.

 

Thanks for helping!

 

Regards,

Tonino.

Eyup
Telerik team
 answered on 17 Jun 2016
1 answer
248 views
Hi,
I am new in Sitefinity and ASP.NET technologies... 
I have 2 issues that I am trying to resolve:
I have a radgrid with 5 columns.
1. The last column of my grid is a GridColumnGroup containing 3 sub-columns corresponding to 3 actions. I would like to display the header for this GridColumnGroup but not displaying the headers for these 3 sub-columns (for now the 3 sub-columns have an empty header each but I would not want to see at all these headers space (removing the header spaces and not having this row for the 3 sub-columns headers).. Is it possible?

2. My second issue is to elaborate a NestedViewTemplate as here:
http://docs.telerik.com/devtools/aspnet-ajax/controls/grid/hierarchical-grid-types-and-load-modes/nestedview-template
I first tried to display (in C#) at least a simple text linked to the first row as follow but this is not working. I am a little bit lost with how to do that programmatically?
ApplicationsGrid.MasterTableView.Items[0].ChildItem.NestedTableViews[0].DataSource = "test expand";
ApplicationsGrid.MasterTableView.Rebind();
Thank you for your help.
Best
Eyup
Telerik team
 answered on 17 Jun 2016
1 answer
79 views

I have figured out how to create a custom FieldEditor with a combobox with checkboxes, however I would like to be able to make multiple selections and set the expression up using IN functionality....instead of EqualTo. For example:

Currently the expression will look like (FieldName = 'value1'). I want to be able to have it look like FieldName IN ('value1', 'value2')

Eyup
Telerik team
 answered on 17 Jun 2016
2 answers
222 views

For GridBoundColumns which have auto generated filters I've written javascript that when a cell is clicked its value is put in the filter text box. Users can then use that value as if they'd typed it into the filter text box.

I have a numeric bound column for which I want the same capability. 

Info I've gathered so far leads me to think I should use the .set_value() command, but all the examples I've found assume I know the control's ID to get it, but because it's auto generated I don't.

At present the numeric value is appearing in the filter text box, but the filter button does not react to its presence.

EG

function CopyNumericValue()

{

var radNumericTextBox1 = $find("<%= RadNumericTextBox1.ClientID %>");

var radNumericTextBox2 = $find("<%= RadNumericTextBox2.ClientID %>");

radNumericTextBox1.set_value(radNumericTextBox2.get_value() + 1);

}

Grid

<telerik:RadGrid runat="server" ID="RadGrid1" RenderMode="Classic" Skin="Office2010Blue" EnableViewState="true" ClientIDMode="AutoID"
    AllowPaging="True" OnPageIndexChanged="RadGrid1_PageIndexChanged" OnPageSizeChanged="RadGrid1_PageSizeChanged"
    AllowSorting="true" OnSortCommand="RadGrid1_SortCommand"
    AllowFilteringByColumn="True" OnNeedDataSource="RadGrid1_NeedDataSource"
    GridLines="Horizontal">
    <AlternatingItemStyle Height="16px" BackColor="#e4eaf1" />
    <ItemStyle Height="16px" />
    <MasterTableView AutoGenerateColumns="false" DataKeyNames="SalesOrderId" ClientDataKeyNames="SalesOrderId">
        <Columns>

           <telerik:GridBoundColumn DataField="SalesOrderId" HeaderText="SalesOrderId" Visible="false"
                UniqueName="SalesOrderId" AllowFiltering="false">
           </telerik:GridBoundColumn>

...

           <telerik:GridBoundColumn DataField="StatusName" HeaderText="Status" UniqueName="StatusName" FilterControlWidth="80%">
                <HeaderStyle Width="10%" HorizontalAlign="Left" />
                <ItemStyle HorizontalAlign="Left" />
           </telerik:GridBoundColumn>

           <telerik:GridNumericColumn DataField="OrderTotal" HeaderText="Total" UniqueName="OrderTotal" FilterControlWidth="60%"
                    DecimalDigits="2" DataFormatString="{0:### ##0.00}">
                <HeaderStyle Width="7%" HorizontalAlign="Right" />
                <ItemStyle HorizontalAlign="Right" />
           </telerik:GridNumericColumn>

    </Columns>
    <PagerStyle PageSizes="10,15,20,25" AlwaysVisible="true" Position="Top" />
    </MasterTableView>
    <ClientSettings>
         <Scrolling AllowScroll="true" UseStaticHeaders="true" />
        <Selecting CellSelectionMode="SingleCell" />
        <ClientEvents OnCellSelecting="populateFilterTextBoxes" />
    </ClientSettings>
</telerik:RadGrid>

Javascript

            function populateFilterTextBoxes(sender, eventArgs) {
                var selectedColumn = eventArgs.get_column();
                var selectedColumnUniqueName = selectedColumn.get_uniqueName();
                var selectedColumnElement = selectedColumn.get_element();
                var selectedColumnCellIndex = selectedColumnElement.cellIndex;

                var selectedRow = eventArgs.get_row();
                var selectedCell = selectedRow.cells[selectedColumnCellIndex];
                var value = selectedCell.innerText;
                var inputs = document.getElementsByTagName("input");
                for (var i = 0; i < inputs.length; i++) {
                    var curInput = inputs[i];
                    //_FilterTextBox_ for normal bound columns
                    if (curInput.id.endsWith("_FilterTextBox_" + selectedColumnUniqueName)) {
                        curInput.innerText = value;//prototype endsWith in DefaultEditor.Master
                        break;
                    }
                    //_RNTBF_ for Numeric columns
                    if (curInput.id.endsWith("_RNTBF_" + selectedColumnUniqueName)) {
                        curInput.innerText = value;
                        break;
                    }
                }
            }

HTML of filter controls

<td style="white-space:nowrap;">
    <input name="RadGrid1$ctl00$ctl02$ctl02$FilterTextBox_StatusName" type="text" size="10" 
        id="RadGrid1_ctl00_ctl02_ctl02_FilterTextBox_StatusName" class="rgFilterBox" alt="Filter StatusName column" 
        onkeypress="if((event.keyCode == 13)) return false;" style="height:22px;width:80%;" />
    <input type="button" name="RadGrid1$ctl00$ctl02$ctl02$Filter_StatusName" value=" " 
        onclick="$find(&quot;RadGrid1&quot;)._showFilterMenu(&quot;RadGrid1_ctl00&quot;, &quot;StatusName&quot;, event); return         false;__doPostBack(&#39;RadGrid1$ctl00$ctl02$ctl02$Filter_StatusName&#39;,&#39;&#39;)" 
        id="RadGrid1_ctl00_ctl02_ctl02_Filter_StatusName" title="Filter" class="rgFilter" />
</td>
<td style="white-space:nowrap;">
    <span id="RadGrid1_ctl00_ctl02_ctl02_RNTBF_OrderTotal_wrapper" class="riSingle RadInput RadInput_Office2010Blue" style="width:60%;">
        <input id="RadGrid1_ctl00_ctl02_ctl02_RNTBF_OrderTotal" name="RadGrid1$ctl00$ctl02$ctl02$RNTBF_OrderTotal" class="riTextBox riEnabled" 
            alt="Filter OrderTotal column" type="text" />
        <input id="RadGrid1_ctl00_ctl02_ctl02_RNTBF_OrderTotal_ClientState" name="RadGrid1_ctl00_ctl02_ctl02_RNTBF_OrderTotal_ClientState"             type="hidden" />
    </span>
    <input type="button" name="RadGrid1$ctl00$ctl02$ctl02$Filter_OrderTotal" value="" 
        onclick="$find(&quot;RadGrid1&quot;)._showFilterMenu(&quot;RadGrid1_ctl00&quot;, &quot;OrderTotal&quot;, event); return         false;__doPostBack(&#39;RadGrid1$ctl00$ctl02$ctl02$Filter_OrderTotal&#39;,&#39;&#39;)" 
        id="RadGrid1_ctl00_ctl02_ctl02_Filter_OrderTotal" title="Filter" class="rgFilter" />
</td>

Chloe
Top achievements
Rank 1
 answered on 17 Jun 2016
3 answers
135 views
I have reviewed Creating Custom Field Editors and successfully built a RadFilter custom editor with a RadComboBox that returns a single value.

Now I would like to take advantage of the RadComboBox.CheckBoxes property in a new RadFilter custom editor. I call this RadFilterDropDownCheckBoxEditor. I can see during debug that SetEditorValues is only returning the first selected value in the RadComboBox.CheckedItems collection:

public override void SetEditorValues(ArrayList values)
{
    if (values != null && values.Count > 0)
    {
        foreach (var item in values)
        {
            if (item == nullreturn;
            var comboItem = _combo.FindItemByValue(item.ToString());
            if (comboItem != nullcomboItem.Checked = true;
        }
    }
}

This implies that the RadFilter is retaining only one value for this custom editor. I would like the RadFilter to support multiple values for a custom editor.

On the client side, the RadFilter generates *_RadFilterDropDownCheckBoxEditorCombo_Input and a corresponding, hidden field *_RadFilterDropDownCheckBoxEditorCombo_ClientState. The _ClientState value holds a "serialized" JSON object with a checkedIndices array. I can literally see this array correctly tracking the multiple values selected in the custom editor's RadComboBox. However, I assert that this state is not correctly persisted by the RadFilter.SaveSettings method.

Can the good people at Telerik show me some sample code for a custom RadFilter editor using  with RadComboBox.CheckBoxes == true?
Marin
Telerik team
 answered on 17 Jun 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?