Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
388 views
Hi,
i am using RadWindow in my Portal and i have few text box on my Radwindow and one Image Button..... i want to know that how to Close my Radwindow and Redirect page to parent page when i click on Image button which is on Radwindow ..can any one help me???
Marin Bratanov
Telerik team
 answered on 06 Jan 2012
3 answers
150 views

My Set up consist of a Grid and a ClientClick on the Row to open a RadWindow using the ClientSide  radopen. The problem I am encountering is that none of the RadWindow attributes are working... as if whatever i've defined in the RadWindow Attributes are ignored.
Below is the code snippet from my user control where the RadGrid is located and it's associated code.

<telerik:RadWindowManager ID="wndManager" runat="server" EnableShadow="False">
    <Windows>
        <telerik:RadWindow ID="wndShoppingListItem" runat="server" Title="Shopping List Item"
            ReloadOnShow="true" ShowContentDuringLoad="false" KeepInScreenBounds="True" Modal="True"
            VisibleStatusbar="False" Height="525" Width="725px" VisibleTitlebar="True" Behavior="Close, Move"
            Behaviors="Close, Move" Skin="gmBlue" EnableEmbeddedSkins="false" />
    </Windows>
</telerik:RadWindowManager>
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
        function ShowEditForm(accountId, listId, itemId, productId, rowIndex) {
            //alert('ShowEditForm');
            var grid = $find("<%= grdSelectedList.ClientID %>");
            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element();
            grid.get_masterTableView().selectItem(rowControl, true);
 
            var wnd = window.radopen("wndShoppingListItem.aspx?accountId=" + accountId +
                                                    "&listId=" + listId +
                                                    "&itemId=" + itemId +
                                                    "&productId=" + productId
                                                    , "<%= wndShoppingListItem.ClientID %>");
            return false;
        }
        function ShowInsertForm() {
            //alert('ShowInsertForm');
            var wnd = window.radopen("wndShoppingListItem.aspx", "<%= wndShoppingListItem.ClientID %>");
            return false;
        }
        function refreshGrid(arg) {
            //alert('refresgGrid' + arg);
            var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
            if (!arg) {
                ajaxManager.ajaxRequest("Rebind");
            }
            else {
                ajaxManager.ajaxRequest("RebindAndNavigate");
            }
        }
        function RowClick(sender, eventArgs) {
            //alert('RowClick' + eventArgs);
            var wnd = window.radopen("wndShoppingListItem.aspx?accountId=" + eventArgs.getDataKeyValue("Account_ID") +
                                                    "&listId=" + eventArgs.getDataKeyValue("List_ID") +
                                                    "&itemId=" + eventArgs.getDataKeyValue("Item_ID") +
                                                    "&productId=" + eventArgs.getDataKeyValue("Product_ID")
                                                    , "<%= wndShoppingListItem.ClientID %>");
        }
    </script>
</telerik:RadCodeBlock>


