Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
179 views
I have a page with agreement control, from that page I open a RadWindow with control to create or edit tenant details.
Tenant control contain antoher RadWindow to edit adress details (as on attahed picture)
How can I make RadWindow with address control to be above the tenant control?
piotre6
Top achievements
Rank 1
 answered on 23 Jan 2012
1 answer
466 views
I have a RadButton with ButtonType=ToggleButton and ToggleType=CheckBox with an associated OnCheckedChanged callback.  My problem is that the callback only fires on the 1st, 4th, 7th, etc. time I click the checkbox.  I would like the callback to fire every time I toggle the check box.  Does anyone know why the callback does not fire every time the checkbox is toggled?  

Note: If I change focus after toggling the checkbox by clicking on another server control, the callback does fire the next time I toggle it even if it's just the 2nd time I toggle it.

Here's my aspx code:
<asp:UpdatePanel ID="UpdatePanel_System" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true" EnableViewState="True">
  <div>
    <telerik:RadButton ID="displaySystemAnnouncementsCB" runat="server" Text="Display system announcements to all users at the top of the page"
        ToggleType="CheckBox" OnCheckedChanged="displaySystemAnnouncementsCBCB" ButtonType="ToggleButton">
    </telerik:RadButton>
  </div>
</asp:UpdatePanel>


Here's my callback function:
protected void displaySystemAnnouncementsCBCB(object sender, EventArgs e)
{
    RadButton rb = (RadButton)sender;
    if (rb.Checked)
    {
        configuration.AppSettings.Settings["displaySystemAnnouncements"].Value = "1";
    }
    else
    {
        configuration.AppSettings.Settings["displaySystemAnnouncements"].Value = "0";
    }
    configuration.Save();
}
Mike
Top achievements
Rank 1
 answered on 23 Jan 2012
0 answers
163 views
I have a RadListView that has a detail table.  To see it you click the expand/collapse button.  My question is what is the code to expand or collapse them all with one click.  I tried copying the expamples for TreeVeiws but it did not work.

Thank you for your help.
David Copp
Top achievements
Rank 1
 asked on 23 Jan 2012
0 answers
105 views
Hi,

I am able to bind boolean columns as a checkbox column and were able to use client template for ajax binding. everything over UI is working terrific

But, I am facing a problem in binding model again and following things in telerik mvc2 grid

1. I am unable to bind checkbox columns with model when I am posting whole form back to controller
2. Checkbox's Id has not been sorted on sorting or being filtered. checkbox id remains same ( I mean if checkbox id is chkrow1 then on filtering or on sorting first row checkbox id will always be chkrow1 only)

Request you to please provide me sample code with checkbox column and saving it to database again.

I really appreciate your help

Yogesh
Top achievements
Rank 1
 asked on 23 Jan 2012
1 answer
143 views
Hello Telerik,

I have the following in my .ASPX:

