Telerik Forums
UI for ASP.NET AJAX Forum
18 answers
1.0K+ views
Okay, I've read and tried every approach on the forums about this (I think), so I PROMISE you this is my exhausted efforts causing me to post a probably pretty tired topic.

Pretty simple: I have a page that is in a masterpage (not sure if thats important) with a link on it that opens a radwindow (I will put the code out below). That opens just fine. The page in the radwindow is a simple data-entry page, upon where I hit the "Save" button, it saves to the database, then closes the radwindow on postback. In the same radwindow, theres a cancel button that only calls the javascript to close the radwindow, and that works just fine. The code-behind that is supposed to close the window on postback just calls the same function that WORKS for the cancel button; the page posts back and the window re-opens, except its NOT modal (the initial window is modal) so the background is not greyed out, and its also twice the width it once was. Once the window has wrongfully reopened, the cancel button no longer works, and the save button just keeps posting back without closing.

I've already tried double-checking that the javascript is firing on postback by putting in alerts.

The link that opens the radwindow:
<asp:LinkButton ID="lbAddPhone" runat="server" onclientclick="javascript:InsertPhone(); return false;">+ Phone/Email</asp:LinkButton> 


InsertPhone()
function InsertPhone() { 
        var hid = document.getElementById("<%= hidContactId.ClientID %>"); 
        var oWnd = $find("<%= wndAddPhone.ClientID %>"); 
        oWnd.setUrl("popup_addcontact.aspx?which=3&id=" + hid.value); 
        oWnd.show(); 
    } 

Now for the popup_addcontact.aspx page:
protected void btnPhoneSave_Click(object sender, EventArgs e) 
    { 
        string closingscript = "closeWin();"
        ScriptManager.RegisterStartupScript(thisthis.GetType(), "closeWin", closingscript, true); 
    } 

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

If anyone has any insight, I'd greatly appreciate it. Like I said, I have confirmed that the javascript IS firing, and I have tried several different methods of code-behind injection, including putting a literal control on the host page.

Thanks!
Stamo Gochev
Telerik team
 answered on 21 Aug 2015
2 answers
122 views
Hi there , I read many articles on ticker , some of them are http://demos.telerik.com/aspnet-ajax/rotator/examples/multiplescroller/defaultcs.aspx and http://demos.telerik.com/aspnet-ajax/ticker/examples/functionality/radticker/defaultcs.aspx , code is shown in aspx format how to get the same code in cshtml format .
Helen
Telerik team
 answered on 21 Aug 2015
1 answer
84 views
Hi there , I read many articles on ticker , some of them are Demo1and ​Demo1, code is shown in aspx format how to get the same code in cshtml format .
I also tried only telerik tags in Razor views but still no working , I've installed tekerik trial version. does that make any difference
<telerik:RadTicker ID="RadTicker1" AutoStart="true" Width="300px">
    <items>
        <telerik:RadTickerItem runat="server" ID="RadTickerItem1" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
             consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
            cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.">
        </telerik:RadTickerItem>
    </items>
</telerik:RadTicker>
Helen
Telerik team
 answered on 21 Aug 2015
3 answers
319 views
<telerik:RadAsyncUpload runat="server" ID="radUpload" MultipleFileSelection="Automatic" ManualUpload="true" HideFileInput="true" Localization-Select="Select files ..." EnableFileInputSkinning="true" OnClientFilesSelected="onFilesSelected"></telerik:RadAsyncUpload>

 

Hi,

 Based on above code, just want to ask how to loop through selected files to get the row and size? Please take note that ManualUpload is set to true.

Basically I want to have below piece of code (but this was created for OnClientFileSelected)

args.get_fileInputField().files[0].size;
 
var row = args.get_row();               
$(row).addClass("file-row");

Aneliya Petkova
Telerik team
 answered on 21 Aug 2015
3 answers
123 views
Helllo

I am using ext.net prgramming and also telerik editor but rad editor gives the following error when i used it in ext.net

"Control with type 'Telerik.Web.UI.RadEditor' cannot be handled by layout"

And this my html code :

 <ext:FieldSet runat="server" Title="Editor">
                                            <Content>
                                                <telerik:RadEditor ID="txtMoreDescription" runat="server" >
                                                </telerik:RadEditor>
                                            </Content>
                                            <Listeners>
                                                <AfterRender Fn="UpdateSetting" Delay="500" />
                                            </Listeners>
                                        </ext:FieldSet>







