Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
119 views
We have started replacing the ASP.NET charts with RadHTML Charts.  How do we adjust the font size for the X and Y series.  I can't seem to find a property to do that.  Setting up the font size property at the chart level doesn't seem to impact anything.

Thanks.
Marin Bratanov
Telerik team
 answered on 04 Jul 2012
1 answer
96 views
How to loop through selected items in radgrid in external button click and retrieve their cell value?
Shinu
Top achievements
Rank 2
 answered on 04 Jul 2012
3 answers
101 views
Good Day Support 

I am using a RadWindow to load another page that shows Google map , onClientClose event of the Window i successffully pass the Arguments and that works nice. 

The issue i have is sometimes the Window does not close it keeps it open.  i Open the Window with this code 

Copy code
function GoogleEarthExtended() {
 
    var x = $("#ctl00_ContentPlaceHolder_Main_Wizard1_x").val();
    var y = $("#ctl00_ContentPlaceHolder_Main_Wizard1_y").val();
 
    var url = 'InsertGoogleEarthPhoto.aspx?type=roadmap' '&x= ' + x + '&y= ' + y +'&hfGoogleMapsURLImage=' + document.getElementById("<%=hfGoogleMapsURLImage.ClientID%>").value +'&isHybrid=No';
    var wnd = window.radopen(url);
    wnd.setSize(900, 600);
 
}

<asp:Button ID="butGoogleMap" runat="server" CssClass="but_lrg" Height="32px"
                                                        OnClientClick="javascript:GoogleEarthExtended(); return false;"
                                                        Text="Insert Google Earth Map"
                                                        ToolTip="Insert a map of the property by using Google Earth."
                                                        UseSubmitBehavior="False" Width="197px" />

 
onload of the Popup there is Javascript that has a Popup a user can choose Yes or no depending on the Asnwer it can keep the popup open else close it , so i have provided the javascript that is related to the issue 

Copy code
//Check if there is a URL to for the Google map image
      if (getParameterByName('hfGoogleMapsURLImage') != "") {
 
          //if there is ask a User if he wants to use the current Image but of type "RoadMap"
          var desc = confirm('Do you want to insert a roadmap version of the above satellite image?');
      }
      else {
          var desc = false
      }
 
      //if the yes Choose Yes to use the RoadMap
      if (desc == true) {
 
          center = getParameterByName('center');
          zoom = "15";
          maptype = "roadmap";
          x = getParameterByName('x');
          y = getParameterByName('y');
          //set the X and Y for Logic
          document.getElementById("Latitude").value = x;
          document.getElementById("Longitude").value = y;
            
          CloseWithArg();
      }

so if the variable "Desc" it will assign the textbox that is on the popup with variables and go to the method("CloseWithArg()")that will close the popup with Args as depicted below 

