Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
228 views
Hi
I have been through these forums and found lots of similar examples but none that quite fix my problem.
I have a rad window with a content template that pops up on click of a button.
The user must complete certain things that are checked on the server within the rad window unless an error message is shown, otherwise the details added are saved and the window needs to close.

My problem is my rad window doesn't close!

This is my radwindow 
<telerik:RadWindowManager ID="Radwindowmanager1" runat="server">
    <Windows>
        <telerik:RadWindow runat="server" ID="winDetail" Width="400px" Height="400px"
            ReloadOnShow="true" ShowContentDuringLoad="false" Modal="True" Behaviors="None"
            VisibleTitlebar="true" VisibleStatusbar="false">
            <ContentTemplate>
             
                    <h3>
                        Injury Details
                    </h3>
                    <asp:Label runat="server" ID="lblError"></asp:Label>
                    <div class="modalForm">
                        <ol>
                            <li>
                                <label class="noFloatLabel">
                                    Injury
                                </label>
                                <telerik:RadComboBox ID="ddlName" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlInjuryName_OnSelectedIndexChanged" />
                                <telerik:RadTextBox runat="server" ID="txtNewName">
                                </telerik:RadTextBox>
                            </li>
                            <li>
                                <label class="noFloatLabel">
                                    Specific Detail
                                </label>
                                <telerik:RadComboBox ID="ddSpecific" runat="server" />
                                <telerik:RadTextBox runat="server" ID="txtNewSpecific">
                                </telerik:RadTextBox>
                            </li>
                        </ol>
                    </div>
                    <br />
                    <asp:Button runat="server" ID="btnAddDetail" Text="Add" OnClick="btnAddDetail_Click" />
            <asp:Button runat="server" ID="btnCancel" Text="Cancel" OnClick="btnCancel_Click" />
         <asp:HiddenField runat="server" ID="hdnId" />
            </ContentTemplate>
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

I am using an ajax manager to try and control the autopopulation of my dropdowns and btnAddDetail with the error message.
<telerik:RadAjaxManager runat="server" ID="aj1">
    <AjaxSettings>
        
        <telerik:AjaxSetting AjaxControlID="ddlName">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="ddlSpecific" />
            </UpdatedControls>
        </telerik:AjaxSetting>
         <telerik:AjaxSetting AjaxControlID="btnAddDetail">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="lblError" />
                 
            </UpdatedControls>
        </telerik:AjaxSetting>
         
    </AjaxSettings>
</telerik:RadAjaxManager>

When I click the btnAddDetail 

I run this function
protected void btnAddDetail_Click(object sender, EventArgs e)
        {
 
            if ((ddlName.SelectedValue != string.Empty || txtNewName.Text != string.Empty)
                && (ddlSpecific.SelectedValue != string.Empty || txtNewSpecific.Text != string.Empty))
            {
//do processing if processing fails show error if not close window
 
string script = "function f(){Close(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";         
    ScriptManager.RegisterStartupScript(
this, this.GetType(), "close", script, true);

            }
            else
            {
                lblError.Text = "You must select a name and description";
            }
        }


This is my javascript to close the window:
function GetRadWindow() {
          var oWindow = null;
          if (window.radWindow) oWindow = window.radWindow; //Will work in Moz in all cases, including clasic dialog
          else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow; //IE (and Moz az well)
          return oWindow;
      }
 
      function Close() {
          GetRadWindow().close();
      }


Can anyone help with my my window won't close? I know its something to do with how I've used the ajax but I can't work out what!

Bex
Bex
Top achievements
Rank 1
 answered on 18 May 2012
3 answers
170 views
I need to know how to get to the selected value of the filter menu. For example if the user selects "Contains" from the menu, I need to know where to get to the value "Contains".

When I try to get it from column.CurrentFilterFunction, I get an empty string. I was assuming that the CurrentFilterFunction property was what I was looking for, but I guess not.

Is there a way to get this value programmatically?

Thanks,
Eric
Antonio Stoilkov
Telerik team
 answered on 18 May 2012
2 answers
690 views
Hi there,

