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

I am changing the pager style mode of a grid from NextPrev to NextPrevNumericAndAdvanced.

I am using a skin file, and the change of the mode is working.

however I am trying to change this for several languages (different skin files are used for that) and I am at a complete loss  about how to change the text parts that were added with the change from NextPrev to NextPrevNumericAndAdvanced

My pagerstyle tag in the skin file looks like this

  <PagerStyle        
FirstPageToolTip=""                            
LastPageToolTip=""                            
PagerTextFormat="Pagina wisselen: {4} &nbsp;Pagina <strong>{0}</strong> van <strong>{1}</strong>, items <strong>{2}</strong> tot <strong>{3}</strong> van <strong>{5}</strong>."                            
PageSizeLabelText="Pagina grootte"                            
PrevPagesToolTip=""                            
PrevPageToolTip=""                           
NextPagesToolTip=""                           
NextPageToolTip=""                            
/>

basically I am looking into a way of changing the red parts in the screenshot.

i.e 2 button texts, and 2 label texts

I suppose I have to change the PagerStyle tag, but I have no idea which variablenames to add/change, or if I can do it by changing the PagerTextFormat.

Anyone knows how to do this?

 

Eyup
Telerik team
 answered on 11 Mar 2016
10 answers
792 views
Hello there. I recently tried using the demo code for the inline grid editing feature hosted on Telerik's website. However, I keep getting the error: Must declare scalar variable '@username'. Any thoughts?

<%@ Page Title="" Language="C#" MasterPageFile="~/Index.master" AutoEventWireup="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register TagPrefix="Custom" TagName="Block" Src="~/Block.ascx" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    </telerik:RadScriptManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

        <script type="text/javascript">
        <!--
            var hasChanges, inputs, dropdowns, editedRow;

            function RowClick(sender, eventArgs) {
                if (editedRow && hasChanges) {
                    hasChanges = false;
                    if (confirm("Update changes?")) {

                        $find("<%= RadGrid1.MasterTableView.ClientID %>").updateItem(editedRow);
                    }
                }
            }

            function RowDblClick(sender, eventArgs) {
                editedRow = eventArgs.get_itemIndexHierarchical();
                $find("<%= RadGrid1.MasterTableView.ClientID %>").editItem(editedRow);
            }

            function GridCommand(sender, args) {
                if (args.get_commandName() != "Edit") {
                    editedRow = null;
                }
            }

            function GridCreated(sender, eventArgs) {
                var gridElement = sender.get_element();
                var elementsToUse = [];
                inputs = gridElement.getElementsByTagName("input");
                for (var i = 0; i < inputs.length; i++) {
                    var lowerType = inputs[i].type.toLowerCase();
                    if (lowerType == "hidden" || lowerType == "button") {
                        continue;
                    }

                    Array.add(elementsToUse, inputs[i]);
                    inputs[i].onchange = TrackChanges;
                }

                dropdowns = gridElement.getElementsByTagName("select");
                for (var i = 0; i < dropdowns.length; i++) {
                    dropdowns[i].onchange = TrackChanges;
                }

                setTimeout(function() { if (elementsToUse[0]) elementsToUse[0].focus(); }, 100);
            }

            function TrackChanges(e) {
                hasChanges = true;
            }
     -->    
        </script>

    </telerik:RadCodeBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    <telerik:AjaxUpdatedControl ControlID="Label1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <br />
    <telerik:RadGrid ID="RadGrid1" DataSourceID="SessionDataSource1" Width="97%" ShowStatusBar="True"
        AllowSorting="True" PageSize="7" GridLines="None" AllowPaging="True" runat="server"
        AllowAutomaticUpdates="True" OnItemUpdated="RadGrid1_ItemUpdated" AutoGenerateColumns="False"
        OnDataBound="RadGrid1_DataBound" Skin="WebBlue">
        <HeaderContextMenu EnableTheming="True">
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
        </HeaderContextMenu>
        <MasterTableView TableLayout="Fixed" DataKeyNames="username" EditMode="PopUp">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn UniqueName="username" DataField="username" HeaderText="username"
                    ReadOnly="True" HeaderStyle-Width="10%" SortExpression="username">
                    <HeaderStyle Width="10%"></HeaderStyle>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn  ReadOnly="true" UniqueName="password" DataField="password" HeaderText="password"
                    HeaderStyle-Width="25%" SortExpression="password">
                    <HeaderStyle Width="25%"></HeaderStyle>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="isAdmin" DataField="isAdmin" HeaderText="isAdmin"
                    HeaderStyle-Width="20%" SortExpression="isAdmin">
                    <HeaderStyle Width="20%"></HeaderStyle>
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="First_name" HeaderText="First_name" SortExpression="First_name"
                    UniqueName="First_name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Last_name" HeaderText="Last_name" SortExpression="Last_name"
                    UniqueName="Last_name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Effective_date" DataType="System.DateTime" HeaderText="Effective_date"
                    SortExpression="Effective_date" UniqueName="Effective_date">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="RAC" HeaderText="RAC" SortExpression="RAC" UniqueName="RAC">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings>
            <ClientEvents OnRowClick="RowClick" OnRowDblClick="RowDblClick" OnGridCreated="GridCreated"
                OnCommand="GridCommand" />
        </ClientSettings>
        <FilterMenu EnableTheming="True">
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
        </FilterMenu>
    </telerik:RadGrid>
    <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server" TextBoxStyle-Width="180px" />
    <telerik:GridDropDownListColumnEditor ID="GridDropDownListColumnEditor1" runat="server"
        DropDownStyle-Width="70px" />
    <telerik:GridCheckBoxColumnEditor ID="GridCheckBoxColumnEditor1" runat="server" CheckBoxStyle-BorderWidth="2" />
    <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server" NumericTextBox-Width="50px" />
    <br />
    <asp:Label ID="Label1" runat="server" EnableViewState="false" />
    <br />
    <asp:SqlDataSource ID="SessionDataSource1" ConnectionString="<%$ ConnectionStrings:RVCConnectionString %>"
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT * FROM [users]"
        runat="server" ConflictDetection="CompareAllValues" UpdateCommand="UPDATE [users] SET [password] = @password,[isAdmin] = @isAdmin,[First_name] = @First_name,[Last_name] = @Last_name,[Effective_date] = @Effective_date,[RAC] = @RAC WHERE [username] = @username">
        <UpdateParameters>
            <asp:Parameter Name="username" Type="String" />
            <asp:Parameter Name="password" Type="String" />
            <asp:Parameter Name="isAdmin" Type="String" />
            <asp:Parameter Name="firstName" Type="String" />
            <asp:Parameter Name="lastName" Type="String" />
            <asp:Parameter Name="Effective_date" Type="DateTime" />
            <asp:Parameter Name="RAC" Type="String" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>
