Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
158 views

I am working on breaking down very complex aspx files into smaller more manageable chunks by breaking out duplicated sections of code. So far this has worked out well, however, in some instances, the resulting control requires a window manager. This isn't a problem until more than one control is used that requires a window manager.

However, when including more than one control, a window manager is created for each control. Again, this isn't a huge problem, except that it duplicates javascript functions on the page so that there are multiple functions with the same name and code, for example

function RadWindowprompt_detectenter(id, ev, input)

This isn't my code, but code injected into the resulting html page to handle events for the radwindows.

Is the only solution to place a single windowmanager in the master page and then try and find it in the codebehind and then edit it programmatically to add window templates as needed?

I'd like to remove the duplicates because additional window managers simply add more overhead to the page.

I'll entertain any ideas to make it more efficient.


										
Keith
Top achievements
Rank 2
 answered on 14 Jun 2013
1 answer
73 views
Hello, 
I want to know capabilities telerik search box, asp.net ajax that can do this ?

Plamen
Telerik team
 answered on 14 Jun 2013
5 answers
220 views
Hi:
I have a scheduler in a content page.

How show and hide the resource types??

<telerik:RadScheduler ID="RadScheduler1" runat="server"
                            Skin="Sunset"
                            SelectedView="MonthView"
                           
                            onappointmentdelete="RadScheduler1_AppointmentDelete"
                            onappointmentinsert="RadScheduler1_AppointmentInsert"
                            onappointmentupdate="RadScheduler1_AppointmentUpdate" ShowViewTabs="False"
                             Width="60%" Culture="Spanish (Mexico)" onformcreated="RadScheduler1_FormCreated"
                             >
                      <ResourceTypes>
                            <telerik:ResourceType KeyField="ID" Name="Room" />     <--- databind in server side
                            <telerik:ResourceType KeyField="ID" Name="User" />                            
                         </ResourceTypes>
</telerik:RadScheduler>
tanks


Plamen
Telerik team
 answered on 14 Jun 2013
4 answers
1.4K+ views
I have been working with client script using RadButton, and noticed some odd behavior when calling args.set_cancel. During the OnClientClicking event, i check a condition, if true, button is allowed to postback, if false, set_cancel is set to true. I have two buttons using this event.

function OnClientClicking(sender, args) {
    if (somecondition == false) {
        args.set_cancel(true);
    }
}

Now, if I click Button1, and somecondition is false, then the postback will cancel. However, if I click Button2 next, when the OnClientClicking event is fired, somecondition is true, and set_cancel(true) is NOT called, but... the button does not post back. Now if I reload the page and click Button2 first, then it posts back, until i click Button1, then Button2 no longer posts back.

I tried explicitly calling args.set_cancel(false); 
but it still does not work right.

function OnClientClicking(sender, args) {
    if (somecondition == false) {
        args.set_cancel(true);
    } else {
        args.set_cancel(false);
    }
}

Any ideas what might be causing this weirdness?


Keith
Top achievements
Rank 2
 answered on 14 Jun 2013
2 answers
470 views
I have a column that has some long data values.  On unselected rows I would like the ItemStyle wrap="False".  And when I select a row I want the style for this column in the selected row to have wrap="True".  Is there a way to do this, either through configuration in the aspx or in client code?  I do have a client javascript function for the onRowSelected event where I could put some code.
Andy
Top achievements
Rank 1
Iron
 answered on 14 Jun 2013
1 answer
81 views
I am working on an Ektron webcalendar which is built onTelerik. I am using the selected date property to set the focus to a specific month on my calendar. After this is set the previous or next button on the top left corner will only work for the latest 2 months.
for ex - If I set the focus to July, then the prev or next button will only allow me to see June and August.
Any help is greatly appreciated.

if (focuDate != DateTime.MinValue)
        {
            Telerik.Web.UI.RadScheduler scheduler = (Telerik.Web.UI.RadScheduler)WebCalendar1.Controls[0];
            scheduler.SelectedDate = focuDate;
        }

Boyan Dimitrov
Telerik team
 answered on 14 Jun 2013
1 answer
90 views
Subject:-Calculated columns in autogenerated columns of Radgrid

Hi,

We have a rad grid with auto generated columns. We need to add a calculated columns  where values corresponding to these auto generated columns will be summed up. Please find below the exact requirement snap:-

CaseID

CASEDT

CARDIOLOGY

CTSCAN

TESTTotal

C001

2013/06/13

$500

$100

$600

C002

2013/06/13

$500

 

$500

C003

2013/06/14

 

$100

$100

C004

2013/06/14

$500

$100

$600



Yellow highlighted columns are auto  generated.

