Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
102 views
Hello Team,
I am facing problem in dynamic creation grid structure and bind data and not able to see nested grid data below is code for same. Please do help me asap.

Looking forward to your response.


RadGridData.AutoGenerateColumns = false;

            //generate grid columns/ grid structure
            GridBoundColumn ZoneColumn;
            GridTableView gridTableView = new GridTableView();
            for (int ColumnCount = 0; ColumnCount < ZoneData.Tables[0].Columns.Count; ColumnCount++)
            {
                ZoneColumn = new GridBoundColumn();
                RadGridData.MasterTableView.Columns.Add(ZoneColumn);
                ZoneColumn.DataField = Convert.ToString(ZoneData.Tables[0].Columns[ColumnCount]);
                ZoneColumn.HeaderText = Convert.ToString(ZoneData.Tables[0].Columns[ColumnCount]);
                ZoneColumn.UniqueName = Convert.ToString(ZoneData.Tables[0].Columns[ColumnCount]);
                ZoneColumn.SortExpression = Convert.ToString(ZoneData.Tables[0].Columns[ColumnCount]);

                gridTableView.AutoGenerateColumns = false;
                for (int innerColumnCount = 0; innerColumnCount < ZoneData.Tables[1].Columns.Count; innerColumnCount++)
                {
                    ZoneColumn = new GridBoundColumn();
                    gridTableView.Columns.Add(ZoneColumn);
                    ZoneColumn.DataField = Convert.ToString(ZoneData.Tables[1].Columns[innerColumnCount]);
                    ZoneColumn.HeaderText = Convert.ToString(ZoneData.Tables[1].Columns[innerColumnCount]);
                    ZoneColumn.UniqueName = Convert.ToString(ZoneData.Tables[1].Columns[innerColumnCount]);
                    ZoneColumn.SortExpression = Convert.ToString(ZoneData.Tables[1].Columns[innerColumnCount]);
                }
                RadGridData.MasterTableView.DetailTables.Add(gridTableView);
            }


            RadGridData.MasterTableView.AutoGenerateColumns = false;
            RadGridData.MasterTableView.DetailTables[0].AutoGenerateColumns = false;
            GridRelationFields relationFields = new GridRelationFields();
            relationFields.MasterKeyField = "ID";
            relationFields.DetailKeyField = "ID";
            gridTableView.ParentTableRelation.Add(relationFields);


            RadGridData.MasterTableView.DataSource = ZoneData.Tables["Zone"]; //ZoneData is dataset with table data
            RadGridData.MasterTableView.DetailTables[0].DataSource = ZoneData.Tables["ZoneContract"];



Thanks & Regards
Radoslav
Telerik team
 answered on 04 Jul 2012
5 answers
119 views
I have a grid with a GridHTMLEditorColumn containing, obviously, HTML. When I access the value of the cell client-side it appears as if the RadFormDecorator is attempting to decorate controls INSIDE the GridHTMLEditorColumn. For example, this is what it does to a button:
    <a class="rfdSkinnedButton" href="javascript:void(0)">
      <button id="Button3" class="rfdDecorated" tabIndex="-1">

I had the same problem using just a GridBoundColumn and a GridTemplateColumn containing a textarea.

How do I get the RadFormDecorator to leave my HTML data alone without disabling it completely (which might be difficult, since it is on the Master Page)?
Bozhidar
Telerik team
 answered on 04 Jul 2012
1 answer
237 views
Is there a way to modify the styling of the RadHTMLChart?  I have done this many times with the radGrid and other telerik controls.  For example,  I would like to change the font of the legend, add borders around the legend, or change spacing between series in the bar chart.  Is there a way to do that or is this under development and to be released at a later date?
Marin Bratanov
Telerik team
 answered on 04 Jul 2012
2 answers
142 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
117 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
133 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
248 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
208 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
365 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
326 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?