Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
108 views
I have master page with a RadSplitter and inside one of the panes I have two radlistbox elements.  When the page is first rendered, everything is perfect.  When I select an item from either list box (even if I select multiple or all items) and I move them to the other side (which triggers the ondeleted and/or oninserted event), the page postback renders the radlistboxes slightly above their original position, hiding other user controls.  It remains that way until one of the list boxes achieves focus, then it drops down into it's proper place. 

How do it fix this?

Page: (no other content but the content place holder controls)

<asp:Label ID="labelStatus" runat="server" />
    <br />
    <PBM:PBMActionButton ID="linkEdit" runat="server" ImageUrl="~/Images/32/save.png"
        Text="Update User List" OnClick="linkEdit_OnClick" CssClass="actionbutton" />
    <PBM:PBMActionButton ID="linkCancel" runat="server" ImageUrl="~/Images/32/undo.png"
        Text="Cancel" OnClick="linkCancel_OnClick" CssClass="actionbutton" CausesValidation="false" />
    <br />
    <br />
    <div>
        <telerik:RadListBox ID="listSource" runat="server" TransferToID="listDestination"
            AllowTransfer="true" AllowTransferDuplicates="false" AllowTransferOnDoubleClick="false"
            AutoPostBackOnTransfer="true" SelectionMode="Multiple" TransferMode="Move" Height="200px"
            Width="225px">
        </telerik:RadListBox>
        <telerik:RadListBox ID="listDestination" runat="server" Height="200px" Width="200px"
            OnDeleted="listDestination_OnDeleted" OnInserted="listDestination_OnInserted"
            SelectionMode="Multiple">
        </telerik:RadListBox>
    </div>
    Hold down the <control> key to select multiple entries at a time.

Master:

<body>
    <form style="height: 100%; width: 100%; margin: 0px; padding: 0px;" id="masterForm" runat="server">
    <asp:ScriptManager ID="scriptmanagerGlobal" runat="server" EnablePartialRendering="true"
        EnablePageMethods="true" EnableViewState="true" />
    <telerik:RadAjaxManager ID="radajaxmanagerGlobal" runat="server" EnableAJAX="true"
        EnableViewState="true">
    </telerik:RadAjaxManager>
    <div style="height: 100%; width: 100%">
        <div class="headerpane headerbackground">
            <telerik:RadSplitter ID="RadSplitter3" runat="server" Orientation="Vertical" Width="100%"
                Height="45" BorderSize="0" PanesBorderSize="0">
                <telerik:RadPane ID="RadPane5" runat="server" Width="50%" Height="49">
                    <asp:ContentPlaceHolder ID="contentTopLeft" runat="server">
                    </asp:ContentPlaceHolder>
                </telerik:RadPane>
                <telerik:RadPane ID="RadPane6" runat="server" Width="50%" Height="49" CssClass="valigncentered halignright"
                    MinHeight="49" MinWidth="50">
                    <span style="vertical-align: middle; text-align: right">Logged in as
                        <asp:LoginName ID="LoginName" runat="server" />
                    </span>
                </telerik:RadPane>
            </telerik:RadSplitter>
        </div>
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Skin="Windows7" Width="100%"
             Height="100%" HeightOffset="50" BorderWidth="0px" BorderSize="0">
            <telerik:RadPane ID="RadPane2" runat="server" Width="210px" CssClass="leftpane">
                <telerik:RadSplitter ID="RadSplitter2" runat="server" Orientation="Horizontal" Width="100%"
                    Height="100%" BorderSize="0" PanesBorderSize="0">
                    <telerik:RadPane ID="RadPane3" runat="server" Height="80%">
                        <asp:ContentPlaceHolder ID="contentPaneLeft" runat="server">
                            Default Content
                        </asp:ContentPlaceHolder>
                    </telerik:RadPane>
                    <telerik:RadPane ID="RadPane4" runat="server" Height="20%">
                        <asp:ContentPlaceHolder ID="contentPaneLeftBottom" runat="server">
                            Default Content
                        </asp:ContentPlaceHolder>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward" EnableResize="False">
            </telerik:RadSplitBar>
            <telerik:RadPane ID="RadPane1" runat="server">
                <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" EnableAJAX="false">
                    <div class="breadcrumb clear">
                        <div>
                            <asp:Label ID="LabelTitle" runat="server" CssClass="pagetitle" /><asp:Label ID="LabelSubTitle"
                                runat="server" CssClass="pagesubtitle" />
                        </div>
                        <asp:PlaceHolder ID="BreadCrumb" runat="server" />
                    </div>
                    <asp:ContentPlaceHolder ID="contentPaneRight" runat="server">
                        Default Content
                    </asp:ContentPlaceHolder>
                </telerik:RadAjaxPanel>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </div>
    </form>
</body>
</html>
Gary
Top achievements
Rank 1
 asked on 31 Dec 2010
19 answers
306 views
Hi,

As per the title, I have managed to save the raddocklayout state to a database and restore it sucessfully. However, it only seems to be saving/restoring all the dock's positions within a dockzone. i.e. it restores docks to the appropriate dockzones and to their places within the dockzones.

