Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
471 views
Hi,

I start to work with Telerik RadGrid and i would like to know:

My datasource is an sql stored procedure and contain many fields that i don't want to show. So, is it possible to configure the RadGrid column by column?

In the same way, i need 6 textbox fields at the end of this grid, that user can enter an integer value.

It possible to include textbox in the RadGrid and when the user click save button, to get values programmaticaly in code-behind?

Thanks!
Princy
Top achievements
Rank 2
 answered on 16 May 2014
3 answers
779 views
In my Radgrid CommandItemTemplate, I have a bunch of buttons. Some buttons are hidden to start with and based on the row clicked, they are visible or remain hidden.

I tried the following while adding buttons, which successfully hides the button.
public class MyTemplate : ITemplate
{
    protected RadButton lnkAdd;
    public void InstantiateIn(System.Web.UI.Control container)
    {
        lnkAdd = new RadButton();
        lnkAdd.ID = "BtnAdd";
        lnkAdd.CommandName = RadGrid.InitInsertCommandName;
        lnkAdd.Text = "Add New Record";
        container.Controls.Add(lnkAdd);
     
        lnkAdd = new RadButton();
        lnkAdd.ID = "BtnEdit";
        lnkAdd.Text = "Edit";
        container.Controls.Add(lnkAdd);

        container.Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "hideButtons",
             "\n<script type=\"text/javascript\">"
            //+ "\n$(function(){"           
           + "\n$(document).ready(function ruchi(){"
           + "\n    $(\"#" + lnkAdd.ClientID + "\").hide(); "
           + "\n    return false;"
           + "\n  });"
           + "\n</script>"
       );
    }
}

OnRowSelected I have this:
function OnRowSelected(sender, args) { 
    var clientDataKeyName = args.get_tableView().get_clientDataKeyNames()[0]; 
    var clientDataKeyValue = args.get_tableView().get_selectedItems()[0].getDataKeyValue(clientDataKeyName);
    var grid = args.get_tableView();
    linkButton1 = $telerik.findControl(grid.get_element(), "BtnProposal");
    if (clientDataKeyValue == "Proposal")
    {     
        linkButton1.set_enabled(false);
    }
    else
        linkButton1.set_enabled(true); 
}
But it fails to show the button. Please let me know how can I achieve this.
Also is there a way the the commandItemTemplate is hidden by default and added only on click of a row?
 
Shinu
Top achievements
Rank 2
 answered on 16 May 2014
2 answers
185 views
Currently I'm working on listbox with checkbox selection for transfer purpose. I'm able to transfer the checked item in source to destination listbox with the following script.
function clientTransfering(sender, args) {
        args.set_cancel(true);
        var checkedNodes = args.get_sourceListBox().get_checkedItems();
        for (var i in checkedNodes) {
            var item = checkedNodes[i];
            args.get_sourceListBox().transferToDestination(item);
        }
    }
But I not able to transfer checked item from destination listbox back to the source listbox.
Is there any way of transferring destination listbox item with checkbox back to the source listbox?
Kenny
Top achievements
Rank 1
 answered on 16 May 2014
6 answers
643 views
Hello,

I have 2 forms with a RadGrid within RadDock.
Issue is, Height of the RadGrid is not coming proper.

I tried setting Height of RadGrid to 100%.
I tried setting the table's property : style="table-layout:fixed"
Either height is too less to see even headers. Or of rows is too big.
I want height of the grid to be adjusted automatically based on number of records.

Please help me on this.

Thanks.
Jimmy.

Here is my code for dock and grid:


<div>&lt;telerik:RadDockLayout ID="dockLayoutContainerEntityType" runat="server"&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;telerik:RadDockZone ID="dockZoneActionZone" runat="server" Orientation="Vertical" BorderStyle="None"&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;telerik:RadDock ID="dockActions" Skin="Office2007" runat="server" Title="Container-EntityType Mapping" Width="100%" style="margin-bottom:7px"</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;EnableAnimation="false" EnableRoundedCorners="true" &nbsp;Resizable="false" EnableDrag="false" DockMode="Docked"&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DefaultCommands="None" &gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ContentTemplate&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;table cellspacing="0" cellpadding="0" border="0" width="100%" height="100%" style="table-layout:fixed"&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&lt;tr valign="top" align="center" style="height:100%"&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td valign="top" align="center" style="height:100%"&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;telerik:RadGrid ID="gridTest" runat="server" Skin="Office2007" &nbsp;Width="60%"&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;IsConfigDrivenGrid="false" AutoGenerateColumns="false" AllowPaging="true" PagerStyle-AlwaysVisible="true"&nbsp;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;AllowMultiRowSelection="true" AllowFilteringByColumn="false" ShowGroupPanel="false"&nbsp;&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;Selecting AllowRowSelect="true" /&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;Scrolling AllowScroll="true" /&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/ClientSettings&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;MasterTableView Height="90%"&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;Columns&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;telerik:GridTemplateColumn Visible="false"&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ItemTemplate&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:HiddenField ID="hdnMappingId" runat="server" Value='&lt;%#DataBinder.Eval(Container.DataItem, "Id")%&gt;' /&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;asp:HiddenField ID="hdnEntityTypeId" runat="server" Value='&lt;%#DataBinder.Eval(Container.DataItem, "EntityTypeId")%&gt;' /&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/ItemTemplate&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/telerik:GridTemplateColumn&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;telerik:GridClientSelectColumn HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="10%" /&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;telerik:GridBoundColumn HeaderText="Entity Type" DataField="Name" UniqueName="Name"&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;HeaderStyle Width="90%" HorizontalAlign="Left" /&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;ItemStyle Width="90%" HorizontalAlign="Left" /&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/telerik:GridBoundColumn&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/Columns&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/MasterTableView&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/telerik:RadGrid&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/td&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/tr&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;tr&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;td height="10px"&gt;&lt;/td&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/tr&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/table&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/ContentTemplate&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/telerik:RadDock&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/telerik:RadDockZone&gt;</div><div>&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/telerik:RadDockLayout&gt;</div> 
Brad
Top achievements
Rank 1
 answered on 15 May 2014
2 answers
128 views
I have a Telerik file upload control. it renders misaligned to the other items on the page. How can I get the control to render left aligned?

The markup looks like this:

            <table>
                <tr>
                    <td colspan="2">
                        <asp:Label ID="PleaseSelectAFileLabel" runat="server" Visible="false" Text="Please select a file." CssClass="ControlLabel"></asp:Label><br />
                        <asp:Label ID="PleaseSelectAFileType" runat="server" Visible="false" Text="Please select a file type." CssClass="ControlLabel"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div style="font-size:15px; font-weight:bold">File Type</div>
                    </td>
                    <td style="width: 296px" colspan="2">
                        <asp:DropDownList ID="EmployeeImportFormatDropDownList" AutoPostBack="true" runat="server" Width="200px" OnLoad="EmployeeImportFormatDropDownList_OnLoad"></asp:DropDownList>
                        <asp:LinkButton ID="EmployeeImportFormatDownloadLink" runat="server" Text="Download Template" OnClick="EmployeeImportFormatDownloadButton_OnClick" />
                    </td>
                </tr>
                <tr>
                    <td>
                        <div style="font-size:15px; font-weight:bold">File</div>
                    </td>
                    <td colspan="2">
                        <%--<asp:FileUpload ID="DataImportFileUpload" runat="server" Width="400px" EnableViewState="true"/><br />--%>
                        <telerik:RadAsyncUpload runat="server"  ID="DataImportsRadAsyncUpload" MultipleFileSelection="Disabled" MaxFileInputsCount="1" Width="375px" AllowedFileExtensions=".csv" />
                    </td>
                </tr>
                <tr valign="top">
                    <td width="75px"></td>
                    <td style="width: 296px">
                        <asp:Button ID="DataImportFileUploadImportButton" runat="server" Text="Import" OnClick="DataImportFileUploadImportButton_OnClick"/>&nbsp;&nbsp;<asp:Button ID="DataImportFileUploadCancelButton" runat="server" Text="Cancel" OnClick="DataImportUploadCancelButton_OnClick"/><br /><br />
                        <asp:LinkButton ID="DataImportMappingLink" runat="server" Text="Employee Data Import Mapping" PostBackUrl="../Company/ImportDataMapping.aspx"></asp:LinkButton>
                    </td>
                </tr>
            </table>
Tim
Top achievements
Rank 1
 answered on 15 May 2014
3 answers
91 views
I followed the code below to animate the panel bar to slide left/right:

if (pnlHelpPanel) {
                SetUpAnimation(imgHelpPanelTab.id, Telerik.Web.UI.jSlideDirection.Left, pnlHelpPanel);
            }
 
            function SetUpAnimation(image, direction, element) {
                element.style.position = "relative";
                var slider = document.getElementById(image);
 
                var expanded = false;
 
                var expandAnimation = new Telerik.Web.UI.AnimationSettings({});
                var collapseAnimation = new Telerik.Web.UI.AnimationSettings({});
 
                var slide = new Telerik.Web.UI.jSlide(element, expandAnimation, collapseAnimation, false);
 
                slide.initialize();
 
                slide.set_direction(direction);
 
                slider.onclick = function () {
                    element.parentNode.style.visibility = "visible";
                    element.parentNode.style.display = "block";
                    if (!expanded) {
                        slide.expand();
                    } else {
                        slide.collapse();
                    }
                    expanded = !expanded;
                    return false;
                } // end onlick function definition
 
            } // end SetUpAnimation

It works well doing a sliding animation left/right. However, I get an issue when trying to do the animation top/bottom. i changed the jSlideDirection to bottom and there was no sliding animation. Am I doing something wrong on my end or is there no animation for top/bottom?
Hristo Valyavicharski
Telerik team
 answered on 15 May 2014
1 answer
78 views
Hi,

    One of our client want to NOT format the contents when they paste their HTML (in html view). Here is an example. They paste something like this in HTML view

<table><tr style="background-color:#EEE;"><td>Routes</td><td>200</td></tr></table>

and when switch to design view and come back (or save), it turns into like this

<table>
    <tbody>
        <tr style="background-color: rgb(238, 238, 238);">
            <td>Routes</td>
            <td>200</td>
        </tr>
    </tbody>
</table>

Notice that editor not only format the codes (add link breaks etc), but also changes colors to rgb etc. 
Is there any way to prevent this?
thanks
We are using telerik controls version 2012.2.912.35

Ianko
Telerik team
 answered on 15 May 2014
4 answers
216 views
Hi,

I was working on a small sample that will populate a RadGrid using client side code and when I tried using 'get_masterTableView' function the script threw the following error:
"Object doesn't support property or method 'get_masterTableView'"

Here's my code:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestWebMethodCall.aspx.cs" Inherits="RestfulServiceClientApp.TestWebMethodCall" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
         <script src="Scripts/jquery-1.11.1.min.js"></script>
         <script type="text/javascript">
            //<![CDATA[
             $(document).ready(function () {
                 alert('DOM Ready !');
                 $('<%=RadAjaxLoadingPanel1.ClientID%>').show('<%=grd_ajaxifiedGrid.ClientID %>');
                 PageMethods.GetData(successMethod);
 
                 function successMethod(result) {
                     alert(result);
                     var masterTableView = $('<%=grd_ajaxifiedGrid.ClientID %>').get_masterTableView();
                     masterTableView.set_datasource(result);
                     masterTableView.dataBind();
                     $('<%=RadAjaxLoadingPanel1.ClientID%>').hide('<%=grd_ajaxifiedGrid.ClientID %>');
                 }
             });
 
            //]]>
        </script>
    </telerik:RadCodeBlock>
    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="scrptmgr_radScriptManager" EnablePageMethods="true"></telerik:RadScriptManager>
        <telerik:RadGrid ID="grd_ajaxifiedGrid" runat="server" EnableViewState="false" CellSpacing="-1" GridLines="Both" ClientIDMode="Static"
            Width="200" Height="400"></telerik:RadGrid>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
        <div>
        </div>
    </form>
</body>
</html>

and here's my Web Method in the code behind:

[WebMethod]
        public static List<string> GetData()
        {
            List<string> myLst = new List<string>();
            myLst.Add("Test1");
            myLst.Add("Test2");
            myLst.Add("Test3");
            myLst.Add("Test4");
            myLst.Add("Test5");
            return myLst;
        }

Please, help.

Many thanks in advance.
Ahmed Gamil
Top achievements
Rank 1
 answered on 15 May 2014
7 answers
200 views
NUTSHELL
I am exporting a grid that has Grid Column Groups to Excel and making changing the display of several fields from false to true.  The Grid Column Group is not expanding in Excel to handle the columns which are now displayed.

DETAIL
My grid has 16 viewable columns and 6 grid column groups.  When I go to Export to Excel, I change 10 additional columns so the display is true.  These columns are interspersed throughout the grid and not all at the end.  In Excel, the Grid Column Groups do not expand, so if they were 3columns before but now there are 6 columns under that group, it is still only 3 columns wide.  This of course throws everything off.