Please provide suitable solutions for the above mentioned.
Thanks & regards
Purojit
Shinu
Top achievements
Rank 2
 answered on 14 Jun 2013
1 answer
54 views
Here is my javacript  that open radwindow
  function RadWindowOpenCourseContinuen(num, cid) {
                var wnd = $find("<%=modalPopup.ClientID %>");
                wnd.setUrl("test.aspx");
                wnd.show();
                return false;
            }
Here is button that open radwindow
  <asp:Button ID="btnContinue" runat="server" CssClass="button" TabIndex="37" Text="Click here to continue..."
                                            OnClientClick="RadWindowOpenCourseContinuen(); return false; " />
Here is my code behind part
  string strhtmlnew = "javascript:RadWindowOpenCourseContinuen('1','" + Session["CID"] + "');";
 btnContinue.Attributes.Add("onclick", strhtmlnew);
Problem is not passed argument simple open test page
Dhamodharan
Top achievements
Rank 1
 answered on 14 Jun 2013
2 answers
185 views
Hi All,

Weird problem.  Here's what's up:

  • I hide tabs client side via .set_visible(false).
  • When I go to show tabs via .set_visible(true) -- after the .set_visible(false) -- they do not display.

Here is my specific function: 

function v_JobRTS(positiontype) {
 
    var JobRTS = $find("<%=JobRTS.ClientID %>");
    var moretab = JobRTS.get_tabs().getTab(1);
    var finishtab = JobRTS.get_tabs().getTab(2);
 
    if (positiontype == "0" || positiontype == "1") {
         
        //Here is the section that doesn't work.
        moretab.set_visible(true);
        finishtab.set_visible(true);
 
    } else if (positiontype == "2") {
 
        moretab.set_visible(false);
        finishtab.set_visible(true);
 
    } else {
 
        moretab.set_visible(false);
        finishtab.set_visible(false);
 
    }
 
}

Here are some things I've tried:

  • Repainting the tab strip.
  • Finding the tabs themselves using different methods outlined in the documentation. 
  • Stepping through the code carefully.

When I step through the code, it goes right past the desired functions with no effect.

Thanks,

Jim
James
Top achievements
Rank 1
 answered on 14 Jun 2013
2 answers
78 views
hi team telerik,

I have RadGrid and ther is Textbox in ItemTemplate , like this :
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" GridLines="None" AutoGenerateColumns="false" OnItemCreated="RadGrid1_ItemCreated">
    <MasterTableView>
        <Columns>
            <telerik:GridTemplateColumn HeaderText="SANDI KETERANGAN">
                <ItemTemplate>
                    <telerik:RadTextBox runat="server" ID="tbsandi" Enabled="false" ></telerik:RadTextBox>
                </ItemTemplate>
            </telerik:GridTemplateColumn>
        </Columns>
    </MasterTableView>

and code behind for method  OnItemCreated="RadGrid1_ItemCreated"

protected void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        var ditem = (GridDataItem)e.Item;
        var tbsansi = (RadTextBox) ditem.FindControl("tbsandi");
        tbsansi.Attributes.Add("onclick", "openWin(" + ditem.ItemIndex + ");");
    }
}

and Script JavaScript like this :
<script type="text/javascript">
    function openWin(index) {
        //var RadGrid1 = $find('<%=RadGrid1.ClientID %>');
        //var masterTableView = RadGrid1.get_masterTableView();
        //var row = masterTableView.get_dataItems()[index];
 
        var oWnd = radopen("SandiKeterangan.aspx", "RadWindow1");
    }
     
    function OnClientClose(oWnd, args) {
        var arg = args.get_argument();
 
        var grid = $find("<%=RadGrid1.ClientID %>");
        var MasterTable = grid.get_masterTableView();
        var length = MasterTable.get_dataItems().length;
 
        for (var i = 0; i < length; i++) {
            var RadTextBoxSandi = MasterTable.get_dataItems()[i].findElement("tbsandi");//access the TextBox control
            RadTextBoxSandi.innerText = arg.Kode;// assigning value to TextBox control
        }
 
 
    }
</script>


how can I get the index selectedRow RadGrid, like scripts that I remak in openWind function to be able to set when the event CloseWindow tbruleid
example:
I want when I click tbruleid existing index RadGrid1 in row 5, then appeared popup her choice, and I choose its value, and the popup closes, then the value I select it, there are at tbruleid index that is in row 5 ..
with existing javascript , his circumstances set all men in all tbruleid row ..

very simple, but I can not get the row index value after closewindow ..

please , I need your help...
thanks advance

chester(misbakhul)...
Misbakhul
Top achievements
Rank 1
 answered on 14 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?