Eyup
Telerik team
 answered on 11 Mar 2016
1 answer
151 views

Telerik Team, 

I have radgrid as below but the filter is not appearing properly. 

Attached is the screen shot of filter dropdown 

 

<telerik:RadGrid ID="rgrdUsers" runat="server" OnNeedDataSource="rgrdUsers_NeedDataSource"  AllowFilteringByColumn="True"
                                        AllowSorting="True" AllowPaging="True" PageSize="10" AutoGenerateColumns="False"  
                                        EnableLinqExpressions="false" OnItemDataBound="rgrdUsers_ItemDataBound" OnItemCreated="rgrdUsers_ItemCreated" Width="100%">
                                        <ClientSettings EnableRowHoverStyle="true">
                                            <Scrolling UseStaticHeaders="true" AllowScroll="true" SaveScrollPosition="true"  />
                                            <Selecting AllowRowSelect="true" />
                                        </ClientSettings>
                                        
                                        <ExportSettings ExportOnlyData="true" FileName="ESR Detail List" IgnorePaging="true"
                                            OpenInNewWindow="true" Excel-Format="ExcelML">
                                        </ExportSettings>
                                        <MasterTableView DataKeyNames="UserID,UserType,RoleID,BusinessUnitID,teamid" CommandItemDisplay="Top" >
                                            <CommandItemSettings ShowAddNewRecordButton="false" ShowRefreshButton="true" ShowExportToExcelButton="false"/>
                                            <Columns>

                                                <telerik:GridBoundColumn DataField="LastName" FilterDelay="200" FilterControlWidth="80px" HeaderStyle-Wrap="false" ItemStyle-Wrap="false" ShowFilterIcon="false" HeaderText="First Name"></telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="FirstName" FilterDelay="200" FilterControlWidth="80px"  HeaderStyle-Wrap="false" ItemStyle-Wrap="false" ShowFilterIcon="false" HeaderText="Last Name"></telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="EmailID" FilterDelay="200" FilterControlWidth="80px" HeaderStyle-Wrap="false" ItemStyle-Wrap="false" ShowFilterIcon="false" HeaderText="EmailID"></telerik:GridBoundColumn>
                                                <%--<telerik:GridBoundColumn DataField="UserTypeName" HeaderText="UserType Name"></telerik:GridBoundColumn>--%>
                                                <telerik:GridBoundColumn DataField="RoleName" FilterControlWidth="80px" HeaderStyle-Wrap="false" ItemStyle-Wrap="false" CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" HeaderText="Role Name"></telerik:GridBoundColumn>
                                                <%--<telerik:GridBoundColumn DataField="AllowEmail" HeaderText="AllowEmail"></telerik:GridBoundColumn>--%>
                                                <telerik:GridBoundColumn DataField="BusinessUnitName" FilterControlWidth="90px" HeaderStyle-Wrap="false" ItemStyle-Wrap="false" HeaderText="Business Unit"></telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn UniqueName="TeamName" DataField="TeamName" HeaderText="Team" HeaderStyle-Wrap="false" ItemStyle-Wrap="false"  >
                                                    <FilterTemplate>
                                                        <telerik:RadComboBox ID="rcmbTeamName" runat="server" DropDownAutoWidth="Enabled" 
                                                            AppendDataBoundItems="true" Height="200px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("TeamName").CurrentFilterValue %>'
                                                            OnClientSelectedIndexChanged="TeamIndexChanged" Width="150px" >
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="All" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                        <telerik:RadScriptBlock ID="radscriptTeamCombo" runat="server">
                                                            <script type="text/javascript">
                                                                function TeamIndexChanged(sender, args) {
                                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                                    tableView.filter("TeamName", args.get_item().get_value(), "EqualTo");
                                                                }
                                                            </script>
                                                        </telerik:RadScriptBlock>
                                                    </FilterTemplate>
                                                    
                                                </telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn UniqueName="ReportingTo" DataField="ReportingTo" HeaderText="Managers" HeaderStyle-Wrap="false" ItemStyle-Wrap="false">
                                                    <FilterTemplate>
                                                        <telerik:RadComboBox ID="rcmbManagers" runat="server" DropDownAutoWidth="Enabled"
                                                            AppendDataBoundItems="true" Height="200px" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ReportingTo").CurrentFilterValue %>'
                                                            OnClientSelectedIndexChanged="ManagerIndexChanged">
                                                            <Items>
                                                                <telerik:RadComboBoxItem Text="All" />
                                                            </Items>
                                                        </telerik:RadComboBox>
                                                        <telerik:RadScriptBlock ID="radscriptManagerCombo" runat="server">
                                                            <script type="text/javascript">
                                                                function ManagerIndexChanged(sender, args) {
                                                                    var tableView = $find("<%# ((GridItem)Container).OwnerTableView.ClientID %>");
                                                                    tableView.filter("ReportingTo", args.get_item().get_value(), "EqualTo");
                                                                }
                                                            </script>
                                                        </telerik:RadScriptBlock>
                                                    </FilterTemplate>
                                                </telerik:GridBoundColumn>

                                                <%-- <telerik:GridBoundColumn DataField="UserName" HeaderText="UserName"></telerik:GridBoundColumn>
                                                <telerik:GridBoundColumn DataField="Passwords" HeaderText="Password"></telerik:GridBoundColumn>--%>
                                                <telerik:GridBoundColumn DataField="IsActive" FilterControlWidth="50px" HeaderText="Active" HeaderStyle-Wrap="false" ItemStyle-Wrap="false"></telerik:GridBoundColumn>

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

 

 