<telerik:RadSplitter ID="table_splitter" runat="server" Width="100%" Orientation="Horizontal">
    <telerik:RadPane ID="row1_pane" runat="server" OnClientResizing="OnClientRowResizing">
        <telerik:RadSplitter ID="row1_column_splitter" runat="server" Width="100%" Orientation="Vertical">
            <telerik:RadPane ID="row1_col1_pane" runat="server" OnClientResizing="OnClientColResizing">row1_col1_pane
            </telerik:RadPane>
            <telerik:RadSplitBar ID="row1_col1_splitbar" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="row1_col2_pane" runat="server" OnClientResizing="OnClientColResizing">row1_col2_pane
            </telerik:RadPane>
            <telerik:RadSplitBar ID="row1_col2_splitbar" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="row1_col3_pane" runat="server" OnClientResizing="OnClientColResizing">row1_col3_pane
            </telerik:RadPane>
        </telerik:RadSplitter>
    </telerik:RadPane>
    <telerik:RadSplitBar ID="row1_splitbar" runat="server"></telerik:RadSplitBar>
    <telerik:RadPane ID="row2_pane" runat="server" OnClientResizing="OnClientRowResizing">
        <telerik:RadSplitter ID="row2_column_splitter" runat="server" Width="100%" Orientation="Vertical">
            <telerik:RadPane ID="row2_col1_pane" runat="server" OnClientResizing="OnClientColResizing">row2_col1_pane
            </telerik:RadPane>
            <telerik:RadSplitBar ID="row2_col1_splitbar" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="row2_col2_pane" runat="server" OnClientResizing="OnClientColResizing">row2_col2_pane
            </telerik:RadPane>
            <telerik:RadSplitBar ID="row2_col2_splitbar" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="row2_col3_pane" runat="server" OnClientResizing="OnClientColResizing">row2_col3_pane
            </telerik:RadPane>
        </telerik:RadSplitter>
    </telerik:RadPane>
    <telerik:RadSplitBar ID="row2_splitbar" runat="server"></telerik:RadSplitBar>
    <telerik:RadPane ID="row3_pane" runat="server" OnClientResizing="OnClientRowResizing">
        <telerik:RadSplitter ID="row3_column_splitter" runat="server" Width="100%" Orientation="Vertical">
            <telerik:RadPane ID="row3_col1_pane" runat="server" OnClientResizing="OnClientColResizing">row3_col1_pane
            </telerik:RadPane>
            <telerik:RadSplitBar ID="row3_col1_splitbar" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="row3_col2_pane" runat="server" OnClientResizing="OnClientColResizing">row3_col2_pane
            </telerik:RadPane>
            <telerik:RadSplitBar ID="row3_col2_splitbar" runat="server"></telerik:RadSplitBar>
            <telerik:RadPane ID="row3_col3_pane" runat="server" OnClientResizing="OnClientColResizing">row3_col3_pane
            </telerik:RadPane>
        </telerik:RadSplitter>
    </telerik:RadPane>
</telerik:RadSplitter>

And here is my client Javascript:

function OnClientRowResizing(splitter, args) {
    var id = splitter._element.id;
    var rowstr = id.substr(id.search("_row"), id.search("_pane") - id.search("_row"));
    var row = rowstr.replace("_row", "");
    // let's get the row splitters
    for (i = 1; i <= 3; i++) {
        if (i == row) {
            var rowSplitter = $find("ctl00_MainContent_ctlSplitterPanes_row" + i + "_column_splitter");
            if (rowSplitter != null) {
                for (j = 0; j <= rowSplitter.getPanes().length - 1; j++) {
                    var pane = rowSplitter.getPanes()[j]
                    pane.set_height(pane.get_height() + args._delta);
                    pane.set_content("row" + i + "_col" + (j + 1) + "_pane> height: " + pane.get_height() + " width: " + pane.get_width());
                }
            }
        }
    }
}
function OnClientColResizing(splitter, args) {
    var id = splitter._element.id;
    var rowstr = id.substr(id.search("_row"), id.search("_col") - id.search("_row"));
    var row = rowstr.replace("_row", "");
    var colstr = id.substr(id.search("_col"), id.search("_pane") - id.search("_col"));
    var col = colstr.replace("_col", "");
    // let's get the row splitters
    for (i = 1; i <= 3; i++) {
        var rowSplitter = $find("ctl00_MainContent_ctlSplitterPanes_row" + i + "_column_splitter");
        if (rowSplitter != null) {
            for (j = 0; j <= rowSplitter.getPanes().length - 1; j++) {
                if (j==col-1) {
                    var pane = rowSplitter.getPanes()[j]
                    pane.set_width(pane.get_width() + args._delta);
                    pane.set_content("row" + i + "_col" + (j+1) + "_pane> height: " + pane.get_height() + " width: " + pane.get_width());
                }
            }
        }
    }
}

See the attachment for the initial output.

What I'm trying to achieve here is: when I resize the width of any pane of any column in any row, I want to resize the panes in the same column in the other rows as well.

Using the client script I have come up with (OnClientColResizing), I am actually able to do just that. However, my problem is that, the width of the panes that are in the affected columns in the row where I'm triggering the resizing from, is ALWAYS not the same as the width of the panes in the corresponding columns of the other rows, even though it's width is the basis for changing the other panes' widths.

I don't seem to have any problem using OnClientRowResizing to sychronize the heights of all panes when I'm resizing any row.

