Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
88 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
126 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
182 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
434 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
68 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
136 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
131 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
6 answers
476 views
Way back when I used the AJAX Control Toolkit's "Modal Popup Extender" control to create some interactive dialog boxes in my ASP.net application.  I'm attaching a screenshot sample of one of them.

Now that I've purchased your full set of controls, I'm investigating whether I can use RadWindow to replace the Modal Popup Extender.

I thought I was getting somewhere but then hit some roadblocks.  The crux of the problem is that with RadWindow, it seems impossible to do both of the following from the click of an ASP.net button:
  1. Run server-side code to initialize the contents of the dialog box.
  2. Open the dialog box.
My testing results seem to be confirmed by this: http://mono.telerik.com/Window/Examples/OpenAndPosition/DefaultCS.aspx

However, I thought that I should check with you to see if anything has changed in this regard or is about to, for it sure would be great if this functionality were possible!

Sincerely,

Robert W.
Vancouver
Marin Bratanov
Telerik team
 answered on 23 Jan 2012
1 answer
88 views
This is what happen. I have an image for a column and on itemdatabound, i will set each of the item with attribute onclick to call a js function(which will make the tooltip appear). This is all good, but the problem is, lets say the image i clicked earlier(in order to make the tooltip appear) is on the 1st row. Then i click on the tooltip x button to close it. Then i hover on the 1st row again, the tooltip appears? But i didn't set the onmouseover attribute. Why is the tooltip appears when hover?

Then if i click on the 2nd row, and i try to hover on the 1st row, the tooltip will not appear. But the problem will happen to the 2nd row. Which to sum it up, the tooltip appeared for the active row. So anyway to turn this off?

Regards,
Dexter

Marin Bratanov
Telerik team
 answered on 23 Jan 2012
5 answers
301 views
We are using RadSpell on touch screens and we cannot restyle or override the confirm dialog (pops up after you hit cancel after changing a word) for bigger buttons so I just want to get rid of it.

OnClientCheckCancelled only fires after a selection is made in the confirm dialog and I cannot suppress it this way

Using 
window.confirm = function(msg){} does not work either.
What can I do to address this?
Rumen
Telerik team
 answered on 23 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?