Below is the actual content of the RadWindow

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="wndShoppingListItem.aspx.cs"
    Inherits="GrocerMania.AppServer0001.Pages.wndShoppingListItem" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title>Shopping List Item</title>
    <link href="../Lib/shoppinglist.css" rel="stylesheet" type="text/css" />
    <link href="../Lib/wndMain.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <script type="text/javascript">
        function CloseAndRebind(args) {
            //alert('CloseAndRebind' + args);
            GetRadWindow().BrowserWindow.refreshGrid(args);
            GetRadWindow().close();
        }
 
        function GetRadWindow() {
            //alert('GetRadWindow');
            var oWindow = null;
            if (window.radWindow) oWindow = window.radWindow;
            else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
 
            return oWindow;
        }
 
        function CancelEdit() {
            //alert('CancelEdit');
            GetRadWindow().close();
        }
    </script>
    <asp:ScriptManager ID="ScriptManager2" runat="server" />
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server">
    </telerik:RadStyleSheetManager>
    <div class="sliHeader">
        <div class="sliItemImage">
            <asp:Image ID="imgItem" runat="server" ImageUrl="~/AppServer0001/Data_Images/default.gif"
                Height="80" Width="80" BorderColor="black" BorderWidth="1"/>
        </div>
        <div class="sliItemDescription">
            <asp:Label ID="lblItemName" runat="server" CssClass="lblItemName">Milk, Lowfat 1%</asp:Label>
            <div class="smallLabel">
                Last purchased:</div>
            <asp:Label ID="lblLastPurchased" runat="server" CssClass="smallFont"> October 1, 2011 (2 gallons)</asp:Label><br />
            <div class="smallLabel">
                How much I have:</div>
            <asp:Label ID="lblHowMuch" runat="server" CssClass="smallFont">None!</asp:Label>
        </div>
    </div>
    <div class="sliBody">
        <div class="sliColName">
            Quantity:</div>
        <div class="sliColControl">
            <div class="divQtyWrapper">
                <div class="divPlusMinus" id="qtyMinus">
                    <img alt="minus" src="../Images/btMinusGray.gif" /></div>
                <div class="divQty">
                    <asp:TextBox ID="txtQty" runat="server" value="1" CssClass="txtQtyInput"></asp:TextBox></div>
                <div class="divPlusMinus" id="qtyPlus">
                    <img alt="plus" src="../Images/btPlusGray.gif" /></div>
            </div>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Item type:</div>
        <div class="sliColControl">
            <telerik:RadComboBox ID="cmbType" runat="server" Width="345px">
            </telerik:RadComboBox>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Item size:</div>
        <div class="sliColControl">
            <telerik:RadComboBox ID="cmbSize" runat="server" Width="345px">
            </telerik:RadComboBox>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Brand:</div>
        <telerik:RadComboBox ID="cmbBrand" runat="server" Width="345px">
        </telerik:RadComboBox> <asp:HyperLink ID="lnkBrandPref" runat="server" Text="Brand preferences" NavigateUrl="#"></asp:HyperLink>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Allow substitute items?</div>
        <div class="sliColControl">
            <telerik:RadComboBox ID="RadComboBox1" runat="server" Width="345px">
            </telerik:RadComboBox>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Allow bulk discounts?</div>
        <div class="sliColControl">
            <telerik:RadComboBox ID="RadComboBox2" runat="server" Width="345px">
            </telerik:RadComboBox>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="sliColName">
            Price alert?</div>
        <div class="sliColControl">
            <div class="divRadioButtons">
                <telerik:RadButton ID="btnPriceAlert" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                    Text="No" GroupName="grpPriceAlert">
                </telerik:RadButton>
                <br />
                <telerik:RadButton ID="RadButton1" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                    Text="Automatic - When GrocerMania finds a bargain price" GroupName="grpPriceAlert">
                </telerik:RadButton>
                <br />
                <telerik:RadButton ID="RadButton2" runat="server" ButtonType="ToggleButton" ToggleType="Radio"
                    Text="Manual - When the price is at or below $" GroupName="grpPriceAlert">
                </telerik:RadButton>
                <telerik:RadTextBox ID="priceLimit" runat="server" Width="50">
                </telerik:RadTextBox><br />
            </div>
        </div>
        <div class="sliSeparator">
        </div>
        <div class="centeredContent">
            <telerik:RadButton ID="btnSubmit" runat="server" OnClientClicking="OnClientClicking"
                Width="111" Height="31">
                <Image ImageUrl="../Images/btSubmitDarkBlue.gif" />
            </telerik:RadButton>
              
            <telerik:RadButton ID="btnAddToWishList" runat="server" OnClientClicking="OnClientClicking"
                Width="130" Height="31">
                <Image ImageUrl="../Images/btAddToWishListCharcoal.gif" />
            </telerik:RadButton>
              
            <telerik:RadButton ID="btnCancel" runat="server" OnClientClicking="CancelEdit" Width="72"
                Height="31">
                <Image ImageUrl="../Images/btCancelCharcoal.gif" />
            </telerik:RadButton>
        </div>
    </div>
    </form>
</body>
</html>


What am I doing wrong? The Window when it opens, is smaller in size ( about 250px bx 250px) and then readjust based on the content...I need to have it open the correct fixed size as defined in the RadWindow. Also the CSS skin is also ignored...although i have the csslink in the parent page!