function CloseWithArg()
       {
 
           var customArg;
           
           if (getParameterByName('isHybrid') == "Yes") {
             //  alert("inside first If");
               customArg = document.getElementById("Latitude").value; //0
              // alert("After x Assignment" + customArg);
               customArg = customArg + ";" + document.getElementById("Longitude").value;  //1
               //alert("After y Assignment" + customArg);
               customArg = customArg + ";" + map.getCenter(); // 2
               //alert("After NA Assignment" + customArg);
               customArg = customArg + ";" + zoom; //3
               //alert("After ZOOM Assignment" + customArg);
               customArg = customArg + ";" "hybrid"//4 
               //alert("After MAPTYPE Assignment" + customArg);
               customArg = customArg + ";" + getParameterByName('isHybrid'); //5
               //alert("After IShybrid Assignment" + customArg);
 
 
               GetRadWindow().close(customArg);
             }
             else {
                 //alert("Entered else");
                 //alert("X: " + document.getElementById("Latitude").value);
                 //alert("Y: " + document.getElementById("Longitude").value);
                 //alert("center: " + getParameterByName("center"));
                 //alert("zoom: " + getParameterByName("zoom"));
 
                 customArg = document.getElementById("Latitude").value; //0
 
                 customArg = customArg + ";" + document.getElementById("Longitude").value; //1
                 customArg = customArg + ";" + getParameterByName("center"); // 2
                 customArg = customArg + ";" + getParameterByName('zoom'); //3
                 customArg = customArg + ";" "roadmap"//4 
                 customArg = customArg + ";" "No"//5
                   
                 GetRadWindow().close(customArg);
 
                 this.Close();
             
       }

function GetRadWindow() {
    var oWindow = null;
    if (window.radWindow) oWindow = window.radWindow;
    else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
    return oWindow;
}
  
function Close() {
    GetRadWindow().close();
}


So if the "Desc" is "true this will go to the else of this code. as you can see at the end i close it 

GetRadWindow().close(customArg);


and even emphesize closing it but it works sometimes, what is it that i am doing wrong? 

Checked the F12 Error  Chrome debugger  there is no Error.


Thanks 
Marin Bratanov
Telerik team
 answered on 04 Jul 2012
2 answers
210 views
Hello world,

Currently working with RadGrid of telerik "RadControls for ASP.NET AJAX Q2 2012" version, I try to perform an event by clicking on a cell. I read the following topic : http://demos.telerik.com/aspnet-ajax/controls/examples/integration/gridandwindow/defaultcs.aspx?product=window

But it is not exactly what I want. By double clicking on a cell, i want to open a simple alert window wich display cell information instead of an edit form, and not all information of the row. This event must happen on some cells only, depending on an argument (true or false test) Is there any simple way to perform this ?

Thanks.

  • ASP.NET version: 4.0
  • OS: WS2008R2
  • exact browser version: Firefox 13.0 & IE9.0
  • exact version of the Telerik product: RadControls for ASP.NET AJAX Q2 2012
  • preferred programming language : C#
Maxime
Top achievements
Rank 1
 answered on 04 Jul 2012
3 answers
144 views
Dear Telerik Admin,
Can you please help me fnd solution to my problem.
I have a checkbox within my application & on client click of it I call an javascript function which display & hide panel control. Now I have also an RadEditor within my form, now what I want to do here is that, when I unchecks my check box  I want Content within the RadEditor to be in only PREVIEW MODE (i.e I wont allow user to view edit & HTML view modes), but when user check an checkbox control all I want to show is EDIT & HTML view modes & no preview mode.

Though I have tried to implement the same as shown below :-
function OnClientClick() {
               var IsCustomPageHeaderCheckBox = document.getElementById('<%= IsCustomPageHeaderCheckBox.ClientID %>');
               var TemplateHeaderPanel = document.getElementById('<%= TemplateHeaderPanel.ClientID %>');
               var editor = $find("<%=PageHeaderRadEditor.ClientID%>");
               var selectedvalue = IsCustomPageHeaderCheckBox.checked; // getting the selected value
               if (selectedvalue == true) {
                   TemplateHeaderPanel.style.display = 'none';
                   editor.set_mode(1); //Design mode
                   editor.set_mode(2); //Html mode
                    
               }
               else {
                   TemplateHeaderPanel.style.display = 'block';
                   editor.set_mode(4); //Preview mode
               }
 
           }
But its not working for me.

Also, I want the same feature on (!PageIsPostBack) on code behind.


Can you help me out ?

Thanks

Ajay

Ajay
Top achievements
Rank 2
 answered on 04 Jul 2012
2 answers
316 views
I have setup a page with rad editor. I have a related a customer combo box on the menu on the rad editor. I have not put any code or anything being the custom dropdow box. Basically, what I want to do is, any time an item is selected from the combo, the contents of the combo are inserted into the rad editor. The important part is, the contents are inserted into the place of the cursor.
Danny
Top achievements
Rank 1
 answered on 04 Jul 2012
8 answers
274 views
Hello There, 

I am trying to export a RadGrid to an excel sheet but I get this error"   Script control 'RadGrid1' is not a registered script control. Script controls must be registered using RegisterScriptControl() before calling RegisterScriptDescriptors().
Parameter name: scriptControl ". However, when I use GridView, it works fine. this is the function to export the Radgrid to excel.

 Response.Clear();
          
            Response.AddHeader("content-disposition", "attachment;filename=FileName.xls");
            Response.Charset = "";
         // Response.Cache.SetCacheability(HttpCacheability.NoCache);
            Response.ContentType = "application/vnd.xls";
         // htmlWrite.WriteLine(header2);
            System.IO.StringWriter stringWrite = new System.IO.StringWriter();
            System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);
            RadGrid1.RenderControl(htmlWrite);
            //GridView1.RenderControl(htmlWrite);
            Response.Write(stringWrite.ToString());
            Response.End();

