Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
194 views
How can i fire itemclick event when the navigateurl property of menuitem is set
Princy
Top achievements
Rank 2
 answered on 10 Dec 2012
1 answer
225 views
How can i remove underline in gridhyperlink column ?
Princy
Top achievements
Rank 2
 answered on 10 Dec 2012
1 answer
126 views
1)how can i set alternating row style in the exported document? 
Shinu
Top achievements
Rank 2
 answered on 10 Dec 2012
1 answer
139 views
Hi,

I am trying to generated BoundColumns dynamically, i have read the documentation (http://www.telerik.com/help/aspnet-ajax/grid-using-columns.html) and the programmatic example (http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html), and drafted the following code, but nothing is getting rendered in the page, could you please help,

I debugged and found that the columns collection has the columns as the way I added them but they are not rendered in my page.
Please note I have checked in IE9 / FF16 and using IIS7.5 & net framework 4.0

Find below my code....

aspx,

<telerik:RadGrid ID="RadGridStores" runat="server" AutoGenerateColumns="False" EnableViewState="False" CellSpacing="0" GridLines="Both">
                                            <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True">
                                                <Selecting AllowRowSelect="True" />
                                                <ClientEvents OnGridCreated="RadGridStores_OnGridCreated"/>
                                            </ClientSettings>
                                            <MasterTableView BorderStyle="Double" EnableViewState="False">
                                                <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                                                <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                                                    <HeaderStyle Width="20px"></HeaderStyle>
                                                </RowIndicatorColumn>
                                                <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                                                    <HeaderStyle Width="20px"></HeaderStyle>
                                                </ExpandCollapseColumn>
                                                <EditFormSettings>
                                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
                                                </EditFormSettings>                                                
                                            </MasterTableView>
                                            <FilterMenu EnableImageSprites="False"></FilterMenu>
                                        </telerik:RadGrid>

aspx.cs

private void SetUpDynamicColumns(UserAppletSettings usrAppConfig, RadGrid grid)
    {
        if (usrAppConfig.ItemCount <= 0) { return; }

        Telerik.Web.UI.GridBoundColumn gbCol = null;
        List<UsersDisplayColumnPKL> _enItems = null;
        try
        {
            _enItems = new List<UsersDisplayColumnPKL>(usrAppConfig.ItemByColumnOrder.Values);
            _enItems.Sort((UsersDisplayColumnPKL l, UsersDisplayColumnPKL r) => l.ColumnOrder.CompareTo(r.ColumnOrder));
            _enItems = _enItems.FindAll((UsersDisplayColumnPKL item) => item.ColumnVisible != 0 ||
                (item.ColumnVisible == 0 && item.ColumnOrder >= 999 && item.ColumnHidden == 0));

            for (int index = 0, length = _enItems.Count; index < length; index++)
            {
                gbCol = new Telerik.Web.UI.GridBoundColumn();
                grid.MasterTableView.Columns.Add(gbCol);

                gbCol.Visible = true;
                gbCol.HeaderText = _enItems[index].ColumnHeader;
                gbCol.DataField = _enItems[index].ColumnName;
                gbCol.UniqueName = _enItems[index].ColumnName;
               
            }

        }
        finally
        {
            if (!ReferenceEquals(_enItems, null))
            {
                _enItems.Clear();
                _enItems = null;
            }
        }
    }


protected void Page_Load(object sender, EventArgs e)
    {
        // Pre-condition section
        if (IsPostBack) return;
        if (IsCallback) return;

        SetCurrentTab();

        SetUpDynamicColumns(new UserAppletSettings(WebDataKeys.SCR_OFSS, UserAppletSettings.EAppletType.STOR, this.RadGridStores.MasterTableView),
            this.RadGridStores);

    }

Regards
Sanjib Harchowdhury
Marin
Telerik team
 answered on 10 Dec 2012
1 answer
50 views
1 answer
68 views

Hi,

 

I am  facing an issue with our application, the checkbox inside the Telerik  Radgrid in our application is not unchecking when it is clicked first time (as per the business logic the  grid will be loaded as few rows checked. And this issue occurring only in this scenario).  But it is unchecking on the second time clicked.  This issue we got after migrating the  application from .Net 3.5 to 4.0.

In our 3.5 application  grid is working fine in the above said scenario. we have  tried with  4.0 Telerik and Spring DLL ‘s, still we are facing the same issue.

Maria Ilieva
Telerik team
 answered on 10 Dec 2012
1 answer
121 views
Hi,

I am using a rad grid which is having a CheckBox column and with multiselection. Paging is enabled for the grid. If user selects one or more row in the grid and clicks on next or prev page button in the pager. A confirmation message should be displayed to user. If user clicks on "OK" in the confirmation message, i would like to perform operation(delete) and page should be changed (user should be redirected to next page), if he clicks on cancel, selection should be cleared and page should be changed.

Can you please help me with this scenario? A code sample will be of great help.

Thanks.
Angel Petrov
Telerik team
 answered on 10 Dec 2012
2 answers
265 views
Hello.

We have a problem.

If I input special character  "<br/>" or "<a>" into RadTextbox and submit data,

server exception error raised  "System.Web.HttpRequestValidationException"

please let me know how can I solve this problem.
Maria Ilieva
Telerik team
 answered on 10 Dec 2012
1 answer
168 views
i have a radGrid that contains a 'Download file' button, that downloads file from server. The grid has a RadAjax Loading panel that shows a loading icon while time consuming operations are being performed.

The Loading icon works in all cases but interferes with Download functionality. when i select download, the loading icon appears indefinitely & after sometime the following error is displayed:

The data necessary to complete this operation is not yet available.

Detailed error:
Sys.WebForms.PageRequestManagerParserErrorException: 
The message received from the server could not be parsed. Common causes for this error are when the response
 is modified by calls to Response.Write(), 
+response filters, HttpModules, or server trace is enabled.

Following is my code:


////////////////////////////This is for RadAjax Loading panel//////////////

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function centerLoadingPanel()
             {                
                  centerElementOnScreen($get("<%= RadAjaxLoadingPanel1.ClientID %>"));
             }
           function centerElementOnScreen(element)
            {
               var scrollTop = document.body.scrollTop;
                var scrollLeft = document.body.scrollLeft;
                var viewPortHeight = document.body.clientHeight;
                var viewPortWidth = document.body.clientWidth;
                if (document.compatMode == "CSS1Compat") {
                    viewPortHeight = document.documentElement.clientHeight;
                    viewPortWidth = document.documentElement.clientWidth;
                   if (!$telerik.isSafari) {
                        scrollTop = document.documentElement.scrollTop;
                        scrollLeft = document.documentElement.scrollLeft;
                    }
               }
                var topOffset = Math.ceil(viewPortHeight / 2 - element.offsetHeight / 2);
                var leftOffset = Math.ceil(viewPortWidth / 2 - element.offsetWidth / 2);
                var top = scrollTop + topOffset - 40;
                var left = scrollLeft + leftOffset - 70;
                element.style.top =  "0px";
                element.style.left = "0px";
                var loadingImage = document.getElementById('<%= RadAjaxLoadingPanel1.FindControl("Image11").ClientID %>');
                loadingImage.style.left = "100px";
            }
            function RequestStart(sender, eventArgs) 
            {
               
                var loadingImage = document.getElementById('<%= RadAjaxLoadingPanel1.FindControl("Image11").ClientID %>');
                var panel1 = $get("<%= PagerPanel.ClientID %>");
                           if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
                    $get("<%= RadAjaxLoadingPanel1.ClientID %>").style.height = document.documentElement.scrollHeight + "px";
                }
            }
         
        </script>
    </telerik:RadCodeBlock>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<ClientEvents OnRequestStart="centerLoadingPanel()"  />
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="PagerPanel" >          
                <UpdatedControls >
                    <telerik:AjaxUpdatedControl  ControlID="PagerPanel" LoadingPanelID="RadAjaxLoadingPanel1"  UpdatePanelHeight="100%" UpdatePanelRenderMode="Block"  ></telerik:AjaxUpdatedControl>
                </UpdatedControls>               
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"  Transparency="0"  EnableSkinTransparency="false" Direction="LeftToRight" ZIndex="-1"    BackgroundPosition="Center"   IsSticky="true" CssClass="MyModalPanel" Height="100%"   >
                    <div class="loading">
                     <table  style=" background-color:White; color:White;height:150px; width:311px; vertical-align:middle " >
                         <tr align="center" >
                             <td align="center" >
                                <img src="~/images/XS-Docs_WaitAnimation.gif"  id="Image11" runat="server" alt="img"  />               
                             </td>
                         </tr>
                     </table>
                   </div>
    </telerik:RadAjaxLoadingPanel>