I am programming in MS Visual Studio 2012.
I am using Telerik UI for ASP.NET AJAX, v.2014.1.225.45

CODE
Protected Sub btnExport_Click(ByVal sender As Object, ByVal e As EventArgs)
 
    Me.RadGrid1.MasterTableView.GetColumn("Location").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_NotIssued").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_NotIssuedReason").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_Qualification").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_EstimatedProjectArea").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_EstimatedConstructionCost").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_WinningProbabilityPct").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_DateGranted").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_ProjectID").Display = True
    Me.RadGrid1.MasterTableView.GetColumn("Proposal_Comments").Display = True
 
    For Each item As GridDataItem In Me.RadGrid1.Items
        If item.Selected = False Then
            item.Visible = False
        End If
    Next
    Me.RadGrid1.ExportSettings.ExportOnlyData = True
    Me.RadGrid1.ExportSettings.OpenInNewWindow = True
    Me.RadGrid1.ExportSettings.FileName = "Selected Proposals " & Format(Now, "yyyy-MM-dd-h-mm-ss")
    'Me.RadGrid1.ExportSettings.IgnorePaging = True
    Me.RadGrid1.ExportSettings.UseItemStyles = True
    Me.RadGrid1.MasterTableView.ExportToExcel()
 
 
End Sub


HTML
I won't bother to post the HTML until asked, but here is the code for the GridColumnGroup and one of the non-displayed columns.




<ColumnGroups>
    <telerik:GridColumnGroup HeaderText="Proposal" Name="Proposal" HeaderStyle-HorizontalAlign="left"  >
        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
    </telerik:GridColumnGroup>
    <telerik:GridColumnGroup HeaderText="Fee" Name="Fee" HeaderStyle-HorizontalAlign="left" >
        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
    </telerik:GridColumnGroup>
    <telerik:GridColumnGroup  HeaderText="Key Dates" Name="Dates" HeaderStyle-HorizontalAlign="left" >
        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
    </telerik:GridColumnGroup>
    <telerik:GridColumnGroup HeaderText="Client" Name="Client" HeaderStyle-HorizontalAlign="left">
        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
    </telerik:GridColumnGroup>
    <telerik:GridColumnGroup HeaderText="Owner" Name="Owner" HeaderStyle-HorizontalAlign="left" >
        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
    </telerik:GridColumnGroup>
    <telerik:GridColumnGroup HeaderText="DLB" Name="DLB" HeaderStyle-HorizontalAlign="left">
        <HeaderStyle HorizontalAlign="Left"></HeaderStyle>
    </telerik:GridColumnGroup>
</ColumnGroups>


<telerik:GridBoundColumn Display="False" DataField="Proposal_Qualification" ColumnGroupName="Proposal"  HeaderStyle-Height="44px" HeaderStyle-HorizontalAlign="Left" HeaderStyle-VerticalAlign="Middle"
     FilterControlAltText="Filter Proposal_Qualification column" HeaderText="Qualification" SortExpression="Proposal_Qualification" UniqueName="Proposal_Qualification">
    <ColumnValidationSettings>
        <ModelErrorMessage Text="" />
    </ColumnValidationSettings>
    <HeaderStyle HorizontalAlign="Left" VerticalAlign="Middle" Height="44px"></HeaderStyle>
 
    <ItemStyle Width="105px"></ItemStyle>
</telerik:GridBoundColumn>


Thank you!
Kostadin
Telerik team
 answered on 15 May 2014
2 answers
71 views
I've always found this website hard to navigate. In the past when I was trying to learn to use I guess the UI for MVC, I would get lost and end up reading and trying to apply tools that were not made for that platform. I really need to avoid this.

Right now I'm trying to find videos so I can become acquainted with the Telerik tools for ASP.NET web forms. I'm assuming that is the UI for ASP.NET AJAX option. But when I click on the video section, I don't see a list of tools or videos showing how to use the different tools. In fact there is little instructions on the video page at all that gives you direction.

I just want to be introduced to the tools, see how they work, see them applied, etc. Are there any videos or must I read the documentation? I'm not really interested in doing a lot of reading because I don't know what I'll be using. I just want to get up to speed very quickly.  Reading requires a lot more effort and requires that you use the tool to really understand how it works.

Any suggestions?
Maurice
Top achievements
Rank 1
 answered on 15 May 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?