Test Pyxis
Top achievements
Rank 1
 answered on 21 Aug 2015
1 answer
104 views

Hi there , I read many articles on ticker , some of them are Demo1 and ​ Demo2 , code is shown in aspx format how to get the same code in cshtml format .

I also tried only telerik tags in Razor views but still no working , I've installed tekerik trial version. does that make any difference
<telerik:RadTicker ID="RadTicker1" AutoStart="true" Width="300px">
    <items>
        <telerik:RadTickerItem runat="server" ID="RadTickerItem1" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
            incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
             consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat
            cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.">
        </telerik:RadTickerItem>
    </items>
</telerik:RadTicker>

Helen
Telerik team
 answered on 21 Aug 2015
3 answers
88 views

Hi

I've got 3 RadHtmlCharts one below the other. The​y have different value range f.e. Chart1 from -9 to 5 and Chart2 from -100000 to + 100000. That causes the situation shown on picture, that they are placed not in line. I've already tried to adjust it in JS, but didn't manage to.

My code (I've tried many combinations):

var chart = $find("<%=timeChart.ClientID%>");

chart.get_kendoWidget()._plotArea.axisY.box.expand(50,50);

chart.get_kendoWidget()._plotArea.axisY.box.​pad(50);​

chart.get_kendoWidget()._plotArea.axisY.box.x2 = 150;

chart.repaint();

chart.get_kendoWidget().redraw();

chart.get_kendoWidget()​​.refresh();

 

None of this have worked.

I'm looking forward for your help

Greets,

Maciek

Stamo Gochev
Telerik team
 answered on 21 Aug 2015
1 answer
141 views

Hi,

I have a problem with RadDatePicker controls in Asp.Net.

I am dynamically creating 2 RadDatePicker controls at runtime and I want to apply CompareValidator to check if the 'From Date' is less than the 'To Date'. The controls are dynamically created so i have set the AutoPostBack = false. With that the controls are not throwing the validation if i choose the wrong dates.

The condition is:

Date Validation checks - From Date <= To date

Here is my code:

for (int j = 0; j < slistArray.Length; j++)
                {

int counter = 0;

int DateRangeFound = 0;

switch (QuestionType)
                            {

case "DateRange":
                                    if (QuestionName == "DateFrom")
                                    {
                                        RadDatePicker rdpDateFrom = new RadDatePicker();
                                        rdpDateFrom.CssClass = "form-control form-control-item";
                                        rdpDateFrom.ID = "rdpDateFrom" + j.ToString() + "-" + counter;
                                        rdpDateFrom.AutoPostBack = false;
                                        rdpDateFrom.DatePopupButton.Visible = true;
                                        rdpDateFrom.ShowPopupOnFocus = true;
                                        rdpDateFrom.EnableScreenBoundaryDetection = true;
                                        rdpDateFrom.MaxDate = DateTime.Now;

                                        txtC1.Controls.Add(rdpDateFrom);

                                        ++DateRangeFound;
                                    }
                                    else if (QuestionName == "DateTo")
                                    {
                                        RadDatePicker rdpDateTo = new RadDatePicker();
                                        rdpDateTo.CssClass = "form-control form-control-item";
                                        rdpDateTo.ID = "rdpDateTo" + j.ToString() + "-" + (counter - 1);
                                        rdpDateTo.AutoPostBack = false;
                                        rdpDateTo.DatePopupButton.Visible = true;
                                        rdpDateTo.ShowPopupOnFocus = true;
                                        rdpDateTo.EnableScreenBoundaryDetection = true;
                                        rdpDateTo.MaxDate = DateTime.Now;

                                        txtC1.Controls.Add(rdpDateTo);​

                                        ++DateRangeFound;
                                    }
                                    if (DateRangeFound > 1)
                                    {
                                        CompareValidator cvdpDate = new CompareValidator();
                                        cvdpDate.ID = "cvdpDate" + j.ToString() + "-" + counter;
                                        cvdpDate.ControlToCompare = "rdpDateFrom" + j.ToString() + "-" + (counter - 1);
                                        cvdpDate.ControlToValidate = "rdpDateTo" + j.ToString() + "-" + (counter - 1);
                                        cvdpDate.Operator = ValidationCompareOperator.GreaterThanEqual;
                                        cvdpDate.Type = ValidationDataType.Date;
                                        cvdpDate.Text = "*";
                                        cvdpDate.ForeColor = Color.Red;
                                        cvdpDate.ErrorMessage = "End date must be equal or greater than start date - please correct dates.";

                                        txtC1.Controls.Add(cvdpDate);

                                    }
                                    break;

}

panelBody.Controls.Add(txtC1);
                            counter++;

}

 

Any suggestions for the client side jquery validation will also be helpful. 

 

Thank you.

Viktor Tachev
Telerik team
 answered on 20 Aug 2015
1 answer
89 views

I am currently attempting to add custom nodes to the file explorer view, with the selection of the lowest level of each node displaying the contents of multiple listed directories (create nodes with custom names as their own 'custom trees' where the contents of the corresponding listview would include those of directory1 + 2 + 3 etc.) Here is what I have so far, and I am looking for the equivalent value of the 'viewpath' from the main fileexplorer object for each individual node. 

protected void BindDataTable()
    {
        RadTreeNode temp_node;
        DataTable node_template = CreateDirectoryTable();

        foreach (DataRow row in node_template.Rows)
        {
            temp_node = new RadTreeNode();
            temp_node.Text = (string)row[1];
            temp_node.Value = (string)row[2];

            FileExplorerBase.TreeView.Nodes.Add(temp_node);
        }
    }​

 Is it a simple property in the node object? Because I cannot seem to find it. Or is this functionality present in the treeview object directly?

Vessy
Telerik team
 answered on 20 Aug 2015
4 answers
425 views
I have a combo box and a button inside of a EditFormSettings \ FormTemplate.  In the Items_command event of the grid I trap the buitton click event and I'm tryiong to enable or disable it.

Here is the page code

<

 

telerik:RadGrid ID="RadGrid1" runat="server">

 

 

<HeaderContextMenu EnableTheming="True">

 

 

<CollapseAnimation Type="OutQuint" Duration="200">

 

 

</CollapseAnimation>

 

 

</HeaderContextMenu>

 

 

<MasterTableView CommandItemDisplay="Top" DataKeyNames="Contact_ID" Width="100%"

 

 

ExpandCollapseColumn-Display="true" HierarchyDefaultExpanded="false"

 

 

EditMode="EditForms" AllowPaging="True" PageSize="5">

 

 

<ItemTemplate>

 

 

<span lang="en-us">ITEM TEMPLATE</span>

 

 

</ItemTemplate>

 

 

<RowIndicatorColumn>

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

</RowIndicatorColumn>

 

 

<ExpandCollapseColumn>

 

 

<HeaderStyle Width="20px"></HeaderStyle>

 

 

</ExpandCollapseColumn>

 

 

<EditFormSettings EditFormType="Template">

 

 

<FormTemplate>

 

 

<asp:DropDownList ID="cboCountry" runat="server" Enabled="false">

 

 

</asp:DropDownList>

 

 

<asp:Button runat="server" ID="butCountry" text="change" CausesValidation="False"

 

 

CommandName="ChangeCountry" />

 

 

<br />

 

 

<br />

 

 

</FormTemplate>

 

 

</EditFormSettings>

 

 

</MasterTableView>

 

 

<FilterMenu EnableTheming="True">

 

 

<CollapseAnimation Type="OutQuint" Duration="200">

 

 

</CollapseAnimation>

 

 

</FilterMenu>

 

 

</telerik:RadGrid>

 



and here is the Item_command event in the code behind


 

Private Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand

 

 


Dim
strCommand As String

 

strCommand = e.CommandName.ToUpper


Select

 

Case strCommand

 

 

    Case Is = "CHANGECOUNTRY"

 

 

       Dim editItem As GridDataItem = CType(e.Item, GridDataItem)

 

       Dim

 

ContactCombo As DropDownList = CType(editItem.FindControl("cboCountry"), DropDownList)

 

        ContactCombo.Enable = "True"

 

    End Select

 

 

End Sub

 


Why is it that I can't get a handle to the combo box ?

Any help would be great !
Viktor Tachev
Telerik team
 answered on 20 Aug 2015
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?