Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
126 views
Hi,

There are two panels: PanelB embedded inside PanelA. I would like BUttonA to update the whole PanelA (including PanelB)P but ButtonB - to update PanelB only. 
The markup is the following:

  <telerik:RadAjaxManager ID="AjaxManager" runat="server">  
    <AjaxSettings> 
      <telerik:AjaxSetting AjaxControlID="ButtonA">  
        <UpdatedControls> 
          <telerik:AjaxUpdatedControl ControlID="PanelA" /> 
        </UpdatedControls> 
      </telerik:AjaxSetting> 
      <telerik:AjaxSetting AjaxControlID="ButtonB">  
        <UpdatedControls> 
          <telerik:AjaxUpdatedControl ControlID="PanelB" /> 
        </UpdatedControls> 
      </telerik:AjaxSetting> 
    </AjaxSettings> 
  </telerik:RadAjaxManager> 
  <div runat="server" id="PanelA">  
    <asp:Button runat="server" ID="ButtonA" Text="ButtonA" /> 
    <%-- some PanelA stuff --%> 
    <div runat="server" id="PanelB">  
      <asp:Button runat="server" ID="ButtonB" Text="ButtonB" /> 
      <%-- some PanelB stuff --%> 
    </div> 
  </div> 
 
But the effect is that when I click ButtonB the whole PanelA is updated.
How can I achieve my goal?

Regards
Tomasz
Pavlina
Telerik team
 answered on 18 Feb 2010
3 answers
221 views
Hi,

I am having trouble to use the Binary Image.
1. Is it possible to use Binary Image insde a Gridview Template column? If yes
Do you have any eaxmples?
2. I am getting employeeID via SQL Query. The image url should be like http://www.xyz.com/employeephotos/xxxxx.jpg where xxxx is the employee ID? How do I bind the the control to point to this link? All photos are stored in employeephotos folder
3. Also I need to resize to to fixed width? Where do I specify? Please help ASAP.

Thanks,
Iana Tsolova
Telerik team
 answered on 18 Feb 2010
1 answer
48 views
Try as I might I just can't convince our MD that the DetailTables already built into the Telerik Grids work well. I think he would prefer to see them in a modal window or popup rather than inline in the grid.

Would thIs be possible by making some changes to the existing code? Is there anything else I haven't yet considered?

Thanks

Rick
Veli
Telerik team
 answered on 18 Feb 2010
5 answers
148 views
I got a page, where I need to do some server side validation, using ajax, since client-side validation its not realy secure (tamper data or similar), but i cant figure out how to show the tooltip based on a server side event.

protected void addwhateverbutton(object sender, someeventargs e)
{
    bool isError = false;
    // do some validation
    // add to the label, inside the tooltip, the right error message and set iserror = true, if theres one.

    if (isError) //showtooltip
    else //dosomething
}

Regards
André
Svetlina Anati
Telerik team
 answered on 18 Feb 2010
3 answers
112 views

Hi,

I have an issue with sorting.
I have a grid that is full generated on server side. It is not generated on the page Init or page load because it is dynamically created (columns and rows) based on previous control selection. Think of web based database editor.

<telerik:RadGrid ID="rgEntity" runat="server" AllowPaging="True" AllowCustomPaging="True" PageSize="25" Skin="Office2007" GridLines="None" AllowSorting="True" AutoGenerateColumns="False" OnPageIndexChanged="rgEntity_PageIndexChanged" OnSortCommand="rgEntity_SortCommand">
 <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="True" />
 <MasterTableView Width="100%" Height="100%" CommandItemDisplay="Top" EnableColumnsViewState="True" InsertItemDisplay="Top" EditMode="InPlace">
 <RowIndicatorColumn><HeaderStyle Width="20px"></HeaderStyle></RowIndicatorColumn>
 <ExpandCollapseColumn><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn>
 </MasterTableView>
 <ClientSettings EnableRowHoverStyle="True">
 <Scrolling AllowScroll="True" UseStaticHeaders="True" />
 <Selecting AllowRowSelect="true" />
 </ClientSettings>
</telerik:RadGrid>

 

