Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
1.5K+ views

The RadWindow is a client-side object – its UI is created when it is first shown and this is the point when the CSS and scripts are loaded as well. This means that it should be used on the client via JavaScript, yet it turns out that it is a very common scenario that the developer wishes to initiate the RadWindow’s showing from the code-behind.


The VisibleOnPageLoad property should not be used for this purpose. It is a behavior property which will result in the RadWindow opening every time the page is post back.

Quite often the VisibleOnPageLoad property gets set to true while the intention is that the RadWindow should only show once. Doing so will result in the RadWindow reopening if a postback is initiated from another element from the page, which is rarely the desired behavior. Also, this approach will not work in case this happens in an AJAX request and the RadWindow is not included in the partial page update.

There are several ways to work around this:
1) Register a JavaScript function from the server-side and do not use the VisibleOnPageLoad property, for example:

<telerik:RadWindow runat="server" ID="RadWindow1" NavigateUrl="http://google.com/"></telerik:RadWindow>
<asp:Button ID="Button1" Text="open the RadWindow from the server" runat="server" OnClick="Button1_Click" />
C#
protected void Button1_Click(object sender, EventArgs e) 
    //business logic goes here 
   
    string script = "function f(){$find(\"" + RadWindow1.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true); 
}


VB:
Protected Sub Button1_Click(sender As Object, e As System.EventArgs) Handles Button1.Click 
    'business logic goes here 
   
    Dim script As String = "function f(){$find(""" + RadWindow1.ClientID + """).show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);"
    ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, True
End Sub


2) Reset the VisibleOnPageLoad property to false with code when suitable, depending on the particular scenario

3) Set EnableViewState to false for the RadWindowManager that contains the desired RadWindows

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 23 Aug 2011
7 answers
128 views
I'm using the most updated version of Q1 2009 and in Chrome 3 and Safari 4, when I click on an image, the resize handles don't appear and when I right click on an image, the context menu shows up, but when I click on any of the menu items, the menu disappears and nothing happens.
Peter
Telerik team
 answered on 23 Aug 2011
1 answer
84 views
Hi,
I have a combobox bound to a webservice, if I enter "1-" then the following filtered results are shows  "1-a" & "1-b".
"1-a" is ticked, then a search value of  "2-" is entered.
 "2-a" is ticked.
After closing the combobox "1-a" is no longer selected.

It appears that the combo box loses it checked items that are no longer displayed in the filtered results.
Is their any way around this?

         <telerik:RadComboBox ID="RadComboBox1" Runat="server" Width="98%"
                    CheckBoxes="True" Filter="Contains" EnableEmbeddedSkins="true" EnableLoadOnDemand="true" >
                    <WebServiceSettings Path="webservices/MainSearch.asmx" Method="Rooms" />
                </telerik:RadComboBox>

Brian Taylor
Top achievements
Rank 1
 answered on 23 Aug 2011
3 answers
164 views
How do I set a textbox that has been assigned to a NumericTextBoxSetting control to accept real numbers. ie: a number with any number of decimal places.

The
DecimalDigits
property allows the setting to be 0 up to 99. This is not what I need.  What if my user enters a number with 600 decimal places?

Here is my code.

TextBox tbFloat = new TextBox();
string fID = ID + "Value" + i2;
tbFloat.ID = fID;
tbFloat.Attributes.Add("name", fID);
tbFloat.Text = Value;
c2.Controls.Add(tbFloat);
  
Telerik.Web.UI.NumericTextBoxSetting radF = new Telerik.Web.UI.NumericTextBoxSetting();
radF.EmptyMessage = "";
//radF.DecimalDigits = ? ;

radF.Type = Telerik.Web.UI.NumericType.Number;
radF.Validation.IsRequired = false;
  
TargetInput fi = new TargetInput();
fi.ControlID = fID;
radF.TargetControls.Add(fi);
  
RadInputManager1.InputSettings.Add(radF);

In the code above I have commented out the DecimalDigits line. Running this I get a textbox that accepts real numbers just fine, but always round them down to 2 decimal places! Huh?

I need one that accepts numbers of any number of decimal places.

I even tried this...

radF.DecimalDigits = -1 ;

But that of course does not work (would have been nice if it did) :)

Any clues on this one please?

Thanks

Brad









Vasil
Telerik team
 answered on 23 Aug 2011
1 answer
72 views
I want to start my grids out with no data, but I want to show the filter row ,so the user can use it as a search.

After they apply the filter the grid will populate.

Is this possible?
Pavlina
Telerik team
 answered on 23 Aug 2011
3 answers
253 views
HI,
I have fixed first column as default Group Item in GroupByExpressions and user can sort data but can not delete this group but problem is i want to disable close image from this header only. Rest columns if user will group then he can delete those columns from group header.
FYK " I have tried 
If (expression.GroupByFields(0).FieldName = "EngNameWithID") Then
     radGrdEngagments.GroupingSettings.ShowUnGroupButton = False
Else
     radGrdEngagments.GroupingSettings.ShowUnGroupButton = True
End If

But it's shows/removes close button for all items of group panel.
For more information see the image in Attachment.

Thanks.........
Rajneesh
Top achievements
Rank 2
 answered on 23 Aug 2011
4 answers
877 views
Hi Team,
I have a radgrid with some TemplateColumns in it.
Two such template columns have Raddatepicket in EditItemTemplate.
I want to find those two raddatepickers (which are in two different columns) and fire the Selected Datechanged client side event.
How can I do this??
Please help..

Regards,
Lok..
Princy
Top achievements
Rank 2
 answered on 23 Aug 2011
1 answer
166 views
How do I pass the retrieved extra values from my Upload dialog to my Custom content provider's StoreFile method? I see there is a string[] arguments parameter but how do I set this value?
protected void RadFileExplorer1_ItemCommand(object sender, Telerik.Web.UI.RadFileExplorerEventArgs e)
{
    if (e.Command == "UploadFile")
    {
        Telerik.Web.UI.RadFileExplorer explorer = sender as Telerik.Web.UI.RadFileExplorer;
        Telerik.Web.UI.RadUpload upload = explorer.Upload;
  
        //e.Path holds the file path
        string name = e.Path.Split(new char[] { '/' }).Last(); // get the filename including extension ;
  
        foreach (Telerik.Web.UI.UploadedFile uploadedFile in upload.UploadedFiles)
        {
            if (name.Equals(uploadedFile.GetName()))
            {
                string fileName = uploadedFile.GetName();
                string imageSize = uploadedFile.GetFieldValue("imageSize");
  
                // would like to pass imageSize to StoreFile method...
                  
                break;
            }
              
        }
    }
}

Dobromir
Telerik team
 answered on 23 Aug 2011
3 answers
101 views
HI,

I want to use export data to excel of radGrid.
But My radGrid is showing only 5 columns from a DB table. I want export all columns of that table.
is that possible?

I dont want to show all the columns in radGrid.
Jayesh Goyani
Top achievements
Rank 2
 answered on 23 Aug 2011
2 answers
164 views
Hi All,

I have RadGrid with TemplateColumns, one of the cloumns has a RadComboBox in the edititemtemplate and insertitemtemplate
and in the other i have RadDatePicker in the edititemtemplate and insertitemtemplate also...

in the edit or insert mode and on the selection of the RadComboBox i need to make the other templatecolumn unvisible (the corresponding column header and the RadDatePicker).

i did this using the selectIndexedChanged of the ComboBox and to get this column and set its readonly property to true. and all works fine but i noticed that i need to rebind the Grid so the corresponding column disappear...but this causes that the selection of the Radcombobox to be unselected also since all the grid is rebinded!!!

how can i keep the selection or shall i do it in another way???

attached screen shots of my problem
hope you can help as soon as possible...

Many Thanks
Asa'ad....


Veli
Telerik team
 answered on 23 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?