Can you reply ASAP.

Pavlina
Telerik team
 answered on 10 Mar 2016
5 answers
162 views
After giving UseStaticHeaders="true" for telerik grid radmenu item is not fully visible. 
Pavlina
Telerik team
 answered on 10 Mar 2016
19 answers
993 views
Hi,

I am using the radgrid with the template column, where in i am placing the image button in the template column which inturn calling the javascript funtion on clientclick, i want to pass a databinder value to the javascript function, this the code which i am using.

 

<telerik:GridBoundColumn HeaderText="Date" HeaderButtonType="TextButton" DataField="Date">

 

 

<ItemStyle Width="67px" />

 

 

</telerik:GridBoundColumn>

 

 

<telerik:GridTemplateColumn HeaderText="" UniqueName="View">

 

 

<ItemTemplate>

 

 

<asp:ImageButton id="imgbtnView" imageurl="~/Images/btn_View.gif" runat="server" visible= <%# DataBinder.Eval(Container.DataItem, "Status")%> onclientclick="showCaseHistory(<%# Eval(\'Type\')%>);" >

 

 

</asp:ImageButton>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

<telerik:GridBoundColumn HeaderText="Description" HeaderButtonType="TextButton"

 

 

DataField="Description">

 

 

</telerik:GridBoundColumn>