protected void rgEntity_SortCommand(object source, GridSortCommandEventArgs e)
{
   e.Canceled = true;
   GridSortExpression expression = new GridSortExpression();
   string prevSortColumn = hiddenSortColumn.Value;
   string prevSortDirection = hiddenSortDirection.Value;
   bool prevSortDescending = false;

   if (prevSortDirection != "false")
      prevSortDescending = true;

   string fieldname = e.CommandArgument.ToString(); 
   bool sortdescending = false;

   if (prevSortColumn == fieldname)
      sortdescending = !prevSortDescending;

   hiddenSortColumn.Value = fieldname;
   hiddenSortDirection.Value = sortdescending.ToString();
   LoadData(fieldname, sortdescending);
}

 

My problem is that the server side code is never accessed.
I checked that postback occurs and I can see that the Page_Load event is called, but the SortCommand event is never reached.

Also, I tried changing the EnableColumnsViewState to false, but then the app crashes on js file.
Microsoft Jscript runtime error: 'this.get_element().tBodies.0.rows' is null or not an object.

Any help would be appreciated.

Thanks.






 

 

 

 

 

 

 

 

Nikolay Rusev
Telerik team
 answered on 18 Feb 2010
1 answer
117 views
Hi,
I'm trying to display a context menu that expands upwards from the div element. First time I click the div, everything works fine. If i click only inside the div, the menu and the animation work as expected. The problem starts when I click outside the div when the menu is expanded. The animation seems to break and the next time I click the div, the menu does not start expanding from the top edge of the div but appears below it and slides upwards.

regards
Pawel

<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
<form id="form1" runat="server"
<asp:scriptmanager id="Sc1" runat="server"
</asp:scriptmanager> 
<div id="divToClick" style="border: solid thin red; width: 50px; height: 25px; position: absolute; 
    top: 300px; left: 100px;" onclick="ShowMenu(event);"
</div> 
<telerik:RadContextMenu ID="RadContextMenu1" runat="server" DefaultGroupSettings-ExpandDirection="Up"
    <Items> 
        <telerik:RadMenuItem Text="Item1" Value="vItem1"
        </telerik:RadMenuItem> 
        <telerik:RadMenuItem Text="Item2" Value="vItem2"
        </telerik:RadMenuItem> 
        <telerik:RadMenuItem Text="Item2" Value="vItem3"
        </telerik:RadMenuItem> 
    </Items> 
</telerik:RadContextMenu> 
 
</form> 
</body> 
<script type="text/javascript"
    function ShowMenu(e) 
    { 
        var contextMenu = $find('RadContextMenu1'); 
        var divToClick = $get('divToClick'); 
        var bounds = Sys.UI.DomElement.getBounds(divToClick); 
        var x = parseInt(bounds.x); 
        var y = parseInt(bounds.y - 75); 
        contextMenu.showAt(x, y); 
        $telerik.cancelRawEvent(e); 
    } 
</script> 
</html> 





Yana
Telerik team
 answered on 18 Feb 2010
2 answers
96 views
this one took me some time to figure out, but I am at a loss to understand what is happening.
I created the following class:
    /// <summary> 
    /// A data control to reference a method in the current page instance. 
    /// </summary> 
    public class PageMethodDataSource:ObjectDataSource 
    { 
        public PageMethodDataSource() 
        { 
            ObjectCreating += OnObjectCreating; 
        } 
        protected override void OnInit(System.EventArgs e) 
        { 
            base.OnInit(e); 
            TypeName = Page.GetType().BaseType.ToString(); 
        } 
 
        void OnObjectCreating(object sender, ObjectDataSourceEventArgs e) 
        { 
            e.ObjectInstance = Page; 
        } 
    } 