Marin Bratanov
Telerik team
 answered on 06 Jan 2012
3 answers
91 views
Hi,
I have to modifiy a working web application which I did back in 2009.

The application has some RadGrids which only accept numeric value on their cells.

Currently it is possible to leave the cells blank.

Can you please show me how to force empty grid cells to a certain value (in this case 0)?

The RadGrid cells are created as follows:

protected void rgOutages_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
    {
        GridEditableItem item = (GridEditableItem)e.Item;
        GridNumericColumnEditor editor = (GridNumericColumnEditor)item.EditManager.GetColumnEditor("Unit_Outage_CountInflexible");
        editor.NumericTextBox.EmptyMessage = "0";
        editor.NumericTextBox.MaxLength = 8;
        editor.NumericTextBox.MaxValue = 999;
        editor.NumericTextBox.MinValue = 0;
        editor.NumericTextBox.NumberFormat.AllowRounding = true;
        editor.NumericTextBox.NumberFormat.DecimalDigits = 0;
        editor.NumericTextBox.Width = Unit.Percentage(100);
    }
}
Veli
Telerik team
 answered on 06 Jan 2012
1 answer
97 views
We are using Google like Filtering for the columns in a grid. The Filtering works fine for all the columns except for two columns which are displaying dates. The Format for the column in the Grid as well as the format for the date in the RadCombo(used for type ahead) is

"{0:dd-MMM-yyyy}".
Please suggest a solution.We are using a class file for this which is like your Demo File (CustomFilteringColumn.cs)

Shinu
Top achievements
Rank 2
 answered on 06 Jan 2012
1 answer
109 views
Hi,

I am using entity framwork with Radgrid, when I enable the column filter, the filter doesn't seem working. It works for seaching English character, but not for Chinese character. Is Radgrid filter support chinese character?
Thanks
Veli
Telerik team
 answered on 06 Jan 2012
1 answer
58 views
Hi all,
Please help me in this thread
I am using telerik radgrid control,
No issue in master table, datas are bind comfortably
my problem is
radgrid contain one detailed table
I am using DetailTableDataBind event to bind data
the datasource in detail table have the values but it does not shows while running .

here is my design source

<

 radG:RadGrid ID="dgrdResults" runat="server" Width="100%" AllowSorting="true"

 RadControlsDir="../Assets/RadControls/" GridLines="None" SkinsPath="../Assets/RadControls/Grid/Skins"

 EnableAJAX="true" AutoGenerateColumns="false" >

 <ExportSettings ExportOnlyData="false" IgnorePaging="true" OpenInNewWindow="true" />

 <PagerStyle Mode="NextPrevAndNumeric" />

 <MasterTableView DataKeyNames="RecipientId">

 <ExpandCollapseColumn Visible="false">

 <HeaderStyle Width="19px" />

 </ExpandCollapseColumn>

 <RowIndicatorColumn Visible="false">

 <HeaderStyle Width="20px" />

 </RowIndicatorColumn>

 <NoRecordsTemplate>

 <asp:Label ID="lblNoRecordsFound" runat="server" Text="No records bind">

 </asp:Label>

 </NoRecordsTemplate>

 <DetailTables >

 

 

<radG:GridTableView DataKeyNames ="ID" runat="server">

 

 

<ParentTableRelation >

 

 

<radG:GridRelationFields DetailKeyField="ID" MasterKeyField ="RecipientId" />

 

 

</ParentTableRelation>

 

 

<NoRecordsTemplate>

 

 

<asp:Label runat="server" ID="lblNorecord" Text="No records bind">

 

 

</asp:Label>

 

 

</NoRecordsTemplate>

 

 

<Columns>

 

 

<radG:GridBoundColumn HeaderText="Name" DataField="Name">

 

 

</radG:GridBoundColumn>

 

 

</Columns>

 

 

</radG:GridTableView>

 

 