//////////////////////////THis is for Download file code///////////////////

   public bool DownloadFile(string methodname, object[] obj)
        {
            string URi = ConfigurationManager.AppSettings["ServiceURL"].ToString();
           
            WebClient proxy = new WebClient();

            byte[] abc = proxy.DownloadData((new Uri(URi)));
            
            MemoryStream strm = new MemoryStream(abc);

            if (abc.Length > 0)
            {
                string _DownloadableProductFileName = obj[2].ToString();
                BinaryReader _BinaryReader = new BinaryReader(strm);
                long startBytes = 0;
                HttpContext.Current.Response.Clear();
                HttpContext.Current.Response.Buffer = false;
                HttpContext.Current.Response.AddHeader("Accept-Ranges", "bytes");
                //Set the ContentType

                string Content_Type = "";
                if (obj[1].ToString() == "PDF")
                    Content_Type = "application/pdf";
           
                HttpContext.Current.Response.ContentType = Content_Type;

                //Add the file name and attachment, 
                //which will force the open/cancel/save dialog to show, to the header
                HttpContext.Current.Response.AddHeader("Content-Disposition", "attachment;filename=" + _DownloadableProductFileName);

                //Add the file size into the response header
                HttpContext.Current.Response.AddHeader("Content-Length", (strm.Length - startBytes).ToString());
                HttpContext.Current.Response.AddHeader("Connection", "Keep-Alive");

                //Set the Content Encoding type
                HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.UTF8;

                //Send data
                _BinaryReader.BaseStream.Seek(startBytes, SeekOrigin.Begin);
                int maxCount = (int)Math.Ceiling((strm.Length - startBytes + 0.0) / 1024);
                int i;
                for (i = 0; i < maxCount && HttpContext.Current.Response.IsClientConnected; i++)
                {
                    HttpContext.Current.Response.BinaryWrite(_BinaryReader.ReadBytes(1024));
                    HttpContext.Current.Response.Flush();
                }

                _BinaryReader.Close();
                if (i < maxCount)
                    return false;
                else
                    return true;
                
            }
            else
            {
                return false;
            }
           
        }
