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

 

 

I used the following code at radgrid_ItemCreated to update radgrid detail table header text. I need to use HierarchyLoadMode="ServerBind".  I need to sort the detail table.

 

 

 

But as long as the header text programly changed in the Rradgrid_ItemCreated, the sort function doesen't work any more.

 

 

 

if

 

 

((e.Item is GridHeaderItem) && (e.Item.OwnerTableView.Name == "Detail"))

 

{

 

 

GridHeaderItem header = (GridHeaderItem)e.Item;

 

 

 

header["FileName"].Text = "My new translated header text";
}

 

Sebastian
Telerik team
 answered on 08 Aug 2011
3 answers
376 views
Hi Telerik,

I am using the Telerik 2009.3 version and in specific I am facing an issue with the RadEditor control. The control is used in the page for sending mail to the users. The user can enter the mail text inside the RadEditor. We have few templates defined in the database upon selecting one of them the template content will be loaded in the RadEditor and the User will be able to modify few lines over there. Till this it works fine. The template content stored in the database is full html content which will be sent as mail to the user. In the templates we would like to restrict the user from being able to modify some content and allow him to only modify few sections in the content. So we have various <p> tags to define sections and I have ContentEditable="false" and Unselectable="on" on the <p> tags wherever we want to restrict the User from being able to edit that section. But this does not work in all cases. The user can still be able to delete or edit the content which is inside the <p>  tag which has ContentEditable="false" and Unselectable="on" attributes on it. The User will not able to select these tags directly when focus is inside the RadEditor but when the focus is outside the control and if the user clicks on these elements using mouse then it will be selectible and he can delete it or modify its contents. Ultimately the User will be able to modify the sections which is marked as ContentEditable="false" and Unselectable="on" which we don't want to allow to the user. I am attaching the sample HTML that we are loading inside the RadEditor you can try with this sample and let me know what is missing. I tried using <div><span> and even tried  ContentEditable="false" and Unselectable="on" on the <td> attributes but nothings seems working for me.

Below is the HTML code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <title></title>
 </head>
 <body style="margin: 0; background: url($ImageURL$/background.jpg)" contentEditable="false" unselectable="on"> 
  <table width="500" border="0" align="center" cellpadding="0" cellspacing="0" style="background: #fff; border: 1px solid #D8D8DA; margin-top: 10px; font-family: Helvetica, Arial, sans-serif; font-size:12px; color: #333; ">
   <tr> 
    <td style="padding: 30px 30px 20px 30px;">     
      $Content$<br/>
      $Signature$ 
    </td>
   </tr>
   <tr>
    <td><p style="padding: 0px 30px 20px 30px;" contenteditable="false" unselectable="on"><img src="$ImageURL$/line.png" alt="line" border="0" /></p></td>
   </tr>
   <tr>
    <td align="right">
     <p style="padding-right:30px;" contenteditable="false" unselectable="on">
      <a target="_blank" href="http://www.google.com">
       <img src="$ImageURL$/logo-vaf.png" alt="GOOGLE" border="0" />
      </a>     
     </p>     
    </td>
   </tr>
   <tr>
    <td><p contenteditable="false" unselectable="on" style="height: 30px; line-height: 30px; font-size: 1px;">&nbsp;</p></td>
   </tr>
  </table>  
  <table width="" border="0" align="center" cellpadding="0" cellspacing="0">
   <tr>
    <td><p contenteditable="false" unselectable="on"><img src="$ImageURL$/shadow.png" alt="Volt" border="0" /></p></td>
   </tr>
  </table>
  <table width="" border="0" align="center">
   <tr>
    <td width="450">
     <p style="color: #666666; font-size: 10px; font-family: Helvetica, Arial, sans-serif;" contenteditable="false" unselectable="on">
     EOE | © $CurrentYear$ Company, Inc. All Rights Reserved.      
    </p>
    </td>
   </tr>
  </table>  
 </body>
</html>


Thanks in advance,
Ravi
Rumen
Telerik team
 answered on 08 Aug 2011
3 answers
118 views


How data can be exported in Hierarchical Manner in CSV from radgrid.

or any other way so that data can be exported to csv in hierarchical manner.

please reply soon.
Jayesh Goyani
Top achievements
Rank 2
 answered on 08 Aug 2011
3 answers
114 views
In trying to handle validation for both RADTextBoxes, and asp text boxes with input manager, I've run into a couple of problems.

The handler works with RADTextBox's, being called on the OnBlur event.  At that point the _invalid client property is set.

With the regular asp text boxes using input manager, the OnBlur (and others like error) handler defined in the input manager is called BEFORE the validation is performed on the text box, so that isValid() does not return the proper value.  Is there some other way to catch that?

The other issue, is that with the regular asp text boxes and input manager, it doesn't handle content pasted into the box.  That is I can paste an invalid value in that it won't let me type, and it won't catch it as invalid at all.
Pavlina
Telerik team
 answered on 08 Aug 2011
3 answers
253 views
Hello,

