Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
97 views
Hi,
         I am creating docks dynamically and trying to pin them on the sliding content pane. It seems that the dock.pinned = true is not behaving properly with ie7. whenever i set this property as true the dock just exceeds the boundaries of the zone and layout. Is there a solution for this issue. Its important as i do not want users to to drag the docks anywhere on the interface.

Regards,
Ajit
Pero
Telerik team
 answered on 01 Jul 2009
2 answers
292 views
HI
I have the following code for a grid that i'm using to manage Users. I created a custom edit form with a few textobxes and a checkbox, this works 100% when editing an item, however i get an error(Invalid Cast Exception) when trying to create a new User, this error is thrown while the custom form is being loaded.
I know that this is caused by the asp checkbox that i'm using in the edit form, Please assist me.
Thanks in advance :)

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdminPage.aspx.cs" Inherits="AddEditUsers" %> 
 
<%@ 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"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title>All Users</title> 
    <style type="text/css"
        .style1 
        { 
            width: 100%; 
            height: 68px; 
        } 
    </style> 
</head> 
<body> 
     
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server"
    </asp:ScriptManager> 
    <div> 
    <table class="style1"
        <tr> 
            <td> 
                &nbsp;</td> 
        </tr> 
        <tr> 
            <td> 
                <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"  
                    DataSourceID="SqlDataSource1" GridLines="None"  
                    Skin="Vista" AllowAutomaticDeletes="True" AllowAutomaticUpdates="true"  
                    AllowAutomaticInserts="true" AllowMultiRowEdit="True"
<MasterTableView datakeynames="UserId" datasourceid="SqlDataSource1" EditMode="PopUp"  commanditemdisplay="Top" > 
<RowIndicatorColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</RowIndicatorColumn> 
 
<ExpandCollapseColumn> 
<HeaderStyle Width="20px"></HeaderStyle> 
</ExpandCollapseColumn> 
    <Columns> 
        <telerik:GridButtonColumn ConfirmText="Are You Sure You Want To Delete This User?" ButtonType="ImageButton" CommandName="Delete" Text="Delete" UniqueName="DeleteColumn1"
                                        <HeaderStyle Width="20px" /> 
                                        <ItemStyle HorizontalAlign="Center" /> 
        </telerik:GridButtonColumn> 
        <telerik:GridBoundColumn DataField="UserId" DataType="System.Int32"  
            HeaderText="UserId" ReadOnly="True" SortExpression="UserId" UniqueName="UserId" Visible="false"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="UserName" HeaderText="User Name"  
            SortExpression="UserName" UniqueName="UserName"
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="Password" HeaderText="Password"  
            SortExpression="Password" UniqueName="Password"
        </telerik:GridBoundColumn> 
        <telerik:GridCheckBoxColumn DataField="IsAdmin" HeaderText="Administrator" 
                        DataType="System.Boolean"
                    </telerik:GridCheckBoxColumn> 
        <telerik:GridEditCommandColumn ButtonType="ImageButton"
        </telerik:GridEditCommandColumn> 
        <telerik:GridHyperLinkColumn></telerik:GridHyperLinkColumn> 
         
    </Columns> 
     <EditFormSettings EditFormType="Template"
     <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
     <FormTemplate> 
     <table id="EditTable" cellspacing="1" cellpadding="1" border="0"
     <tr>  
        <td>User Name</td> 
        <td> <asp:TextBox ID="txtUserName" runat="server" MaxLength="10" Text='<%#Bind("UserName") %>'></asp:TextBox></td
     </tr> 
     <tr> 
        <td>Password</td> 
        <td> <asp:TextBox ID="txtPassword" runat="server" MaxLength="15" Text='<%#Bind("Password") %>'></asp:TextBox></td
     </tr> 
     <tr> 
        <td></td
        <td> <asp:CheckBox ID="chkIsAdmin" runat="server" Text="Administrator" Checked='<%#Bind("IsAdmin") %>'></asp:CheckBox></td
     </tr> 
     <tr> 
        <td><asp:Button id="btnUpdate" runat="server" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'/></td> 
        <td><asp:Button ID="btnCancel" runat="server" CausesValidation="false" CommandName="cancel" Text="Cancel"/></td> 
     </tr> 
     </table> 
     </FormTemplate> 
     </EditFormSettings> 
</MasterTableView> 
 
                    <ClientSettings> 
                        <Selecting AllowRowSelect="True" /> 
                    </ClientSettings> 
 