However, it does not seem to be restoring the collapse state of any dock. I got the code from various forum posts and the demo etc.

What am I doing wrong?

Thanks,
Steve

My save code:
JavaScriptSerializer serializer = new JavaScriptSerializer(); 
            string serializedPositions = serializer.Serialize(e.Positions); 
            string serializedIndices = serializer.Serialize(e.Indices); 
 
            string serializedLayout = serializer.Serialize(new string[] { serializedPositions, serializedIndices }); 
 
// save it to a SQL Server database 
 
My restore code:
string layout = /* get the string from the database */; 
                    if (!string.IsNullOrEmpty(layout)) 
                    { 
                        JavaScriptSerializer serializer = new JavaScriptSerializer(); 
                        string[] positionsAndIndices = serializer.Deserialize<string[]>(layout); 
 
                        e.Positions = serializer.Deserialize<Dictionary<string, string>>(positionsAndIndices[0]); 
                        e.Indices = serializer.Deserialize<Dictionary<string, int>>(positionsAndIndices[1]); 
                    } 
jfkrueger
Top achievements
Rank 1
 answered on 31 Dec 2010
2 answers
108 views
Hi,

I am using a GridButtonColumn in a grid to delete records.  The confirm text that I want to display is quite long.  Is it possible to put a carriage return and line feed in the text?

ConfirmText

 

="This group will be deleted from all users that have this group assigned to them. This process CANNOT be undone. Are You Sure Want To Delete This Group?" ConfirmDialogType="RadWindow"

Thank You

 

Tracy
Top achievements
Rank 1
 answered on 31 Dec 2010
1 answer
371 views
I have a RadNumericTextbox and I want to assign two javascript events to fire for the OnValueChanged.

So lets say I have JavaScript methods called MethodA(); and MethodB(); that I want to call.  What I would like to do would be something like this:

<telerik:RadNumericTextBox ID="rntMyTextBox" Type="Number" runat="server"
                    MaxValue="997" EnabledStyle-HorizontalAlign="Right" Font-Size="Small" MaxLength="3"
                    MinValue="0" Width="153px" FocusedStyle-PaddingRight="1px" ShowSpinButtons="true"
                    ClientEvents-OnValueChanged="MethodA(); MethodB();">
 I am able to stack methods on other HTML properties, such as when I add an onChange="alert('A'); alert('B');" property and change the value via the page, then I get the expected message boxes, the first saying A, the second saying B.

So the first question is, can this be done?  If so, what is the format?  I can't seem to make it work.

Secondly, one of the methods I'm adding sets a 'FormHasChanged' bool to True... but based on another forum post I read it would seem the 'OnValueChanged' fires once when the page loads and the control populates the value initially... is there a way to modify this behavior?  The other post suggested tracking the before and after values... this is far from ideal as I would like to be able to generically add a call to set the bool when the value changes.

The big picture is this:

From a random page's code behind I want to be able to call a function I created like so:
//Add the OnChange event to all the appropriate controls on this user control.
ControlManager.AddOnChange(this.Controls, "SetDirtyFlag"true);
The AddOnChange method loops through all the controls in the passed in control set.  For each control, it tries to decide how best to apply an 'onChange' event... ADDING to any existing method defined.  The way I'm trying to do this for a RadNumericEtc is something like :
else if(control is RadNumericTextBox)
{
(control as RadNumericTextBox).ClientEvents.OnValueChanged = (control as RadNumericTextBox).ClientEvents.OnValueChanged + ";" + onChangeString;
//We also want to avoid user tab to the up and down spinner buttons on any RadNumericTextBox controls.
(control as RadNumericTextBox).ButtonDownContainer.Attributes.Add("tabindex""-1");
(control as RadNumericTextBox).ButtonUpContainer.Attributes.Add("tabindex""-1");
}
This way, when I call AddOnChange, the SetDirtyFlag method call would be ADDED to any other method(s) defined to fire when the value changes.  The SetDirtyFlag simply sets the 'FormHasChanged' flag to true, without needing to include any other specific logic.

So my two issues are 1) I can't seem to stack method calls and 2) If the 'OnValueChanged' fires at page load, then the page will ALWAYS think the form has changed... and if I have to track before/after values, then that would require a MASSIVE amount of additional coding...

Thoughts?
Cori
Top achievements
Rank 2
 answered on 31 Dec 2010
1 answer
153 views
Hi,

I'm currently upgrading our application to support the Ajax editor. I'd like to hide the above mentioned button text. I just want to see their icons with tooltips. How would I do this?

Regards,
Laredo
Rumen
Telerik team
 answered on 31 Dec 2010
4 answers
112 views

 

hi I am trying to get a PDF Report for this following code.  But its displaying Empty Report.

Please help me .

Thanks in advance


<
telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"

 

 

GridLines="None">

 

<

 

HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>

 

<

 

MasterTableView>

 

<

 

CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>

 

<

 

RowIndicatorColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

RowIndicatorColumn>

 

<

 

ExpandCollapseColumn>

 

<

 

HeaderStyle Width="20px"></HeaderStyle>

 