Thank you so much
Ahsan 
Shinu
Top achievements
Rank 2
 answered on 04 Jul 2012
3 answers
106 views
I have a nested radgrid which does not page. All it does is collapse the grid when I try. I based it off of the grid/hierarchy with Templates demo from the telerik demo site and the code behind that it shows does not seem to be anything special but everything that I have tried has not worked. The nest radgrid that I am referencing is the one called RepresentedGrid.
If I remove the datasourceid and rely only on the needdatasource function being explicitly set up in the grid then I end up with an empty grid.
Part of the problem is the fact that even if I try to set up a page index changed function, the grid is never found so I end up with errors about instance not being set to an object.

   </telerik:RadAjaxManager>
   <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
       AllowSorting="True" CellSpacing="0" GridLines="None" PageSize="20"
       ShowFooter="True" Width="979px" AutoGenerateColumns="false">
        
       <MasterTableView DataKeyNames="Fullname,FileAs, Email, Department, Company, BusinessPhone, BusinessFax, Website, Categories, OtherNotes, LinkedDocs, Represented" PageSize="20">
        <NestedViewTemplate>
        <asp:Panel runat="server" ID="InnerContainer" Visible="false" BackColor="AliceBlue">
        <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">
                       <Tabs>
                           <telerik:RadTab runat="server" Text="Contact Information" PageViewID="PageView1">
                           </telerik:RadTab>
                           <telerik:RadTab runat="server" Text="Distributors/Distributing" PageViewID="PageView2">
                           </telerik:RadTab>
                       </Tabs>
                   </telerik:RadTabStrip>
        <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
        <telerik:RadPageView runat="server" ID="PageView1">
        <table >
        <tr><td>Business Fax:</td><td><%# Eval("BusinessFax")%></td></tr>
        <tr><td>Business Address:</td><td><%# addressFormat(Eval("BusinessAddress"))%></td></tr>
        <tr><td>Attached Documents:</td><td><%# documentShow(Eval("LinkedDocs"))%></td></tr>
        <%--<tr><td>Representing/Represented By:</td><td><%# cleanRepresented (Eval("Represented"))%></td></tr>--%>
        <tr><td>Other Notes:</td><td><%# Eval("OtherNotes")%></td></tr>
        </table>
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="RadPageView2">
 
<asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:SterlingConnection %>"
                               ProviderName="System.Data.SqlClient" SelectCommand='<%# vendorCrossReference(Eval("VendorID"))%>'
                               runat="server">