onclientclick="showCaseHistory(<%# Eval(\'Type\')%>);"

this is what the statement i am using, but i am getting the error saying that Error: illegal XML character

kindly advise.

Regards,

Santhosh

 

Arunava
Top achievements
Rank 1
 answered on 10 Mar 2016
1 answer
105 views

Hi,

I have a grid in which i am using static headers. Its working properly when its loaded the first time but when I select a row the details of that particular row is populated and there is a cancel button there. If the user clicks on the cancel button the grid is again populated but this time if I scroll the grid horizontally the headers are fixed there itself and only data is moving.Its working fine in IE 9 compatibility mode but the problem exists in IE9.

I am using Radgrid 2014.2.618.35.

Thanks

Pavlina
Telerik team
 answered on 10 Mar 2016
1 answer
60 views

Please see the attached screenshot, all the skins render with invisible borders on Mac/Safari?

 

Magdalena
Telerik team
 answered on 10 Mar 2016
1 answer
119 views

I have a menu that is bound to a data table. The data table is linked to database.The data table holds two values; RequestID and Company Name.  

What I want is to populate the menu with the company names, and pass the RequestID through the URL to a generic 'details.aspx?id=RequestID'

So what I did was set the DataNavigateUrlField equal to 'RequestID' from the datatable. 

The problem is that it makes the link to JUST the RequestID 

protected void Page_Load(object sender, EventArgs e)
{
 
    //Create datatable to populate menu
    DataTable menu = Utils.sqlutils.GetDataTable("DATABASE", "SELECT [RequestID], [CompanyName] FROM CauseMarketer_Requests WHERE Approved = '0'");
     
 
    updatingMenu.DataSource = menu;
    updatingMenu.DataNavigateUrlField = "RequestID";
    updatingMenu.DataTextField = "CompanyName";
    updatingMenu.DataBind();
 
 
}

So the DOM ends up looking like this

<a class="rmLink rmRootLink" href="19"><span class="rmText">COMPANY NAME</span></a>

What i want is the href to be "details.aspx?id=19"

 

What I've tried

updatingMenu.DataNavigateUrlField = "~details.aspx" + "RequestID";

But this causes a problem with my my databind and won't build. 

 

Joshua
Top achievements
Rank 1
 answered on 10 Mar 2016
2 answers
106 views

I am filling my radgrid from code behind using a iquerable but for some reason the filtering is not working at all even when i click the action button nothing happens am i missing a step?.

 

public IQueryable<Appointment> getAllApointments()
{
  var _appointments = apertureNetEntities.Appointments.Where(f => f.isDeleted == false ).OrderByDescending(o => o.authCreatedDate).ToList();
   return _appointments.AsQueryable();
}

 

protected void Page_Load(object sender, EventArgs e)
{
   rgAppointments.DataSource = _dal.getAllApointments();
   rgAppointments.DataBind();
 
 }

This is really bugging me as I have to apply a softdelete check on my datasource, i cant really use entity datasource.
Viktor Tachev
Telerik team
 answered on 10 Mar 2016
3 answers
541 views
After updating to the latest version of Telerik, 2016.1.113, in javascript eventArgs.get_commandArgument() when called from an OnClientClicking function is returning null instead of the command argument set on the button.  The same applies to the get_commandName function.  When using sender.get_commandArgument() the correct value is returned.  In previous versions the function called on eventArgs returned the correct value.  Was this an intended change or is this a bug?
Danail Vasilev
Telerik team
 answered on 10 Mar 2016
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?