I have a RadGrid control having the following hierarchical structure

Master table: header ----> CompanyName, ContactName, Address

Detail table  : header ----> OrderId, OrderDate, ShippedDate

Issue
======

I'd like to export all current grid data with headers (master and detail); However on export to Excel, only the detail header is exported.  Is there a setting that would allow both master and detail headers to get exported?

many thanks
J

Princy
Top achievements
Rank 2
 answered on 08 Aug 2011
1 answer
72 views
How do you move the "57 items in 4 pages" over to the left with the page selectors?

Shinu
Top achievements
Rank 2
 answered on 08 Aug 2011
4 answers
417 views
I have two radgrid , for the first radgrid i am binding the data from serverside , and for the second radgrid i am binding the data through sqldatasource from clientside.
 The radgrid2 for which i bind the data through clientside,pagination property works fine , and my grid gets refresh each time.
 But the major problem is when bind the radgrid from serverside my pagination property is not working,is their any property i have to set for pagination to work when i am binding the data from serverside, can any one please help to figure out the problem.

This is my aspx page code which contains the radgrid

   
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadGridRefreshTest.aspx.cs" Inherits="RadGridTest.RadGridRefreshTest" enableEventValidation="false" %><br>    <br>    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br>    <br>    <html xmlns="http://www.w3.org/1999/xhtml"><br>    <head runat="server"><br>        <title></title><br>    </head><br>    <body><br>        <form id="form1" runat="server"><br>        <div><br>            <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="true"><br>            </telerik:RadScriptManager><br>            <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true"  PageSize="10" AllowCustomPaging="True" onpageindexchanged="RadGrid1PageIndexChanged" ><br>            <PagerStyle Mode="NextPrevAndNumeric"  /><br>            </telerik:RadGrid><br>    <br>            second grid<br>            <telerik:RadGrid ID="RadGrid2" runat="server" CellSpacing="0" <br>                DataSourceID="SqlDataSource" GridLines="None" <br>                onpageindexchanged="RadGrid2PageIndexChanged" ><br>    <MasterTableView AutoGenerateColumns="False" DataKeyNames="CustomerID" <br>                    DataSourceID="SqlDataSource" AllowPaging="true" PageSize="10" ><br>    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings><br>    <br>    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"><br>    <HeaderStyle Width="20px"></HeaderStyle><br>    </RowIndicatorColumn><br>    <br>    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"><br>    <HeaderStyle Width="20px"></HeaderStyle><br>    </ExpandCollapseColumn><br>    <br>        <Columns><br>            <telerik:GridBoundColumn DataField="CustomerID" <br>                FilterControlAltText="Filter CustomerID column" HeaderText="CustomerID" <br>                ReadOnly="True" SortExpression="CustomerID" UniqueName="CustomerID"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="CompanyName" <br>                FilterControlAltText="Filter CompanyName column" HeaderText="CompanyName" <br>                SortExpression="CompanyName" UniqueName="CompanyName"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="ContactName" <br>                FilterControlAltText="Filter ContactName column" HeaderText="ContactName" <br>                SortExpression="ContactName" UniqueName="ContactName"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="ContactTitle" <br>                FilterControlAltText="Filter ContactTitle column" HeaderText="ContactTitle" <br>                SortExpression="ContactTitle" UniqueName="ContactTitle"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="Address" <br>                FilterControlAltText="Filter Address column" HeaderText="Address" <br>                SortExpression="Address" UniqueName="Address"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="City" <br>                FilterControlAltText="Filter City column" HeaderText="City" <br>                SortExpression="City" UniqueName="City"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="Region" <br>                FilterControlAltText="Filter Region column" HeaderText="Region" <br>                SortExpression="Region" UniqueName="Region"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="PostalCode" <br>                FilterControlAltText="Filter PostalCode column" HeaderText="PostalCode" <br>                SortExpression="PostalCode" UniqueName="PostalCode"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="Country" <br>                FilterControlAltText="Filter Country column" HeaderText="Country" <br>                SortExpression="Country" UniqueName="Country"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="Phone" <br>                FilterControlAltText="Filter Phone column" HeaderText="Phone" <br>                SortExpression="Phone" UniqueName="Phone"><br>            </telerik:GridBoundColumn><br>            <telerik:GridBoundColumn DataField="Fax" <br>                FilterControlAltText="Filter Fax column" HeaderText="Fax" SortExpression="Fax" <br>                UniqueName="Fax"><br>            </telerik:GridBoundColumn><br>        </Columns><br>    <br>    <EditFormSettings><br>    <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn><br>    </EditFormSettings><br>    </MasterTableView><br>    <br>    <FilterMenu EnableImageSprites="False"></FilterMenu><br>    <br>    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu><br>            </telerik:RadGrid><br>            <asp:SqlDataSource ID="SqlDataSource" runat="server" <br>                ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString2 %>" <br>                SelectCommand="SELECT * FROM [Customers]"></asp:SqlDataSource><br>        </div><br>        </form><br>    </body><br>    </html>

 
This is the code behind file where i am writing the code for grid binding using datasource

   
using System;<br>    using System.Collections.Generic;<br>    using System.Linq;<br>    using System.Web;<br>    using System.Web.UI;<br>    using System.Web.UI.WebControls;<br>    using System.Data.Sql;<br>    using System.Data.SqlClient;<br>    using System.Data;<br>    using Telerik.Web.UI;<br>    using Telerik.Web.Data;<br>    <br>    <br>    namespace RadGridTest<br>    {<br>        public partial class RadGridRefreshTest : System.Web.UI.Page<br>        {<br>            protected void Page_Load(object sender, EventArgs e)<br>            {<br>                SqlConnection con = new SqlConnection();<br>                con.ConnectionString ="data source=ADMIN-PC1;uid=sa;password=sql;database=NorthWind";<br>                DataSet ds = new DataSet("CustOrders");<br>                SqlDataAdapter da1 = new SqlDataAdapter("SELECT * FROM Customers", con);<br>                da1.TableMappings.Add("Table", "Customers");<br>                da1.Fill(ds);<br>                RadGrid1.DataSource = ds;<br>                RadGrid1.DataBind();<br>            }<br>            protected void RadGrid1PageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e)<br>            {<br>                int index = e.NewPageIndex;<br>                int current = RadGrid1.CurrentPageIndex;<br>            }<br>    <br>            protected void RadGrid2PageIndexChanged(object sender, Telerik.Web.UI.GridPageChangedEventArgs e)<br>            {<br>                int index = e.NewPageIndex;<br>                int current = RadGrid1.CurrentPageIndex;<br>            }<br>    }


 
Maria Ilieva
Telerik team
 answered on 08 Aug 2011