<telerik:RadGrid runat="server" ID="RepresentedGrid" DataSourceID="SqlDataSource3" ShowFooter="true" AllowPaging="True" EnableAJAX="True"
                                AllowSorting="true"  >
                                <PagerStyle Mode="Slider"></PagerStyle> 
                               <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true"
                                   DataKeyNames="VendorID, Fullname,FileAs, Email, Department, Company, BusinessPhone, BusinessFax, Website, Categories, OtherNotes, LinkedDocs, Represented"
                                   PageSize="20"  >
                                   
                                  <Columns>
                                  
                                    <telerik:GridBoundColumn SortExpression ="Company" HeaderText="Company" DataField ="Company" >
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn SortExpression ="Email" HeaderText="Email" DataField ="Email"  AllowFiltering="false" DataFormatString="<a href='mailto:{0}'>{0}</a>">
                                   </telerik:GridBoundColumn>
                                    
                                   <telerik:GridBoundColumn SortExpression ="Website" HeaderText="Website" AllowFiltering="false" DataField ="Website"  DataFormatString="<a href='{0}' target='_blank'>{0}</a>" >
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn SortExpression ="BusinessPhone" HeaderText="Business Phone" AllowFiltering="false" DataField ="BusinessPhone">
                                   </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression ="BusinessFax" HeaderText="Business Fax" DataField ="BusinessFax">
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn SortExpression ="BusinessAddress" HeaderText="Business Address" DataField ="BusinessAddress">
                                   </telerik:GridBoundColumn>
 
 
                                  </Columns>
 
 
        </MasterTableView>
        </telerik:RadGrid>
 
        </telerik:RadPageView>
        </telerik:RadMultiPage>
         
        </asp:Panel>
        </NestedViewTemplate>   
        
       <Columns>
        
       <telerik:GridBoundColumn SortExpression ="Company" HeaderText="Company" DataField ="Company" >
        </telerik:GridBoundColumn>
       <telerik:GridBoundColumn SortExpression ="Email" HeaderText="Email" DataField ="Email" AllowFiltering="false" DataFormatString="<a href='mailto:{0}'>{0}</a>">
       </telerik:GridBoundColumn> 
       <telerik:GridBoundColumn SortExpression ="Website" HeaderText="Website" AllowFiltering="false" DataField ="Website" DataFormatString="<a href='{0}' target='_blank'>{0}</a>" >
       </telerik:GridBoundColumn>
       <telerik:GridBoundColumn SortExpression ="BusinessPhone" HeaderText="Business Phone" AllowFiltering="false" DataField ="BusinessPhone">
       </telerik:GridBoundColumn>
        <telerik:GridBoundColumn SortExpression ="Categories" HeaderText="Categories" DataField ="Categories">
       </telerik:GridBoundColumn>
 
 
       </Columns>

       Public Sub RepresentedGrid_NeedDataSource(ByVal source As Object, ByVal e As GridNeedDataSourceEventArgs)
           If Not e.IsFromDetailTable Then
 
               Dim dataSource As SqlDataSource = RadGrid1.MasterTableView.Items(0).ChildItem.FindControl("SqlDataSource3")
               Dim RepresentedGrid As RadGrid
               RepresentedGrid = RadGrid1.MasterTableView.Items(0).ChildItem.FindControl("RepresentedGrid")
               RepresentedGrid.DataSource = dataSource
 
            
           End If
       End Sub
 
Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles RadGrid1.ItemCreated
           If TypeOf e.Item Is GridNestedViewItem Then
           Dim typeContent = DirectCast(e.Item.FindControl("RepresentedGrid"), RadGrid)
           AddHandler typeContent.NeedDataSource, AddressOf Me.RepresentedGrid_NeedDataSource
           End If
End Sub
Anna
Top achievements
Rank 1
 answered on 03 Jul 2012
3 answers
82 views
How can i achieve reording in RowDrop function if the RadGrid is using OpenAccessDataSource as the datasource?

I implemented reorder items code in RowDrop using normal SQL update statement. The SQL update statement passed all checking and retured true for the update process. Howevever, it seems the order in the database doesn't change at all and the RadGrid.Rebind() returns the same order as before. 

Can anyone help me out?

Thanks
Felipe de Jesús
Top achievements
Rank 1
 answered on 03 Jul 2012
3 answers
169 views
Hi,

Attached, pls take a look at my picture. First let me say that for confidential purpose, I have edited the pic by white-out the data rows.
 
As you can see, at the very bottom of the grid, right below the footer, there is a blank, white row. It's happen when I first loaded the page,  selected two dates above and click "View" to populate the grid. It's automatically fixed (The blank row automatically go away) upon subsequent operation on the grid (Refresh, filter, etc). It didn't happen to every project that I'm working on. I have spent tremendous time to compare these projects to find out the cause, but still couldn't. Would you please help?

Thanks

Lamk.
LamKhoa
Top achievements
Rank 1
 answered on 03 Jul 2012
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
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
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?