Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
40 views
Hi,

I am currently developing an ASP.NET website. On one of my pages I have a RadTabStrip on it with RadMultiPage and RadPageVIew's however I am struggling to complete a few aspects.

Here is some sample code below.

The main two things which I need to find out is a) what page event should I use when I programmatically want to change the page? b) As I will eventually be having some RadGrids in the code, is there a best practise when I should be filtering the data e.g. what page event location?

Thanks,
Alex
  <telerik:RadTabStrip runat="server" ID="RadTabStrip1" MultiPageID="RadMultiPage1" Skin="Metro" CssClass="customer1">
                  <Tabs>
                     
                      <telerik:RadTab Text="Tab1" Width="100px" Selected="true"></telerik:RadTab>
                      <telerik:RadTab Text="Tab2" Width="100px" ></telerik:RadTab>
                  <telerik:RadTab Text="Tab3" Width="100px" ></telerik:RadTab>
                  </Tabs>
              </telerik:RadTabStrip>
 
<telerik:RadMultiPage runat="server" ID="RadMultiPage1" CssClass="customer1" SelectedIndex="0"> <%-- CssClass="outerMultiPage"--%>
      <telerik:RadPageView runat="server" ID="RadPageView1"  Selected="true" CssClass="customer1" >
          <p>Tab 1 info</p>
      </telerik:RadPageView>
      <telerik:RadPageView runat="server" ID="RadPageView2"  Selected="true" CssClass="customer1" >
          <p>Tab 2 info</p>
      </telerik:RadPageView>
      <telerik:RadPageView runat="server" ID="RadPageView3"  Selected="true" CssClass="customer1" >
          <p>Tab 3 info</p>
      </telerik:RadPageView>
</telerik:RadMultiPage



Boyan Dimitrov
Telerik team
 answered on 07 Aug 2014
2 answers
147 views
Hi Telerik,

I've created a page which I populate all grids on the page programmatically in c# and following this demo to print the grids; however as my grids are created on pageload, when typing the javascript code in front end (aspx), the script cannot detect the grids and returning a "The Name 'RadGrid1' does not exist in current content" error. I've tried calling it by string name in the $find function and also tried document.FindElementById, but no luck. Could anyone give me some advice on this issue?

Many thanks.

Attached the code below:
function Print() {
    var previewWindow = window.open('about:blank', '', '', false);
    var styleSheet = '<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, RadGrid1.GetType(), String.Format("Telerik.Web.UI.Skins.{0}.Grid.{0}.css", RadGrid1.Skin)) %>';
    var baseStyleSheet = '<%= Telerik.Web.SkinRegistrar.GetWebResourceUrl(this, RadGrid1.GetType(), "Telerik.Web.UI.Skins.Grid.css") %>';
    var htmlContent = "<html><head><link href = '" + styleSheet + "' rel='stylesheet' type='text/css'></link>";
    htmlContent += "<link href = '" + baseStyleSheet + "' rel='stylesheet' type='text/css'></link></head><body>";
 
    for (i = 1; i < 13; i++) {
        var CYGrid = "RadGrid_CY_Strategy_" + String(i);
        var CYradGrid = $find('<%=CYGrid.ClientID %>'); //This is not working well, hence below
 
        htmlContent += getOuterHTML(CYradGrid.get_element());
        if (LYradGrid.hidden == false) {
            htmlContent += getOuterHTML(LYradGrid.get_element());
        }
    }
    htmlContent += "</body></html>";
    previewWindow.document.open();
    previewWindow.document.write(htmlContent);
    previewWindow.document.close();
    previewWindow.print();
 
    if (!$telerik.isChrome) {
        previewWindow.close();
}
 
    function getOuterHTML(obj) {
    if (typeof (obj.outerHTML) == "undefined") {
        var divWrapper = document.createElement("div");
        var copyOb = obj.cloneNode(true);
        divWrapper.appendChild(copyOb);
        return divWrapper.innerHTML
    }
    else {
        return obj.outerHTML;
    }
}


Daniel
Telerik team
 answered on 07 Aug 2014
1 answer
90 views
I created a little test application to look at this control and I'm having a weird issue. I am doing this all programmatically server side. So I added a couple of nodes to the diagram when it starts and then added a button that adds another node to the diagram. If I move the nodes, when the app posts back to add a new node the nodes that were moved revert back to their original position. Is there something else I need to do like capture something on the node moved event?

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        MapDiagram.BorderStyle = BorderStyle.Solid;
        MapDiagram.BorderColor = Color.Black;
        MapDiagram.Resizable = false;
        List<MapTask> tasks = MapHelper.GetSampleTasks(4);
        AddTasksToMap(tasks);
    }
}
 
private void AddTasksToMap(List<MapTask> tasks)
{
    foreach (MapTask task in tasks)
    {
        DiagramShape shape1 = new DiagramShape()
        {
            Width = 50,
            Height = 50,
            Type = "rectangle",
            X = task.XPosition,
            Y = task.YPosition
        };
        shape1.ContentSettings.Text = task.Description;
        MapDiagram.ShapesCollection.Add(shape1);
    }
}
 
protected void BtnAddTaskClick(object sender, EventArgs e)
{
    Random r = new Random();
    DiagramShape shape1 = new DiagramShape()
    {
        Width = 50,
        Height = 50,
        Type = "rectangle",
        X = (r.Next(900)),
        Y = (r.Next(640))
    };
    shape1.ContentSettings.Text = "New Task";
    MapDiagram.ShapesCollection.Add(shape1);
}
Slav
Telerik team
 answered on 07 Aug 2014
