Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
404 views

I'm trying to use the new print button on my rad grid but it is not showing, what am I missing. I'm using VS2013 and I upgraded the Telerik.Web.UI dll to version 2016.2.607.45. below is the example code I put together. The Add New record and the Refresh buttons do show, but not the print

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
<telerik:RadGrid ID="RadGrid1" RenderMode="Lightweight" runat="server" DataSourceID="SqlDataSource2" GridLines="Both" AutoGenerateColumns="true">
<MasterTableView DataSourceID="SqlDataSource2" CommandItemDisplay="Top">
<CommandItemSettings ShowPrintButton="true" ShowRefreshButton="true" />
</MasterTableView>
</telerik:RadGrid>
</div>
</form>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:Northwind %>"
SelectCommand="SELECT top 20 * FROM Customers" >
</asp:SqlDataSource>

</body>
</html>

Pavlina
Telerik team
 answered on 01 Jul 2016
1 answer
133 views

Hi, 

I am using treelist to show heirachical data. 

Both parent and child are stored in same table 

Sample tables: 

SampleTable

  1. id 
  2. parent id 
  3. category id (drop down on editformtemplate)
  4. description

When I am creating a child, the parent category id needs to be shown on edit form template

and when a new parent is being created it should allow user to select the value.

I am using hybrid approach of automatic CRUD operation and using formtemplate

Can this be done?

 

Regards, 

Swapnil

Viktor Tachev
Telerik team
 answered on 01 Jul 2016
1 answer
89 views

Hi,

The screenshot attached doesn't show the mouse location, but I am hovering over the Acrobat PDF icon in the grid and the tooltip shows "Export to Excel".  Clicking it exports to Excel.

Hovering over the CSV icon shows the tooltip "Export to PDF" and clicking exports to PDF.

Hovering over the Excel icon shows the tooltip "Export to Word" and clicking exports to Word.

 

This doesn't happen when using the Metro theme; only Bootstrap...maybe others, but I'm only using these 2 themes.

Pavlina
Telerik team
 answered on 01 Jul 2016
5 answers
406 views
Hi,
I have three GridDropDownColumns in my Radgrid:
      <telerik:GridDropDownColumn UniqueName="AddressCountry" ListDataMember="AddressCountry" ColumnEditorID="AddressCountryColumnEditor" HeaderStyle-Width="200"
                                SortExpression="Id" ListTextField="Name"
                                ListValueField ="Id" HeaderText="Country" DataField="CountryId" />
 
                     
                            <telerik:GridDropDownColumn UniqueName="AddressProvinceState" ListDataMember="AddressProvinceState" ColumnEditorID="AddressProvinceStateColumnEditor" HeaderStyle-Width="200"
                                SortExpression="Id" ListTextField="Name"
                                ListValueField ="Id" HeaderText="Province/State" DataField="ProvinceStateId" />
 
                     
                            <telerik:GridDropDownColumn UniqueName="AddressCity" ListDataMember="AddressCity" ColumnEditorID="AddressCityColumnEditor" HeaderStyle-Width="200"
                                SortExpression="Id" ListTextField="Name"
                                ListValueField ="Id" HeaderText="City" DataField="CityId" />


What I want to do is when in edit mode, when the selection of Country or ProvinceState dropdown change, the datasource of the sub dropdowns change. What I tried is this:
protected void grid_GridItemCreated(object sender, GridItemEventArgs e)
    {
        if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))
        {
 
            GridEditableItem edititem = (GridEditableItem)e.Item;
            int LocationId = Convert.ToInt32(edititem.GetDataKeyValue("LocationId"));
            DataSet dsAddress = somefunction(LocationId);
 
            list1.DataSource = dsAddress.Tables["AddressProvinceState"];
            list1.DataTextField = "Name";
            list1.DataValueField = "Id";
            list1.DataBind();
            RadComboBox list2 = (RadComboBox)edititem["AddressCity"].Controls[0];
            list2.DataSource = dsAddress.Tables["AddressCity"];
            list2.DataTextField = "Name";
            list2.DataValueField = "Id";
            list2.DataBind();
 
            list.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(list_SelectedIndexChanged);
            list.AutoPostBack = true;
 
            list1.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(list1_SelectedIndexChanged);
            list1.AutoPostBack = true;
        }
    }
 