/////////////////////////////////End///////////////////////////////////////


Maria Ilieva
Telerik team
 answered on 10 Dec 2012
2 answers
134 views
When selecting all text and applying a different alignment (left, right, center, justify) an empty paragraph is added after each element. This happens in Internet Explorer 9.

We are using version 2012.3.1016.45 of the editor, but the same problem happens with the online demo of the editor.

Example:
We have the following HTML-code in the texteditor:

<h1>Lorem Ipsum</h1>
<h4>Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur fermentum vestibulum elit nec rhoncus.</p>
<p>Duis urna elit, porttitor vel luctus vitae, suscipit dapibus nisi. Maecenas vulputate dapibus malesuada. Sed ut erat eget elit vulputate tincidunt. Sed in quam congue erat pulvinar.</p>
<p>Fusce non ligula et neque placerat dictum. Vivamus consectetur diam quis enim porta eget commodo justo interdum. Morbi id nisi eget nisi egestas dictum non in est. Praesent dignissim dolor non lorem faucibus pellentesque. Vivamus imperdiet cursus enim ut luctus. Morbi hendrerit suscipit turpis, ut sollicitudin erat auctor vitae.</p>
<p>In eget nisi sit amet metus semper bibendum:</p>
<ul>
    <li>Cras purus </li>
    <li>Lacinia id conseqat </li>
    <li>Gravida ut metus </li>
    <li>Pellentesque interdum </li>
    <li>Cras fermentum fringilla enim tincidunt </li>
    <li>Duis porttitor </li>
    <li>...</li>