8 answers
1.0K+ views
Hi 
     I have a radlistbox item with check boxes. User can successfully Check and unchecked the items . Can i check if user click on the Item text, Unchecked if User again click on the Item text.  Please provide your valuable  Suggestion. ASAP
Prajakta
Top achievements
Rank 1
 answered on 07 Aug 2014
1 answer
101 views
Hi Admin,
I'm coding Listview in UserControl display data from database( Image store in database with type Binary data)
I have a problem when i can't show image in listview. Do you have a Demo to solve it, pass data Image?.
Princy
Top achievements
Rank 2
 answered on 07 Aug 2014
2 answers
64 views
Hi,

I'm handling series without exceptions.
So in other words - the user always edits the whole series (or a single appointment if no recurrence is defined).

I found a thread here how to suppress the "Series or single appointment" dialog on editing.
It suppresses the dialog - and shows the edit form for series - this is fine, but it also suppresses the delete confirmation.

I found out how to "filter between edit and delete" - but I have no idea how to go on.
What I want is a "normal" confirmation dialog "Do you want to delete the series"???

Here my code so far....
function RecurrenceActionDialogShowingHandler(sender, args) {
 
    if (args._recurrenceAction == 1) {
        args.set_cancel(true);
    }
    //Edit this instance only: 
    //args.set_editSeries(false); 
 
    //Edit the entire series: 
    args.set_editSeries(true);
}

It suppresses the selection for edit - but shows it for delete.

Manfred
ManniAT
Top achievements
Rank 2
 answered on 07 Aug 2014
1 answer
42 views
There are some wrong icons in RadTreeList with MetroTouch skin, these icons appears with the option ButtonType= ImageButton on the TreeListEditCommandColumn, you can see it on your own demos http://demos.telerik.com/aspnet-ajax/treelist/examples/dataediting/net35automaticdataediting/defaultcs.aspx with the MetroTouch skin enabled.
Greetings.

Galin
Telerik team
 answered on 07 Aug 2014
4 answers
154 views
Set RadDropDownTree SelectedItem Image

This sample of code is used to show in the selected item of a RadCombobox a IMAGE

<script language="javascript" type="text/javascript">
    function showImageOnSelectedItemChanging(sender, eventArgs) {
        var input = sender.get_inputDomElement()
        input.style.background =
            "url(" + eventArgs.get_item().get_imageUrl() + ") no-repeat";
        input.style.paddingLeft = "22px";
    }
 
    function showFirstItemImage(sender) {
        var input = sender.get_inputDomElement()
        input.style.background =
            "url(" + sender.get_items().getItem(0).get_imageUrl() + ") no-repeat";
        input.style.paddingLeft = "22px";
    }
</script>


I want to do the same in a RadDropDownTree. It's possible?

Best Regards and many thanks in advance for your help



Aneliya Petkova
Telerik team
 answered on 07 Aug 2014
1 answer
111 views
I have a saved the multiple checked items into my database, when I retrieve out the records, it only checked one item in the listbox instead of multiple. I have also verified that the records returned in the datatable contains 3 records.

aspx:
 <telerik:RadListBox ID="lbxDevelopmentComponent" SelectionMode="Multiple" runat="server" OnClientItemChecked="OnClientItemChecked"
                                        CheckBoxes="true" DataTextField="Text" DataValueField="Value" Width="500px" Height="150px">
                                    </telerik:RadListBox>

.cs:
var dtDevelopmentComponent = _objSqlManager.ExecuteSQL(sqlDevelopmentComponent.ToString(), paramDevelopmentComponent);

                        if (dtDevelopmentComponent.Rows.Count > 0)
                        {
                            for (int i = 0; i < dtDevelopmentComponent.Rows.Count; i++)
                            {
                                RadListBoxItem item = lbxDevelopmentComponent.FindItemByText(dtDevelopmentComponent.Rows[0]["DEVELOPMENT_COMPONENT_NAME"].ToString());
                                if (item != null)
                                    item.Checked = true;
                            }
                        }
Shinu
Top achievements
Rank 2
 answered on 07 Aug 2014
2 answers
87 views
I need to define a button in code to open a window
This is the code I'm using
Dim img As ImageButton

For x = 0 To weekcolour.GetUpperBound(0)

columnname = "ColumnITask" + (x + 1).ToString
imagename = "btnEx" + (x + 1).ToString
​ If Not (img Is Nothing) Then
img.ImageUrl = "/private/images/" + weekcolour(x) + "_light_ilp.png"
             If weekcolour(x).Contains("green") Then
                    img.OnClientClick = "openRadWindow('<%# DataBinder.Eval(Container.DataItem,'" + student_id + "') %>'); return false; > """
             End If
End If
next
The code updates the image url correctly but does not add the onClientCick event
It still does not work if I remove the "if" statement
This is my open window script
<script type="text/javascript"><br><br>        function openRadWindow(StudentID) {<br>            var oWnd = radopen("task_update.aspx?StudentID=" + StudentID, "RadWindow1");<br>            oWnd.center();<br>        }<br>    </script>


Simon Channell
Top achievements
Rank 1
 answered on 07 Aug 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
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?