private void list_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
 
        RadComboBox list = (RadComboBox)sender;
        GridDataItem editItem = (GridDataItem)list.NamingContainer;
        GridEditManager editMan = editItem.EditManager;
        GridDropDownListColumnEditor editor1 = editMan.GetColumnEditor("AddressProvinceState") as GridDropDownListColumnEditor;
        GridDropDownListColumnEditor editor2 = editMan.GetColumnEditor("AddressCity") as GridDropDownListColumnEditor;
 
         
 
 
        DataTable dtProvinceState = ProvinceForCountry(Convert.ToInt32(list.SelectedValue));
        DataTable dtCity = CityForProvince(Convert.ToInt32(dtProvinceState.Rows[0]["Id"]));
 
        editor1.DataSource = dtProvinceState;
        editor1.DataTextField = "Name";
        editor1.DataValueField = "Id";
        editor1.DataBind();
        editor2.DataSource = dtCity;
        editor2.DataTextField = "Name";
        editor2.DataValueField = "Id";
        editor2.DataBind();
 
    }
 
 
    private void list1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
 
        RadComboBox list = (RadComboBox)sender;
        GridEditFormItem editItem = (GridEditFormItem)list.NamingContainer;
        GridEditManager editMan = editItem.EditManager;
        GridDropDownListColumnEditor editor = editMan.GetColumnEditor("AddressCity") as GridDropDownListColumnEditor;
 
         
 
        DataTable dtCity = CityForProvince (Convert.ToInt32(list.SelectedValue));
        editor.DataSource = dtCity;
        editor.DataTextField = "Name";
        editor.DataValueField = "Id";
        editor.DataBind();
 
    }
the tables are retrieved correctly, but when I do databind for the dropdown, it doesn't bind with the new tables, still bind with the old ones.
Can I get some help for this?
Thanks
Viktor Tachev
Telerik team
 answered on 01 Jul 2016
2 answers
190 views

I am missing the document manager button from my radeditor, hyperlink manager menu.

how do i enable it?

i have attached how my link manager look like and assembly information for Telerik.Web.UI.dll

ToolsFile.xml

<root>
    <modules>
        <module name="RadEditorDomInspector" />
    </modules>
    <tools>
        <tool name="Cut" shortcut="CTRL+X" />
        <tool name="Copy" shortcut="CTRL+C" />
        <tool name="Paste" shortcut="CTRL+V" />
        <tool name="Undo" shortcut="CTRL+Z" />
        <tool name="Redo" shortcut="CTRL+Y" />
        <tool separator="true" />
        <tool name="FontName" />
        <tool name="FontSize" />
        <tool name="Bold" shortcut="CTRL+B" />
        <tool name="Italic" shortcut="CTRL+I" />
        <tool name="Underline" shortcut="CTRL+U" />
        <tool name="StrikeThrough" />
        <tool name="Subscript" />
        <tool name="Superscript" />
        <tool name="BackColor" />
        <tool name="ForeColor" />
        <tool name="FormatStripper" />
    </tools>
    <tools>
        <tool name="InsertUnorderedList" />
        <tool name="InsertOrderedList" />
        <tool name="Outdent" />
        <tool name="Indent" />
        <tool name="JustifyLeft" />
        <tool name="JustifyCenter" />
        <tool name="JustifyRight" />
        <tool name="JustifyFull" />
        <tool separator="true" />
        <tool name="ApplyClass" />
        <tool separator="true" />
        <tool name="AjaxSpellCheck" />
        <tool separator="true" />
        <tool name="FormatBlock" />
        <tool name="InsertHorizontalRule" />
  </tools>
    <tools>
        <tool name="InsertTable" />
        <tool name="ToggleTableBorder" />
        <tool separator="true" />
        <tool name="InsertImage" />
        <tool name="InsertLink" />
    <tool name="Unlink" />
        <tool separator="true" />
        <tool name="Help" />
    </tools>
 
  <contextMenus>
        <contextMenu forElement="*">
            <tool name="Cut"/>
            <tool name="Copy"/>
            <tool name="Paste"/>
        </contextMenu>
    </contextMenus>
    <classes>
        <class name="Clear Class" value="" />
        <class name="Normal" value=".ms-rteStyle-Normal" />
        <class name="Highlight" value=".ms-rteStyle-Highlight" />
        <class name="By Line" value=".ms-rteStyle-Byline" />
        <class name="Tag Line" value=".rteStyle-Tagline" />
        <class name="Comment" value=".ms-rteStyle-Comment" />
        <class name="References" value=".ms-rteStyle-References" />
        <class name="Caption" value=".ms-rteStyle-Caption" />
    </classes>