Kindly look into my code and see if I've missed anything. Any suggestions in improving my code will be most appreciated too!

Best regards.

Virgil
Dobromir
Telerik team
 answered on 23 Jan 2012
2 answers
238 views
I am trying to get a Split Button with a context menu working inside the EditItemTemplate of a Grid. I want it to show the context menu and not postback on the "dropdown arrow" split button click, and postback on the main button click. I can get this working when its outside of the grid, but once I put it in EditItemTemplate of the Grid, it always does a postback, even when I click the split-button arrow (but the context menu still shows, so I know it hits the proper javascript) and the Click event's IsSplitButtonClick is always false. The button I am referring to is _btnFile in the following code.

<telerik:RadGrid ID="_rgRevisions" runat="server" Skin="Office2007" Width="410px" AllowFilteringByColumn="false" HeaderStyle-Font-Bold="true" HeaderStyle-HorizontalAlign="center" FilterItemStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="center" AlternatingItemStyle-HorizontalAlign="center" OnPreRender="_rgRevisions_PreRender" OnNeedDataSource="_rgRevisions_NeedDataSource" OnItemCommand="_rgRevisions_ItemCommand" OnItemDataBound="_rgRevisions_ItemDataBound" OnItemCreated="_rgRevisions_ItemCreated" OnUpdateCommand="_rgRevisions_UpdateCommand">
                <ClientSettings>
                    <Scrolling AllowScroll="True" ScrollHeight="200px" UseStaticHeaders="true" />
                </ClientSettings>
                <MasterTableView EditMode="InPlace" AutoGenerateColumns="false" DataKeyNames="Id">
                    <Columns>
                        <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" ButtonType="ImageButton"
                            HeaderStyle-Width="30px" UpdateImageUrl="../../Icons/accept.png" EditImageUrl="../../Icons/EditViewDetails.png" CancelImageUrl="../../Icons/cancel.png" />
                        <telerik:GridBoundColumn DataField="linkedDocument" UniqueName="linkedDocument" HeaderText="Document" HeaderStyle-Width="70px" />
                        <telerik:GridTemplateColumn DataField="FileID" UniqueName="modifiedDoc" HeaderText="Modified Doc"
                            HeaderStyle-Width="90px" AllowFiltering="false" >
                            <ItemTemplate>
                                <asp:ImageButton ID="_btnModDocument" runat="server" ImageUrl="~/Theme/Img/A2bIcons/PDF.png" Visible='<%# Eval("FileID") != null && ((int)Eval("FileID")) != 0 ? true : false %>' CommandArgument='<%# Eval("FileID") %>' CommandName="DownloadModDocument" />
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadButton ID="_btnFile" runat="server" EnableEmbeddedSkins="true"
                                    Skin="Office2007" Text='<%# Eval("fileName") %>'
                                                     CssClass="noWrapEllBtn" ButtonType="LinkButton"
                                                     EnableSplitButton="true" Width="140px"
                                                     Visible='<%# Eval("FileID") != null && ((int)Eval("FileID")) != 0 ? true : false %>'
                                                     CommandArgument='<%# Eval("FileID") %>' OnClick="_btnFile_Click"
                                                     OnClientClicked="OnUpdateModFileClicked">
                                    <Icon PrimaryIconUrl="~/Icons/PDF.png" />
                                </telerik:RadButton>
                                <telerik:RadContextMenu ID="_cmFile" runat="server" OnItemClick="_cmFile_ItemClick"
                                    EnableShadows="true">
                                    <Items>
                                        <telerik:RadMenuItem Text="Remove" Value="Remove" ImageUrl="../../Icons/Delete.gif" />
                                    </Items>
                                </telerik:RadContextMenu>
                            </EditItemTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>

function OnUpdateModFileClicked(sender, args) {
               if (args.IsSplitButtonClick()) {
                   var currentLocation = $telerik.getLocation(sender.get_element());
                   var menuID = $(sender.get_element()).siblings("div")[0].id;
                   var contextMenu = $telerik.findMenu(menuID);
                   contextMenu.showAt(currentLocation.x, currentLocation.y + 22);
                   sender.set_autoPostBack(false);
               }
               else {
                   sender.set_autoPostBack(true);
               }
           }