</ul>
<p> </p>
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis.</p>

Then we do CTRL-A to select all the text and click the button to change the alignment (center, right or justify).

In Google Chrome we get this correct result:

<h1 style="text-align: justify;">Lorem Ipsum</h1>
<h4 style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
<p style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur fermentum vestibulum elit nec rhoncus.</p>
<p style="text-align: justify;">Duis urna elit, porttitor vel luctus vitae, suscipit dapibus nisi. Maecenas vulputate dapibus malesuada. Sed ut erat eget elit vulputate tincidunt. Sed in quam congue erat pulvinar.</p>
<p style="text-align: justify;">Fusce non ligula et neque placerat dictum. Vivamus consectetur diam quis enim porta eget commodo justo interdum. Morbi id nisi eget nisi egestas dictum non in est. Praesent dignissim dolor non lorem faucibus pellentesque. Vivamus imperdiet cursus enim ut luctus. Morbi hendrerit suscipit turpis, ut sollicitudin erat auctor vitae.</p>
<p style="text-align: justify;">In eget nisi sit amet metus semper bibendum:</p>
<ul>
    <li style="text-align: justify;">Cras purus </li>
    <li style="text-align: justify;">Lacinia id conseqat </li>
    <li style="text-align: justify;">Gravida ut metus </li>
    <li style="text-align: justify;">Pellentesque interdum </li>
    <li style="text-align: justify;">Cras fermentum fringilla enim tincidunt </li>
    <li style="text-align: justify;">Duis porttitor </li>
    <li style="text-align: justify;">...</li>
</ul>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis.</p>
<div style="text-align: justify;"><br />
</div>

In Internet Explorer 9, an empty paragraph is added after each element:

<h1 style="text-align: justify;">Lorem Ipsum</h1>
<p style="text-align: justify;">
</p>
<h4 style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit</h4>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur fermentum vestibulum elit nec rhoncus.</p>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">Duis urna elit, porttitor vel luctus vitae, suscipit dapibus nisi. Maecenas vulputate dapibus malesuada. Sed ut erat eget elit vulputate tincidunt. Sed in quam congue erat pulvinar.</p>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">Fusce non ligula et neque placerat dictum. Vivamus consectetur diam quis enim porta eget commodo justo interdum. Morbi id nisi eget nisi egestas dictum non in est. Praesent dignissim dolor non lorem faucibus pellentesque. Vivamus imperdiet cursus enim ut luctus. Morbi hendrerit suscipit turpis, ut sollicitudin erat auctor vitae.</p>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">In eget nisi sit amet metus semper bibendum:</p>
<p style="text-align: justify;">
</p>
<ul>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Cras purus </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Lacinia id conseqat </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Gravida ut metus </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Pellentesque interdum </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Cras fermentum fringilla enim tincidunt </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">Duis porttitor </div>
    </li>
    <p style="text-align: justify;">
    </p>
    <li>
    <div style="text-align: justify;">...</div>
    </li>
    <p style="text-align: justify;">
    </p>
</ul>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;"> </p>
<p style="text-align: justify;">
</p>
<p style="text-align: justify;">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis.</p>
Analyz-it
Top achievements
Rank 1
 answered on 10 Dec 2012
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?