Ok this might sounds pretty easy and shouldn't be such a pain to do but I'm struggling resizing a RadTextBox. I did something as simple as this :
<telerik:RadTextBox ID="rtbAddress" runat="server" Label="Address:" ToolTip="Search for an address" Width="300px" Columns="200">

And still, no way to change the size of the input neither to get the input next to its label... How come is this so difficult to achieve ?
All I need is a text box that match the radtextbox1.png and not the radtextbox2.png .

Plus when I remove the Width property to use the Columns property, the input simply disappears and all I see is the label ????

This is so simple that it is pissing me off. Please someone has any idea ?

Christophe
Top achievements
Rank 1
 answered on 18 May 2012
1 answer
56 views

Hello,

I have a telerik rad grid on the page and when I click on ASP.NET dropdowns, I get an issue in the Telerik resources file on the following line.

Quarter 3 2009 is the controls we are using.

if

 

 

((typeof (_97.srcElement)!="undefined")&&(_97.srcElement!=null)){

Thanks
Thomas

 

Radoslav
Telerik team
 answered on 18 May 2012
9 answers
241 views

Hi,

I wish to disable my radcombobox whilst the page loads, this is within a "usercontrol" and I am using jquery in the main page (which includes this control), and can use it here if that helps?

This returns a null reference for the combobox! I have looked at many threads to no avail, hopefully you can post an example for me.

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="buyersguidefinderUserControl.ascx.cs"
    Inherits="usercontrol_seo_buyersguidefinderUserControl" %>
<div class="fl">
    <telerik:RadComboBox ID="RadComboBox1" AllowCustomText="true" runat="server" Width="250px"
        Height="300px" Filter="Contains" LoadingMessage="Finding Buyers Guide ..." EmptyMessage="Type which guide you would like to read..."
        HighlightTemplatedItems="true" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"
        AutoPostBack="true">
    </telerik:RadComboBox>
</div>
<div class="guidesearchbtn fl">
    <asp:Button ID="Button1" runat="server" Text="Go" OnClick="Button1_Click" /></div>

<script language="javascript" type="text/javascript">
    // <!CDATA[
    // disable control otherwise it breaks page state
    var combo = $find("<%= RadComboBox1.ClientID %>");
    combo.Disable();

    $(document).ready(function() {
        combo.Enable();
    });
    // ]]>
</script>

Thanks again,
Matt

Princy
Top achievements
Rank 2
 answered on 18 May 2012
2 answers
66 views
Hi all,

The edit form of my grid is type template.I added a textbox and dropdownlist to the form template.I want to show only asp:textbox when I add new record and only asp:dropdownlist while editing.
Please help.
Thanks in advance.
Janaki
Top achievements
Rank 1
 answered on 18 May 2012
6 answers
159 views
I have worked with grid with several options but I am facing two issues i.e unable to display the RadAjaxLoadingPanel1 in the center of the form on grid and row selected color is displaying multiple colors when row is selected and hover on the row

My code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default1.aspx.cs" Inherits="_Default1" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <link href="Grid.Office2010Silver.css" rel="stylesheet" type="text/css" />
    <link href="Ajax.Office2010Silver.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
    <div>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Visible="true"
            CssClass="RadAjax_Office2010Silver" MinDisplayTime="2000" Transparency="1">
            <asp:Image ID="img" runat="server" ImageUrl="~/loading.gif" />
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadGrid ID="RadGrid1" ShowFooter="false" CssClass="RadGrid_Office2010Silver"
             AllowMultiRowSelection="false" OnItemCommand="RadGrid1_ItemCommand"
            AllowPaging="true" AllowSorting="true" PageSize="10" runat="server" OnPageIndexChanged="RadGrid1_PageIndexChanged"
          EnableAjaxSkinRendering="false"  AllowCustomPaging="True" OnPageSizeChanged="RadGrid1_PageSizeChanged" OnNeedDataSource="RadGrid1_NeedDataSource">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <ClientSettings EnableRowHoverStyle="true">
                <Scrolling AllowScroll="True" UseStaticHeaders="True" ScrollHeight="200" SaveScrollPosition="true"
                    FrozenColumnsCount="3"></Scrolling>
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
            <MasterTableView DataKeyNames="EmployeeID" AutoGenerateColumns="false">
                <Columns>
                    <telerik:GridBoundColumn DataField="EmployeeID" UniqueName="EmployeeID" HeaderText="EmployeeID"
                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FirstName" HeaderStyle-HorizontalAlign="Center"
                        ItemStyle-HorizontalAlign="Center" UniqueName="FirstName" HeaderText="FirstName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LastName" UniqueName="LastName" HeaderText="LastName"
                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address" UniqueName="Address" HeaderText="Address"
                        HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>


Pavlina
Telerik team
 answered on 17 May 2012
2 answers
254 views
the only thing I could validate the size of the option MaxFileSize. I have to validate to upload a photo that is 96x96 pixels. How do I can do?.

Thanks for your help
ALBERT
Top achievements
Rank 1
 answered on 17 May 2012
2 answers
63 views
Hi,
i am using rad window as a control container, in a sharepoint application, but i have a problem with the title of the window. While the window is loading, the title seems to be ok, but after loading completes, the title changes to the title of the page(.ascx file) the window contains. I tried to remove the title at all with no luck! In visual studio everything works fine...
Can you please help me avoid this situation?

Thanks a lot,
Angie
asilioni
Top achievements
Rank 1
 answered on 17 May 2012
1 answer
105 views
I'm having trouble with post backs on a grid where the columns are created in the code behind. Essentially the columns that go in this grid come from a table, but an administrator has another page where they select what columns from the table show in the grid. So, I have table that stores column names and I dynamically add the columns with their header text and data field id based on this table that stores the columns that need to show. I then dynamically create the select statement, set that as the select command to a sqldatasource and bind it. When you load the page initially everything works fine. However, when you click some paging or sorting, it adds a bunch of extra columns. You can see the before and after here
http://imgur.com/a/gO28G#nOVo1 


Here is my ascx
<telerik:radgrid ID="gradeGrid" runat="server" AllowPaging="True" GridLines="None"
            CellPadding="5" AutoGenerateColumns="false" Width="850px" Skin="Metro" >
        </telerik:radgrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:connection %>">
        </asp:SqlDataSource>



here is my code behind
Dim conn = System.Configuration.ConfigurationManager.ConnectionStrings("connection").ToString
 
   'this sub adds a column to the rad grid
   Protected Friend Sub addColumn(ByVal dataField As String, ByVal header As String)
 
       Dim col As New GridBoundColumn
       col.DataField = dataField
       col.HeaderText = header
       gradeGrid.MasterTableView.Columns.Add(col)
 
   End Sub 'addColumn
 
   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
       If (Not Page.IsPostBack) Then
 
           bindGrid()
           gradeGrid.DataBind()
 
       End If 'if its not a  post back
 
   End Sub
 
   'this sub gets the data for the rad grid
   Protected Sub bindGrid()
 
       Dim reader As SqlDataReader
       'add the columns we know about
       addColumn("lgrade", "Letter Grade")
       addColumn("ngrade", "Percent Grade")
       addColumn("Course Code", "sectno")
       addColumn("Completed", "enddate")
 
       Dim itemSql = "SELECT lgrade, ngrade, sectno, enddate, "
       'now find all the other ones we need
       Dim sql = "SELECT columnName, label FROM hstuclsDefinedColumns ORDER BY position"
       Using myconn As New SqlConnection(conn)
 
           myconn.Open()
 
           reader = New SqlCommand(sql, myconn).ExecuteReader()
           If (reader.HasRows) Then
 
               While reader.Read()
                   addColumn(reader("columnName"), reader("label"))
                   itemSql &= "[" & reader("columnName") & "]" & ", "
               End While 'reader.read
               reader.Close()
           End If 'if reader.hasrows
 
           itemSql &= " 'blah' FROM hstucls WHERE stuid = " & MyFunctions.getStudentId
 
           myconn.Close()
       End Using 'using myconn
 
       SqlDataSource1.SelectCommand = itemSql
 
       gradeGrid.DataSource = SqlDataSource1
 
   End Sub 'bindGrid
 
   Protected Sub gradeGrid_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles gradeGrid.NeedDataSource
       bindGrid()
   End Sub

I'm sure it's something stupid, I just don't see what it is. Thanks!

Web Services
Top achievements
Rank 2
 answered on 17 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?