The purpose of this is to use methods in the page instance as data source for controls (in this case a RadGrid). This caused the web resource to stop loading, causing datepickers, timepickers etc to stop working (and the dreaded "Sys is not defined" and "Telerik" is not defined" javascript errors).
Can anyone spot what I may have violated to cause this behaviour?


Øyvind Skaar
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
153 views
Just created a style and after I downloaded the style, I noticed the background sprite that I had upload was being referenced back to the telerik website.

 div.RadMenu_internalweb .rmItem .rmLink:hover .rmText { 
 
    background-image: url('http://stylebuilder.telerik.com//ImageHandler.ashx?mode=get&Skin=internalweb&Control=Menu&Suite=aspnet-ajax&file=internalwebsprite.png'); 
 
    background-position: 100% -26px; 
 
    padding-left: 0px; 
 
    height: 25px; 
 
    margin-top: 0px; 
 
    padding-right: 28px; 
 
    background-color: transparent; 
 

Should it not reference the local copy of the image?
Alex Gyoshev
Telerik team
 answered on 18 Feb 2010
2 answers
313 views
Hello,
I'm really having too much troubles using RadListView. Now I'll try to briefly explain.
The project that I started to work on is a very specialized search engine using a complex data layer that can use one or more databases simultaneously. So I thought that was a good idea to use a RadListView with RadDataPager for a flexible paging.
Initially I was using the ASP.Net Controls version 2009.3.1103. Soon I realized that something was not going on as I expected: in fact, starting with no Data Source specified, after a postback initiated by another control, the data was not shown and the "no data template" was always presented. After a long search, finally I found a post in this forum that pointed me to this known bug.
Well, I did update the controls and the bug disappeared. But, unfortunately, now I'm stuck on the programmatic creation of the control. In fact I discovered that in design-time it is not possible to configure the RadListView via "smart tag option" since a valid data source is not specified.
A search engine cannot perform any query in a first page load, so I need to do all the data source job (dinamic query creation in response of the user parameter input) in a "if Page.IsPostBack then [...] End If" code block.
That's why I passed to the programmatic creation of the control.
Now, and this is the main problem to solve, it seems that there is no way to avoid this error message:
The RadListView control does not have an item placeholder specified.

For more clarity, this is the code-snippet in which I "try" to create the RadListView:

Private rlvResults As RadListView 
 
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init 
 
        Me.BuildListView() 
 
 
End Sub 
 
Protected Sub BuildListView() 
 
        Me.rlvResults = New RadListView() 
        With Me.rlvResults 
            .AllowCustomPaging = False 
            .AllowCustomSorting = False 
            .AlternatingItemTemplate = New GooWayTemplates.AlternatingItemTemplate() 
            .EditItemTemplate = New GooWayTemplates.EditItemTemplate() 
            .InsertItemTemplate = New GooWayTemplates.EditItemTemplate() 
            .ItemTemplate = New GooWayTemplates.ItemTemplate() 
            .EmptyDataTemplate = New GooWayTemplates.EmptyDataTemplate() 
            .LayoutTemplate = New GooWayTemplates.LayoutTemplate() 
            .SelectedItemTemplate = New GooWayTemplates.ItemTemplate() 
            .ItemPlaceholderID = "itemPlaceholder" 
            AddHandler .NeedDataSource, AddressOf rlvResults_NeedDataSource 
            .AllowPaging = True 
        End With 
 
        Me.placeHListView.Controls.Add(Me.rlvResults) 
 
 End Sub 

Where am I wrong?
This is a fundamental step in a big project and I'm really confused :-)

Thanks in advance.
Giovanni Pulvirenti
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
195 views
Hi, there's a problem with radtextbox.
I've 3 radtextblock with enabled property set false at design time in my .aspx page, a raddatepicker with a customvalidator and a button to start the validation.
When validation occours (on click button) the enabled property of the 3 textbox turn to true. Here an example:
<%@ Page Title="" Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="WebApplication1.Default2" %> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head id="Head1" runat="server"
    <title>Titolo</title> 
    <telerik:RadStyleSheetManager ID="RadStyleSheetManagerMain" runat="server" /> 
</head> 
<body id="bodyBackgroundImage" runat="server"
    <center> 
        <form id="form1" runat="server"
        <telerik:RadScriptManager ID="RadScriptManagerMain" runat="server"
            <Scripts> 
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" /> 
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" /> 
            </Scripts> 
        </telerik:RadScriptManager> 
        <telerik:RadAjaxManager ID="RadAjaxManagerMain" runat="server" /> 
        <table class="bodytable" width="950" cellpadding="0" cellspacing="0" border="0"
            <!-- HEADER --> 
            <tr> 
                <td> 
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="headertable"
                        <tr> 
                            <td> 
                                <!--height="88"--> 
                                <table width="100%" class="headertable" border="0" cellpadding="0" cellspacing="0"
                                    <tr> 
                                        <td align="left"
                                        </td> 
                                         
                                    </tr> 
                                    <tr> 
                                         
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td> 
                                    <table id="TableMenu" width="100%" cellspacing="0" cellpadding="0" border="0" class="maintitletable" 
                                        runat="server"
                                        <tr style="height: 33px;"
                                            <td width="20%"
                                            </td> 
                                            <td width="10%"
                                            </td> 
                                            <td align="right"
                                                <!-- HOME --> 
                                                <id="A1" href="~/Default.aspx" runat="server">Home</a> 
                                            </td> 
                                        </tr> 
                                        <tr> 
                                            <td> 
                                                &nbsp; 
                                            </td> 
                                        </tr> 
                                    </table> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <!-- BODY --> 
            <tr> 
                <td class="bodytable"
                    <table border="0" cellpadding="0" cellspacing="0"
                        <tr> 
                            <td id="leftColumn"
                                <div class="rightmain"
                                </div> 
                                <!-- Menu condiviso--> 
                                 
                            </td> 
                            <td> 
                                &nbsp; 
                            </td> 
                            <td id="centercolumn"
                                <div class="centermain"
<table> 
    <tr> 
        <td> 
            Field 1 
        </td> 
        <td colspan="2"
            <telerik:RadTextBox ID="RadTextBoxId1" runat="server" EmptyMessage="Text 1" 
                Width="280px" Enabled="False" > 
            </telerik:RadTextBox> 
             
        </td> 
    </tr> 
    <tr> 
        <td> 
            Field 2 
        </td> 
        <td colspan="2"
            <telerik:RadTextBox ID="RadTextBoxId2" runat="server" EmptyMessage="Text 2" 
                Width="280px" Enabled="False"
            </telerik:RadTextBox> 
        </td> 
    </tr> 
    <tr> 
        <td  > 
            Field 3 
        </td> 
        <td colspan="2"
            <telerik:RadTextBox ID="RadTextBoxId3" runat="server" EmptyMessage="Text 3" 
                Width="280px" Enabled="False"
            </telerik:RadTextBox> 
        </td> 
    </tr> 
    <tr> 
        <td style="width:280px;" > 
            Date (*) 
        </td> 
        <td colspan="2"
            <telerik:RadDatePicker ID="RadDatePickerDataInserimento" runat="server" Calendar-CultureInfo="Italian (Italy)" 
                    Calendar-RangeMaxDate="06/06/2079 00:00:00" Calendar-RangeMinDate="01/01/1900 00:00:00" 
                    MaxDate="06/06/2079 00:00:00" MinDate="01/01/1900 00:00:00" Width="280px" > 
                    <DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" MaxDate="06/06/2079 00:00:00" MinDate="01/01/1900 00:00:00" /> 
                </telerik:RadDatePicker> 
            <asp:CustomValidator ID="CustomValidatorDataInserimento" runat="server" 
                    ValidationGroup="ButtonConferma" ErrorMessage="Error" 
                    OnServerValidate="CustomValidatorDatInserimento_ServerValidate"
                </asp:CustomValidator> 
        </td> 
    </tr> 
    
       <tr> 
        <td   /> 
        <td colspan="2"
            <asp:Button ID="ButtonConferma" runat="server" Text="Click" OnClick="ButtonConferma_Click" CausesValidation="true" ValidationGroup="ButtonConferma" /> 
        </td> 
    </tr> 
</table> 
                                </div> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <!-- footer --> 
            <tr> 
                <td> 
                    <div> 
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="footertable"
                            <tr> 
                                <td class="footertable"
                                    &nbsp 
                                </td> 
                            </tr> 
                            <tr> 
                                <td> 
                                    <hr /> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td class="footertable"
                                    <strong>Footer</strong> 
                                </td> 
                            </tr> 
                        </table> 
                    </div> 
                </td> 
            </tr> 
        </table> 
        </form> 
    </center> 
</body> 
</html> 
 
using System; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
namespace WebApplication1 
    public partial class Default2 : Page 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
        } 
 
        protected void ButtonConferma_Click(object sender, EventArgs e) 
        { 
        } 
 
        protected void CustomValidatorDatInserimento_ServerValidate(object source, ServerValidateEventArgs args) 
        { 
            args.IsValid = false
        } 
    } 

Any ideas?
Alessio
Top achievements
Rank 1
 answered on 18 Feb 2010
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?