protected void _btnFile_Click(object sender, EventArgs e)
        {
            if (sender == null) throw new ArgumentNullException("sender");
            if (e == null) throw new ArgumentNullException("e");
            if (((ButtonClickEventArgs)e).IsSplitButtonClick) return;
 
            int fileId;
            int.TryParse(((RadButton)sender).CommandArgument, out fileId);
            if (fileId > 0)
            
               // Download File
            }
        }
Stephen
Top achievements
Rank 1
 answered on 23 Jan 2012
7 answers
487 views
Hi There

I have a master page and content page.  I would like to call a function in code behind of the 'parent' page when the radwindow is closed.  My problem is that when I load the parent page the first time, the postback occurs when I specify OnClientClose="__doPostBack()" - even before I have opened the RadWindow and closed it.  What am I doing wrong?  I want it to only fire once the user has opened the RadWindow and closes it.

Here's my code:

<%

@ Page Language="VB" MasterPageFile="~/MasterHRJ001.master" AutoEventWireup="false" CodeFile="tester.aspx.vb" Inherits="tester" title="Untitled Page" %>

 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

<

 

asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

 

 

<asp:linkbutton id="Test" runat="server" text="Create Text file" onclick="Test_Click" />

 

 

 

 

 

 

<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Black"

 

 

DestroyOnClose="true"

 

 

OnClientClose="__doPostBack('ctl00$ContentPlaceHolder1$Test','')"

 

 

>

 

 

<Windows>

 

 

<telerik:RadWindow

 

 

id="RadWindow1"

 

 

runat="server"

 

 

showcontentduringload="False"

 

 

width="900px"

 

 

height="550px"

 

 

 

 

title="Telerik RadWindow" Modal="true" VisibleStatusbar="false" Skin="Black" style="display:none;" InitialBehavior="None" Left="" NavigateUrl="" Top="">

 

 

</telerik:RadWindow>

 

 

 

 

 

 

</Windows>

 

 

</telerik:RadWindowManager>

 

 

 

<script type="text/javascript">

 

 

//<![CDATA[

 

 

 

function openRadWin5()

 

{

radopen(

"business-sol-surveys.aspx?cont=5","RadWindow1");

 

}

 

 

//]]>

 

 

</script>

 

 

 

<a id="A1" href="javascript:__doPostBack('ctl00$ContentPlaceHolder1$Test','')">Testing to see if the postback works</a>

 

 

<

 

a id="A2" href="javascript: openRadWin5()">Open RAD Win 5</a>

 

 

</

 

asp:Content>

 

Pat Huesers
Top achievements
Rank 1
 answered on 23 Jan 2012
1 answer
82 views
Dear Telerik Support Team

Since i updated to version 2011.3.1305.35 i'm having a problem with RadDatePicker. It says: "Telerik.RadDatePickerPopupDirection.BottomRight is null or not an object". I saw that this is a common problem among users of older versions of telerik (2009), but not with this one.
Alexandre
Top achievements
Rank 1
 answered on 23 Jan 2012
1 answer
171 views
Hello,

I am working with a RadChart as a stacked bar style and showing the DataTable below the chart which shows value percentages. However, I am using some values with large range differences and this means several of my data items are less than 1% but show as 0% in the DataTable. Is it possible to change the DataTable values to show percentages less than 1%?

Thanks
Richard
Top achievements
Rank 1
 answered on 23 Jan 2012
2 answers
158 views
I have a RadWindow that pops up a search using a RadGrid.  Sometimes the parent window will lose its state or session after clicking a series of controls.  It is a very odd problem but seems to occur everywhere I use a RadWindow in this fashion.  If I open the RadWindow, click search twice and then page 6 times then the parent window loses state or session (not sure exactly).  It's very strange, because why does it take paging the RadGrid 6 times to cause the problem and not 3 or 4?  So, at this point, I am looking for any ideas or even guesses as to what may be causing this problem.  I don't want to post the code because there is too much to reasonably ask you to look at, but please let me know if you have any thoughts that might be useful.
Tony Upchurch
Top achievements
Rank 1
 answered on 23 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?