<FilterMenu EnableTheming="True"
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
</FilterMenu> 
                </telerik:RadGrid> 
                <asp:SqlDataSource ID="SqlDataSource1" runat="server"  
                    ConflictDetection="CompareAllValues"  
                    ConnectionString="<%$ ConnectionStrings:lawsocConnectionString %>"  
                    DeleteCommand="DELETE FROM [tbUsers2] WHERE [UserId] = @original_UserId AND [UserName] = @original_UserName AND [Password] = @original_Password AND [IsAdmin] = @original_IsAdmin"  
                    InsertCommand="INSERT INTO [tbUsers2] ([UserName], [Password], [IsAdmin]) VALUES (@UserName, @Password, @IsAdmin)"  
                    OldValuesParameterFormatString="original_{0}"  
                    SelectCommand="SELECT [UserId], [UserName], [Password], [IsAdmin] FROM [tbUsers2]"  
                    UpdateCommand="UPDATE [tbUsers2] SET [UserName] = @UserName, [Password] = @Password, [IsAdmin] = @IsAdmin WHERE [UserId] = @original_UserId AND [UserName] = @original_UserName AND [Password] = @original_Password AND [IsAdmin] = @original_IsAdmin"
                    <DeleteParameters> 
                        <asp:Parameter Name="original_UserId" Type="Int32" /> 
                        <asp:Parameter Name="original_UserName" Type="String" /> 
                        <asp:Parameter Name="original_Password" Type="String" /> 
                        <asp:Parameter Name="original_IsAdmin" Type="String" /> 
                    </DeleteParameters> 
                    <UpdateParameters> 
                        <asp:Parameter Name="UserName" Type="String" /> 
                        <asp:Parameter Name="Password" Type="String" /> 
                        <asp:Parameter Name="IsAdmin" Type="String" /> 
                        <asp:Parameter Name="original_UserId" Type="Int32" /> 
                        <asp:Parameter Name="original_UserName" Type="String" /> 
                        <asp:Parameter Name="original_Password" Type="String" /> 
                        <asp:Parameter Name="original_IsAdmin" Type="String" /> 
                    </UpdateParameters> 
                    <InsertParameters> 
                        <asp:Parameter Name="UserName" Type="String" /> 
                        <asp:Parameter Name="Password" Type="String" /> 
                        <asp:Parameter Name="IsAdmin" Type="String" /> 
                    </InsertParameters> 
                </asp:SqlDataSource> 
            </td> 
        </tr> 
        <tr> 
            <td> 
                &nbsp;</td> 
        </tr> 
        <tr> 
            <td> 
                &nbsp;</td> 
        </tr> 
    </table> 
    </div> 
    </form> 
</body> 
</html> 
 
 







Ismail
Top achievements
Rank 1
 answered on 01 Jul 2009
5 answers
246 views
I like to get a radalert directly on Button Click. The code below works, but the radalert comes not directly up. Is there a way to force the execution of the responsescript directly?

I've following code in a button_onClick Event:

 

private

 

void btbuy_clicked(object sender, EventArgs e)

 

{

 

......
......

foreach

 

(Article art in articlesselected)

 

{

 

if (ct + 1 > art.MaxAnz)

 

{

RadAjaxManager1.ResponseScripts.Add(

"(function(){var f = function(){radalert('<h4>Dieser Artikel ist leider nicht mehr verfgbar!</h4>', 330, 210);Sys.Application.remove_load(f);};Sys.Application.add_load(f);})()");

 

 

return;

 

}

myOrder.setArticle(1, art);

}

 

 

...
...

}

This is the aspx file:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ProtelShop._Default" MasterPageFile="~/ProtelShop.Master" %> 
 
<%@ Register assembly="Telerik.OpenAccess, Version=2009.1.405.1, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" namespace="Telerik.OpenAccess" tagprefix="telerik" %> 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik"  %> 
 
 
 