</DetailTables>

 <Columns>

 <radG:GridTemplateColumn >

 <Headerstyle width="20px" />

 <Headertemplate>

 <asp:CheckBox runat="server" ID="All" OnCheckedChanged="SelectAllContacts" Autopostback="True" />

 </Headertemplate>

 <ItemTemplate>

 <asp:CheckBox runat="server" ID="Contact" />

 </ItemTemplate>

 </radG:GridTemplateColumn>

 <radG:GridBoundColumn DataField ="Email" HeaderText="<%$ Resources:ToolTextEmail, Recipient_Email %>" UniqueName="Email"></radG:GridBoundColumn>

 <radG:GridBoundColumn DataField="FirstName" HeaderText="<%$ Resources:ToolTextEmail, Recipient_FirstName %>" UniqueName="First Name"></radG:GridBoundColumn>

 <radG:GridBoundColumn DataField="LastName" HeaderText="<%$Resources:ToolTextEmail, Recipient_LastName %>" UniqueName="Lase Name"></radG:GridBoundColumn>

 <radG:GridBoundColumn DataField="Address1" HeaderText="<%$Resources:ToolTextEmail, Recipient_Address1 %>" UniqueName="Address1"></radG:GridBoundColumn>

 <radG:GridBoundColumn DataField="Company" HeaderText="<%$Resources:ToolTextEmail, Recipient_Company %>" UniqueName="Company"></radG:GridBoundColumn>

 <radG:GridBoundColumn DataField="City" HeaderText="<%$Resources:ToolTextEmail, Recipient_City %>" UniqueName="City"></radG:GridBoundColumn>

 <radG:GridBoundColumn DataField="State" HeaderText="<%$Resources:ToolTextEmail, Recipient_State %>" UniqueName="State"></radG:GridBoundColumn>

 </Columns>

 </MasterTableView>

 </radG:RadGrid>

and the source code is 

Private Sub dgrdResults_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.WebControls.GridDetailTableDataBindEventArgs) Handles dgrdResults.DetailTableDataBind
Dim db As Database

 

 

Dim dataset As DataSet = Nothing

 

 

Dim dbCommandWrapper As DbCommand = Nothing

 

 

Try

 

db = DatabaseFactory.CreateDatabase()

dbCommandWrapper = db.GetStoredProcCommand(

"spListGetByRecipient")

 

db.AddInParameter(dbCommandWrapper,

"@recipientId", DbType.Int32, 100125)

 

dataset = db.ExecuteDataSet(dbCommandWrapper)

e.DetailTableView.DataSource = dataset

dataset.Dispose()

dbCommandWrapper.Dispose()

 

Catch ex As Exception

 

 

Throw ex

 

 

Finally

 

 

If (Not dbCommandWrapper Is Nothing) Then

 

dbCommandWrapper.Dispose()

 

End If

 

 

If (Not dataset Is Nothing) Then

 

dataset.Dispose()

 

End If

 

 

End Try

 

 

End Sub

And in this code e.DetailTableView.DataSource = dataset  I get table with values, but in browser "No record bind" message shown .
Does I miss something or forget anything in code?
 Please help me

 

Jayesh Goyani
Top achievements
Rank 2
 answered on 06 Jan 2012