5 answers
109 views
I have a custom silverlight control that is placed inside the ContentTemplate of the RadNotification control.  I am having problems finding this custom silverlight control within Javascript so that I can pass values to the silverlight control through a scriptable member.  Basically, what I am trying to do is use the RadNotification control to check for any changes in value using the UpdateInterval and OnCallbackUpdate members.  The OnCallbackUpdate sets static variables on the server side that is used by javascript to pass to the silverlight control.  If the values have changed then the Nofication control is told to show, if the values are the same then the control remains hidden.  I have everything working except being able to find my silverlight control embeded within the RadNotification contentTemplate so that I can reference the object in my javascript and call my silverlight scriptable member.

RadNotification Declaration:
<telerik:RadNotification ID="RadNotification1" runat="server" Width="380" Height="100"
        Animation="Fade" EnableRoundedCorners="true" VisibleTitlebar="false" OnClientUpdated="showNotification"
        OffsetY="-400" OffsetX="-500" Value="false"  AutoCloseDelay="3000" UpdateInterval="6000" LoadContentOn="TimeInterval" OnCallbackUpdate="resetNotification">
        <ContentTemplate>
        <object id="silver2" data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="380" height="100">
                      <param name="source" value="../ClientBin/Notification.xap"/>
                      <param name="onError" value="onSilverlightError" />
                      <param name="background" value="Transparent" />
                      <param name="windowless" value="true" />
                      <param name="pluginbackground" value="Transparent" />
                      <param name="minRuntimeVersion" value="4.0.50826.0" />
                      <param name="autoUpgrade" value="true" />
                      <a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
                          <img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
                      </a>
                    </object>
        </ContentTemplate>
        </telerik:RadNotification>


OnCallbackUpdate
protected void resetNotification(object sender, RadNotificationEventArgs e)
       {
           RadNotification1.Value = "false";
           if(Queue.Count>0)
           {
                     var s = Queue.Dequeue();
                   value 1 = s.Value1;
                   value 2 = s.value2;        
                   value3 = s.value3;
                 RadNotification1.Value = "true";
                 
           }
            
       }

Javascript
function showNotification(sender, args) {
                 
  
                var showMsg = sender.get_value()
                if (showMsg == "true") {
                    sender.show();
                      
               var silverlightplugin = $get("silver2");
  
               var content = silverlightplugin.content;
               content.MainPage.BindValues(value1,value2,value3);
                }
                 
  
            }

Marin Bratanov
Telerik team
 answered on 08 Aug 2011
3 answers
394 views
Hi,

I have a column in my table which consists of both date and time.

when i am filtering that column in a radgrid it is filtring the values only whose time is equal to 12:00AM.

scenario:My column values are like
 12-Jul-2011 11:20PM
12-Jul-2011 12:00AM
12-Jul-2011 08:15AM

when i am filtering with 12-jul-2011 in radgrid it is dsiplaying only 2nd row("12-Jul-2011 12:00AM") and first and third rows are being neglected

Any pointers to solve this problem will be of great help.
Tsvetina
Telerik team
 answered on 08 Aug 2011
5 answers
78 views
Hi,

is there a way to open a new browser window when the user clicks on a ribbon button?
Thnx.
Kate
Telerik team
 answered on 08 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?