<%@ Reference Control="~/Controls/ShopBuyTooltip.ascx" %> 
 
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">  
<telerik:RadAjaxManager runat="server">  
 <AjaxSettings>    
        <telerik:AjaxSetting AjaxControlID="Button1">    
            <UpdatedControls>    
                <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />    
            </UpdatedControls>    
        </telerik:AjaxSetting>    
    </AjaxSettings>    
 
    </telerik:RadAjaxManager> 
    <div> 
      
    </div> 
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">  
      
    </telerik:RadScriptManager> 
    <telerik:RadWindowManager runat="server">  
    </telerik:RadWindowManager> 
    <script type="text/javascript">  
        //<![CDATA[
            function hideActiveToolTip()
            {            
                var controller = Telerik.Web.UI.RadToolTipController.getInstance();
                var tooltip = controller.get_activeToolTip();
                if (tooltip)
                {
                    tooltip.hide();
                }
            }
            
            Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(beginRequestHandler);
            function beginRequestHandler(sender, args)
            {
                var prm = Sys.WebForms.PageRequestManager.getInstance();
                if (args.get_postBackElement().id.indexOf('RadScheduler1') != -1)
                {
                    hideActiveToolTip();
                }
            }
            
            function clientBeforeShow (sender, eventArgs) {
             w = $telerik.$(window).width() / 2;
             h = $telerik.$(window).height() / 2;
               
             if ((sender._mouseX > w) && (sender._mouseY > h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.TopLeft);
             return;
             }
             if ((sender._mouseX < w) && (sender._mouseY > h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.TopRight);
             return;
             }
             if ((sender._mouseX > w) && (sender._mouseY < h)) {
             sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomLeft);
             return;
             }
         sender.set_position(Telerik.Web.UI.ToolTipPosition.BottomRight);
            }
        //]]> 
        </script> 
    <telerik:OpenAccessDataSource ID="OpenAccessDataSource1" runat="server"   
        ObjectContextProvider="ProtelShop.ObjectScopeProvider1, ProtelShop"   
        TypeName="ProtelAccess.Article" ContextTypeName="" OrderBy=""   
        Where="MaxAnz &gt; 0" > 
    </telerik:OpenAccessDataSource> 
      <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
             </AjaxSettings> 
     </telerik:RadAjaxManager> 
<telerik:RadSkinManager ID="RadSkinManager1" runat="server">          
        </telerik:RadSkinManager> 
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server"  DecoratedControls="All"/>  
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" > 
     <asp:UpdatePanel runat="server" ID="UpdatePanel1" UpdateMode="Conditional">  
            <ContentTemplate>                  
                  <asp:Panel ID="Panel2" runat="server" CssClass="title" > 
                   Seminar Angebote  
               </asp:Panel> 
    <telerik:RadScheduler ID="RadScheduler1" runat="server" DataEndField="EndTime"   
        DataKeyField="ArtNr" DataSourceID="OpenAccessDataSource1"   
        DataStartField="StartTime" DataSubjectField="Name" HoursPanelTimeFormat="htt"   
        ValidationGroup="RadScheduler1"  ReadOnly="true"  SelectedView="MonthView">  
    </telerik:RadScheduler> 
    <telerik:RadToolTipManager runat="server" ID="RadToolTipManager1" Width="320" Height="170" 
                    Animation="None" HideEvent="LeaveToolTip" Text="Loading..." 
                    OnAjaxUpdate="RadToolTipManager1_AjaxUpdate" OnClientBeforeShow="clientBeforeShow" /> 
                      
                      
                   <br /> 
         
         </ContentTemplate> 
        </asp:UpdatePanel> 
         <asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">  
           <ContentTemplate> 
           <br /> 
               <asp:Panel ID="Panel1" runat="server" CssClass="title">  
                   Warenkorb  
               </asp:Panel> 
           <telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="true"   
                    AllowAutomaticUpdates="true" AutoGenerateColumns="true"   
                    AutoGenerateDeleteColumn="true" OnDeleteCommand="RadGrid1_DeleteCommand"  OnItemDataBound="RadGrid1_ItemDataBound" > 
                    <MasterTableView AutoGenerateColumns="False" RetrieveAllDataFields="false" ShowFooter="true">  
                        <Columns> 
                            <telerik:GridBoundColumn DataField="ArtNr" HeaderText="Artikelnummer">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Name" HeaderText="Artikelname">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="ArtName" HeaderText="Artikelbeschreibung">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="StartTime" HeaderText="Start">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="EndTime" HeaderText="Ende">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="Quantity" HeaderText="Anzahl">  
                            </telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn DataField="ArtPrice" HeaderText="Preis">  
                            </telerik:GridBoundColumn> 
                             
 
                        </Columns> 
                          
                    </MasterTableView> 
                </telerik:RadGrid> 
             
           </ContentTemplate> 
         </asp:UpdatePanel> 
        </telerik:RadAjaxPanel> 
        <br /> 
         <asp:UpdatePanel runat="server" ID="UpdatePanel3" UpdateMode="Conditional">  
           <ContentTemplate> 
        <div style="text-align:right">  
    <asp:Button ID="Button1" runat="server" Text="Zur Kasse" onclick="Button1_Click" Width="100px"  /> 
    </div> 
    <asp:Literal ID="LiteralScript" runat="server"></asp:Literal> 
    </ContentTemplate> 
    </asp:UpdatePanel> 
      
 </asp:Content> 
Svetlina Anati
Telerik team
 answered on 01 Jul 2009
3 answers
205 views
Hi,
  Is there a way to make the built-in resizing functionality of an image to be always proportional?
  This is to ensure that content being created is not distorted (in terms of the original image used).

Many Thanks,
Henry Wu
Rumen
Telerik team
 answered on 01 Jul 2009