2 answers
143 views
I have a static table in Radwindow's <ContentTemplate> tag. Upon popping up the Radwindow, it opens as collapsed for IE9. Works fine with rest of the major browsers, vis. IE 8, IE 9 Compat mode, FF, Chrome.
Here is my code
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1._Default" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <style type="text/css">
        .hide
        {
            overflow: hidden;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="overflow: hidden;">
        <table cellspacing="0" border="0" style="table-layout: auto;">
            <tbody>
                <tr>
                    <th style="width: 100px;">
                        Column 1
                    </th>
                    <th style="width: 100px;">
                        Column 2
                    </th>
                </tr>
                <tr>
                    <td>
                        a
                    </td>
                    <td>
                        a
                    </td>
                </tr>
                <tr>
                    <td>
                        b
                    </td>
                    <td>
                        b
                    </td>
                </tr>
                <tr>
                    <td>
                        c
                    </td>
                    <td>
                        c
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <br />
    <br />
    <br />
    <br />
    <telerik:RadScriptManager ID="scriptManager" runat="server" />
    <telerik:RadButton ID="btnOpen" runat="server" Text="Open" OnClick="btnOpen_Click" />
    <br />
    <telerik:RadWindow ID="TestDialog" runat="server" Title="Select Order Services" VisibleStatusbar="false"
        AutoSize="true" AutoSizeBehaviors="Height" Width="400px" Modal="true" VisibleOnPageLoad="false" Behaviors="Close, Move"
        EnableShadow="true" CssClass="hide">
        <ContentTemplate>
            <div>
                <table cellspacing="0" border="0" style="table-layout: auto;">
                    <tbody>
                        <tr>
                            <th style="width: 100px;">
                                Column 1
                            </th>
                            <th style="width: 100px;">
                                Column 2
                            </th>
                        </tr>
                        <tr>
                            <td>
                                a
                            </td>
                            <td>
                                a
                            </td>
                        </tr>
                        <tr>
                            <td>
                                b
                            </td>
                            <td>
                                b
                            </td>
                        </tr>
                        <tr>
                            <td>
                                c
                            </td>
                            <td>
                                c
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </ContentTemplate>
    </telerik:RadWindow>
    </form>
</body>
</html>
Code behind:
protected void btnOpen_Click(object sender, EventArgs e)
        {
            TestDialog.VisibleOnPageLoad = true; // Pop up the radwindow
        }
Svetlina Anati
Telerik team
 answered on 06 Jan 2012
1 answer
145 views
Hi Team,
How can I resize a radeditor to fit the screen when a window is resized. I have used the setSize() property and i have used the below coding but i didn't get the result as expected. Anybody help me on how to resize the radEditor?. Is any possible way to do this via .css?


function
OnClientLoad(editor, args) {

//set the editor size

editor.setSize( 

"100%", document.body.offsetHeight - 90);

window.onresize = ResizeEditor(editor);
}

var resizeFlag = true;

function ResizeEditor(editor)  

if (resizeFlag) {  

editor.setSize( 

"100%", document.body.offsetHeight - 90);  

resizeFlag = false;  

window.setTimeout(function()  

{

resizeFlag = true;  

},100);

}

}

Thanks in advance
Sasireka

Princy
Top achievements
Rank 2
 answered on 06 Jan 2012
4 answers
492 views
Hello Telerik!

We have a page that uses a couple RadButtons as check boxes. A grid row is selected and it fills in controls with data on the page. Other controls work fine but the RadButton will not accept the Boolean value for setting it checked. Once the data is read and then rendered to the controls the RadButton's are always go unchecked to checked.

Here is the control in ASPX
<telerik:RadButton runat="server" ID="RadButtonIsFemale" Text="Female?" ButtonType="ToggleButton" AutoPostBack="false" ToggleType="CheckBox"></telerik:RadButton>

And the RadGrid calls a Javascript function RowSelected that updates the controls with grid data.

function RowSelected(sender, args) {
var myRadGrid = sender;
        var myMasterTable = myRadGrid.get_masterTableView();
        var myName = myMasterTable.get_selectedItems()[0].getDataKeyValue('Name');
$find("<%= RadTextBoxName.ClientID %>").set_value(myName);
...
...
...
var myIsFemale = myMasterTable.get_selectedItems()[0].getDataKeyValue('IsFemale');
$find("<%= RadButtonIsFemale.ClientID %>").set_checked(myIsFemale);
}

The bold line above always just sets it to True - I have validated the data, so False and True values are definitely set to 'IsFemale', but it doesn't toggle the check. Is there a different property that needs to be set?

Thanks!
SDI

Sally
Top achievements
Rank 1
 answered on 06 Jan 2012
1 answer
73 views
I have an application with a RadScheduler control. Users add items to their schedule using an AdvancedEditTemplate or AdvancedInsertTemplate.

I would like to add a button to this to post to a Facebook wall, so users of the application can tell everyone when they are adding something to their schedule.

I have tried adding a RadSocialShare control, which does not seem to do anything when the buttons are clicked (possibly because the template is displayed as a modal dialog).  (This works if I add it elsewhere on the page).

Is it possible to use a RadSocialShare control here, or is there any other way I can post to a facebook wall from within the AdvancedEditTemplate dialog?

Thanks, Richard

Plamen
Telerik team
 answered on 06 Jan 2012
Narrow your results
Selected tags
Tags
+124 more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
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
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?