</root>

aspx file

<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<telerik:RadEditor ID="radEmail" runat="server" ToolsFile="/editor/ToolsFile.xml">
</telerik:RadEditor>

Vessy
Telerik team
 answered on 01 Jul 2016
4 answers
381 views
Is there way to navigate to next page of wizard by click on the content itself (eg. Gridview row ) instead of clicking on the previous and next button on wizard ? I do not want to use "next" and "previous" button that comes with the wizard. For previous button I just want to use wizard tab itself but for next button I want to use content on page itself ( may be button on content page itself or table row etc ). Can this be achieve in wizard ?
Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 01 Jul 2016
5 answers
125 views
Hi.

My existing dataform was pulling through the data fields just fine, but I needed to separate them into category’s so decided to use the RadPanelBar.
But now the fields with in the RadPanelBar wont display.
It seems silly that you have to rebind this data all over again when the dataform has it already, is there a way to pass through the dataform data into RadPanelBar. After all its sitting in its itemtemplate!

Many Thanks

Mark

<itemtemplate>
 
        <div class="rdfRow">
            <asp:Label ID="p_codeLabel2" runat="server" CssClass="rdfLabel" Text="p_code"></asp:Label>
            <asp:Label ID="p_codeLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("p_code") %>' />
        </div>
        <div class="rdfRow">
            <asp:Label ID="p_nameLabel2" runat="server" CssClass="rdfLabel" Text="p_name"></asp:Label>
            <asp:Label ID="p_nameLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("p_name") %>' />
        </div>
 
        <telerik:RadPanelBar RenderMode="Lightweight" runat="server" ID="RadPanelBar2" Width="90%" ExpandMode="MultipleExpandedItems" >
            <Items>
                <telerik:RadPanelItem Expanded="True" Text="Product key Information">
                    <ContentTemplate>
                        <div class="rdfRow">
                            <asp:Label ID="p_descriptionLabel2" runat="server" CssClass="rdfLabel" Text="p_description"></asp:Label>
                            <asp:Label ID="p_descriptionLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("p_description") %>' />
                        </div>
 
                        <div class="rdfRow">
                            <asp:Label ID="p_dateLabel2" runat="server" CssClass="rdfLabel" Text="p_date"></asp:Label>
                            <asp:Label ID="p_dateLabel1" runat="server" CssClass="rdfFieldValue" Text='<%# Eval("p_date") %>' />
                        </div>
 
 
                  </ContentTemplate>
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelBar>
</itemtemplate>
Viktor Tachev
Telerik team
 answered on 01 Jul 2016
1 answer
320 views

Hi,

I am trying to use the plugin footable on GridView but it does not work. Maybe you would have an idea about my problem?

Here is the code of my ascx file:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Search.ascx.cs" Inherits="Controls.Search.Search" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>

<link href="https://cdnjs.cloudflare.com/ajax/libs/jquery-footable/0.1.0/css/footable.min.css"
    rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery-footable/0.1.0/js/footable.min.js"></script>
<script type="text/javascript">
    $(function () {
        alert("enter function footable");
        $('[id*=GridView1]').bind('footable_breakpoint', function () {
            $('[id*=GridView1]').trigger('footable_expand_first_row');
        }).footable();
        alert("exit function footable");
    });