1 answer
109 views
Hi
     I have the problem in IE to display the RadGrid..
              
               I have placed the below code to fit the slider control in radgrid. But once i enabled the scrollbar freezing . I could not get the right dispaly for my slider control while it is loading. But once i change the value of slider, automattically fit accoardingly what i meant to occupy.Plz help me for this problem as soon as poosible.
Note: The slider fits in Firefox but not in IE

my style code are given below for ur reference..

<telerik:GridBoundColumn HeaderStyle-Width="250px" ItemStyle-Width="500px" SortExpression="Quantity"
                            Aggregate="Sum" FooterText="Quantity :" ItemStyle-HorizontalAlign="left" FooterStyle-HorizontalAlign="Center"
                            HeaderText="Quantity" DataField="Quantity" UniqueName="Quantity">
                            <FilterTemplate>
                                <table border="0">
                                    <tr>
                                        <td style="border-width: 0px;">
                                            <asp:Label ID="MinLabel" runat="server" Text="$0"></asp:Label>
                                        </td>
                                        <td style="border-width: 0px;">
                                            <telerik:RadSlider runat="server" ID="RadSlider1" IsSelectionRangeEnabled="true"
                                                SmallChange="5" Style="float:none;display:table-row" ShowDecreaseHandle="false" ShowIncreaseHandle="false" Width="135px"
                                              
                                                OnClientSlideStart="ClientSlideStart" />
                                            <div style="clear: both">
                                                <asp:Literal ID="Literal1" runat="server" Text='<%# "Range: $" + StartSlider + " - $" + EndSlider %>' />
                                            </div>
                                           
                                        </td>
                                        <td style="border-width: 0px;">
                                            <asp:Label ID="MaxLabel" runat="server" Text="$25"></asp:Label>
                                        </td>
                                    </tr>
                                </table>
                            </FilterTemplate>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn SortExpression="SourceFile" AllowFiltering="false" HeaderText="SourceFile"
                            DataField="SourceFile">
                        </telerik:GridBoundColumn>
Dimo
Telerik team
 answered on 01 Jul 2009
3 answers
311 views
Hi, I am using three Rad combo boxes on my page all three of them are pretty much similar with LoadOnDemand functionality. All three combo boxes has selectedindexchanged event handler beside some other event handlers. The selectedindexchanged event fires as expected but some time it fires when I click button or a checkbox button. I am trying to figure out what exactly causing this strange behaviour, because it doesn't fire every time I click button or checkbox.  If any body knows or dealt with this issue please let me know.

Thanks
Saqib
Yana
Telerik team
 answered on 01 Jul 2009
3 answers
150 views
Hi everyone,

Here is the scenario I am having an issue with:

I have two Combo boxes on my webpage, combo box A refreshes combo box B after you move off combo box A. In the code behind for combo box A selected index change is  

RadScriptManager1.SetFocus(COMBOBOXB.ClientID +

"_Input");

However this code does not properly set focus back on the control. The list item that is combo box is not given the blue selection.

Please advise.

Thank you in advance.

 

 

 

 

 

 

Veselin Vasilev
Telerik team
 answered on 01 Jul 2009
1 answer
131 views
Hi
How we can disable specific column from displaying it on header context menu. Can i customize in placing  no of columns in HeaderContextmenu.

regards,
Appu
 
Daniel
Telerik team
 answered on 01 Jul 2009
5 answers
187 views
Hi,  possibly a relatively simple one, but how do you style the PageTitle when exporting to a PDF?  I really only want to change the font to Arial to match the rest of my document.

And while we're on this subject - any thoughts on how to access the main table element?  I would like to add a style attribute to it to control the borders.

P.S. I have trawled the examples and forums and worked out how to style everything else - just these two things seem to be missing.
Daniel
Telerik team
 answered on 01 Jul 2009
1 answer
65 views
Hi All,

I am using Rad grid with

AllowAutomaticInserts

 

="false" AllowAutomaticUpdates="false"

I am handling inserts and updates in code behind (C#) using item command event of rad grid and some of the columns of rad grid are button columns on click of that I am opening another Panel.

 

I want to apply ajax on my grid
Following is the code I am using

 

<

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

 

 

<AjaxSettings>

 

 

<telerik:AjaxSetting AjaxControlID="radgridUserMgt">

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="radgridUserMgt" LoadingPanelID="RadAjaxLoadingPanelGrid" />

 

 

<telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>

 

 

</AjaxSettings>

 

 

</telerik:RadAjaxManager>

Problem is that My Add and Update functionalities are not working.When I click on Add or Edit It just show me the loading panel for long time and does not open the edit form to add or update.

This is really a blocker for me.please help me ASAP.Help will be highly appreciated.

Ekta.

 

Pavlina
Telerik team
 answered on 01 Jul 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?