</

 

ExpandCollapseColumn>

 

 

<Columns>

 

 

<telerik:GridTemplateColumn UniqueName="TemplateColumn">

 

 

<ItemTemplate>

 

 

<table>

 

 

<tr>

 

 

<td>

 

 

<asp:Label ID="lblSchoolName" runat="server" Text='<%# Eval("InstitutionName") %>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Student Name

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblStudentName" runat="server" Text='<%# Eval("FullName")%>'></asp:Label>

 

 

</td>

 

 

<td>

 

Date Of Payment

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblDOP0" runat="server" Text='<%# Eval("DateOfPayment")%>'> </asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Class

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblClass" runat="server" Text='<%#Eval("CourseName")%>'></asp:Label>

 

 

</td>

 

 

<td>

 

Transaction Number

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblTransactionNumber" runat="server" Text='<%#Eval("TransactionNumber")%>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Year

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblYear" runat="server" Text='<%#Eval("Section")%>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Fee Type

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblFeeType" runat="server" Text='<%#Eval("FeeTypeName")%>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

<tr>

 

 

<td>

 

Term

 

</td>

 

 

<td>

 

 

<asp:Label ID="lblTerm" runat="server" Text='<%#Eval("TermNameIndex")%>'></asp:Label>

 

 

</td>

 

 

</tr>

 

 

</table>

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

</

 

MasterTableView>

 

 

</telerik:RadGrid>

 

vijay
Top achievements
Rank 1
 answered on 31 Dec 2010
1 answer
61 views
Hi everybody and merry christmas !

I'm trying to cancel filtering client side on the "oncommand" client event.

It's Ok when i just lostfocus on the textbox filter but if i press enter key the event is not cancel.

js function :

function RadGrid1_Command(sender, eventArgs) {
 
        if (eventArgs.get_commandName() == "Sort" || eventArgs.get_commandName() == "Page" || eventArgs.get_commandName() == "PageSize" || eventArgs.get_commandName() == "Filter" ) {
            if (confirm("blablabmlablabla")) {
                eventArgs.set_cancel(true);
            }else{ ....}
        }
  }

Client setting :

<ClientSettings>
    <ClientEvents OnCommand="RadGrid1_Command" />
</ClientSettings>

Filter column :
<telerik:GridTemplateColumn HeaderText="Libellé"
                   SortExpression="LIBRED"
                   DataField="LIBRED"                            
                   AutoPostBackOnFilter="true"
                   CurrentFilterFunction="Contains"
                   ShowFilterIcon="false"
                   UniqueName="LIBRED">
                 <ItemTemplate>
                     <asp:Label ID="LibelleLbl" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "LIBRED")%>' />
                   </ItemTemplate>
</telerik:GridTemplateColumn>

Thanks.

OPL



Daniel
Telerik team
 answered on 31 Dec 2010
1 answer
69 views
I have a clientside RadGrid that I am doing the following:
grid.tableView = grid.get_masterTableView();
grid.tableView.set_dataSource(data.Items);
grid.tableView.dataBind();
grid.tableView.set_virtualItemCount(data.Count);
Before my RowDatabound and DataBound Events are called, I am getting a bunch of blank rows with "System.Data.DataRowView" displayed in them. 
My attempt to fix this was to default the grid to display:none and then set it back later one, but I can't find a good event to do this since RowDataBound isn't good enough as it does it on the first row and that's not good enough. Any thoughts/ideas?
Tsvetoslav
Telerik team
 answered on 31 Dec 2010
8 answers
156 views
When using the GroupsDefaultExpanded = False, and also using inline editing, when I click the editbutton, my inline edit form won't show but instead the group collapses again. When using groups and not having GroupsDefaultExpanded on false there is no problem.

Using 2008.3.1124, in a dotNetNuke module. But also tried a testpage without dotnetnuke with the same problem.





G
Top achievements
Rank 1
 answered on 31 Dec 2010
1 answer
133 views
I have a case in which I need to use a custom validator in a grid edit form, and part of the custom validation is dependent upon ID of the data item being edited, but I don't see how to find that data item in my validation code.  Basically, I need to ensure that the name value entered in a text box is unique in the database for that table - which means that for an insert no other record should exist in the table with that name value, and for an update only the record with the matching ID should exist with that value.  My custom validator looks like:

<asp:CustomValidator ID="UniqueNameValidator" runat="server" Display="Dynamic"  ErrorMessage='A record already exists with this name' ControlToValidate="NameEditTextBox" OnServerValidate="ValidateUniqueName" />

Then the server side method would be:

        protected void ValidateUniqueName(object source, ServerValidateEventArgs args)
        {
            /// code here
        }

My problem is that the args object only gives me the value of the field being validated.  In order for me to do the dupe check I need to know the GridEditableItem being edited, and I don't know how to find that programmatically in this case because I don't have a GridCommandEventArgs or similar object with which to look at e.Item.

Is there any way to find the current GridEditableItem object from just looking at the grid object? Or is there another way to approach this that I am missing?
Princy
Top achievements
Rank 2
 answered on 31 Dec 2010
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?