</script>
<div>
  <asp:GridView ID="GridView1" CssClass="footable" runat="server"
           AutoGenerateColumns="False">
       <Columns>
           <asp:BoundField DataField="FirstName" HeaderText="First Name"   />
           <asp:BoundField DataField="LastName" HeaderText="Last Name" />
           <asp:BoundField DataField="Email" HeaderText="Email" />
           <asp:BoundField DataField="Contact" HeaderText="Contact" />
       </Columns>
   </asp:GridView>
</div>

Here the cs file that define the grid:

DataTable tab = new DataTable();
            tab.Columns.Add("FIRSTNAME", typeof(string));
            tab.Columns.Add("LASTNAME", typeof(string));
            tab.Columns.Add("EMAIL", typeof(string));
            tab.Columns.Add("CONTACT", typeof(string));
            
            var firstname = "toto";
            var lastname = "toto";
            var email = "toto@email";
            var contact = "loremipsum loremipsum loremipsumloremipsum";
            tab.Rows.Add(new object[] { firstname, lastname, email, contact });

            GridView1.DataSource = tab;
            GridView1.DataBind();

            //Attribute to show the Plus Minus Button
            GridView1.HeaderRow.Cells[0].Attributes["data-class"] = "expand";

            //Attribute to hide column in Phone and Tablet
            GridView1.HeaderRow.Cells[0].Attributes["data-hide"] = "phone,tablet";
            GridView1.HeaderRow.Cells[0].Attributes["data-hide"] = "phone,tablet";

            //Adds THEAD and TBODY to GridView
            GridView1.UseAccessibleHeader = true;
            GridView1.HeaderRow.TableSection = TableRowSection.TableHeader;

The 2 alerts in the javascript are displayed but the table remains unchanged when I resize the window to phone size....

Kostadin
Telerik team
 answered on 01 Jul 2016
7 answers
857 views
In the past I have used something like this:

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)

        {

            if (e.Row.RowType == DataControlRowType.DataRow)

            {

                var dr = (ObjectTypeBeingBound)e.Row.DataItem;

                HyperLink editLink = (HyperLink)e.Row.FindControl("hlEditLink");

                editLink.Attributes.Add("onclick", String.Format("openRadWindow({0},{1})", dr.Id, dr.Name));

            }

        }

How do I do similar with a RadGrid?  My best attempt (not an exact replacement for the above method) so far is:

protected void gvSpecs_ItemDataBound(object sender, GridItemEventArgs e)

        {

            if (e.Item is GridDataItem)

            {

                GridDataItem item = (GridDataItem)e.Item;

                var supplierPartNumber = item.GetDataKeyValue("SupplierPartNumber");

                var setNo = item.GetDataKeyValue("SetNo");

                HyperLink editLink = (HyperLink)item["editAttributes"].Controls[0];

                editLink.Attributes.Add("onclick", String.Format("openRadWindow({0},{1})"

                    supplierPartNumber != null ? supplierPartNumber: String.Empty, 

                    setNo != null ? setNo : String.Empty));                

            }

        }


But I can seem to only access the datakeys and not the rest of the datasource cast as an object.

Thanks
Eyup
Telerik team
 answered on 01 Jul 2016
5 answers
78 views

I have project test schedule (using version 2016.2.504.40). This sourcecode and script Db in attachment.

When I compare data view MonthView default and WeekView default diffrent data.

1. Page1 set SelectedView="MonthView", data show in Date (27-Jun + 28-Jun + 30-Jun). See image: MonthView_Default.JPG (in attachment)

2. Page2 set SelectedView="WeekView", click next week onview, data show in date (28-Jun), but not show in date (27-Jun + 30-Jun). See image: WeekView_Default.JPG (in attachment) 

Why???

The codeBehide the same in two page. only set SelectedView of two page.

How to fix this issue???

Link myWebtest online: http://115.146.121.171:8085/

Nencho
Telerik team
 answered on 01 Jul 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?