Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
192 views
Hey,

I have a RadSplitter with RadPanes, RadSplitBars, ...
Is it possible to set scroll position of a RadSlidingPane when I'm scrolling an another RadPane?

For exemple, when I click a node in the first RadPane : the same node is clicked in the RadSlidingPane.
When I expand a node in the first RadPane...

But I'd like to have the same rendering when I scroll the first pane and I can't move the content of the RadSlidingPane.

I hope you understand me

Thanks

    Michel
Michel
Top achievements
Rank 1
 answered on 19 Jan 2012
1 answer
162 views
I have a scenario where clicking on a control asynchronously loads other control. I have refereed the thread mentioned in "http://www.telerik.com/community/forums/aspnet-ajax/ajax/radajax-manager-does-not-load-js-files-in-dynamically-loaded-user-control.aspx". Used the application website5 provided in the link. If i add an update panel in the provided sample then the JavaScript is not getting loaded.

Code: Default.aspx
 <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ 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>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server" enableviewstate="false">
    <div>
        <telerik:RadScriptManager runat="server" ID="ScriptManager1">
        </telerik:RadScriptManager>
        <telerik:RadSplitter ID="RadSplitter1" runat="server" Height="100%" Width="100%">
            <telerik:RadPane ID="LeftPane" runat="server" Width="300px" Scrolling="None" MinWidth="200"
                Height="100%">
                <asp:Button runat="server" ID="Button1" Text="Load Control 1" OnClick="Button1_Click" />
            </telerik:RadPane>
            <telerik:RadSplitBar ID="RadSplitBar2" runat="server" CollapseMode="Forward" />
            <telerik:RadPane ID="MainPane" runat="server" Scrolling="None">
                <telerik:RadSplitter runat="server" Orientation="Horizontal">
                    <telerik:RadPane ID="RadPane2" runat="server" Height="15%" MaxHeight="300">
                        <div class="qsfexHeader">
                            Search Pane
                        </div>
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="RadSplitBar1" runat="server" CollapseMode="Forward" />
                    <telerik:RadPane ID="RadPane1" runat="server" Scrolling="None">
                        <telerik:RadSplitter ID="RadSplitter3" runat="server" Orientation="Vertical" CssClass="SplitterResultsReading"
                            Width="100%">
                            <telerik:RadPane ID="RadPane3" runat="server" MinWidth="300" Scrolling="None">
                                <asp:UpdatePanel ID="UpdatePanel1" UpdateMode="Conditional" runat="server">
                                    <ContentTemplate>
                                        <telerik:RadSplitter ID="RadSplitter4" runat="server" Orientation="Horizontal">
                                            <telerik:RadPane runat="server" ID="ResultViewPane" Scrolling="None">
                                                <asp:PlaceHolder runat="server" ID="PlaceHolder1"></asp:PlaceHolder>
                                            </telerik:RadPane>
                                        </telerik:RadSplitter>
                                    </ContentTemplate>
                                    <Triggers>
                                        <asp:AsyncPostBackTrigger ControlID="Button1" />
                                    </Triggers>
                                </asp:UpdatePanel>
                            </telerik:RadPane>
                            <telerik:RadSplitBar ID="RadSplitBar4" runat="server" CollapseMode="Backward" />
                            <telerik:RadPane ID="RadPane4" runat="server" Scrolling="Both" MinWidth="300">
                                <asp:Button runat="server" ID="Button2" Text="Load Control 2" OnClick="Button2_Click" />
                            </telerik:RadPane>
                        </telerik:RadSplitter>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
        </telerik:RadSplitter>
    </div>
    </form>
</body>
</html>
Default.aspx.cs

using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (IsPostBack && ViewState["LastLoadedControl"] != null)
        {
            string controlName = (string) ViewState["LastLoadedControl"];
            Control control = PlaceHolder1.FindControl(controlName);
            if (control != null)
            {
                PlaceHolder1.Controls.Remove(control);
            }

            control = LoadControl(string.Format("~/{0}.ascx", controlName));
            control.ID = controlName;
            PlaceHolder1.Controls.Add(control);
        }
    }

   

    protected void Button1_Click(object sender, EventArgs e)
    {
        Load();
     //   ViewState["LastLoadedControl"] = "WebUserControl";
    }

    private void Load()
    {
        Control control = LoadControl("~/WebUserControl.ascx");
        control.ID = "WebUserControl";
        PlaceHolder1.Controls.Clear();
        PlaceHolder1.Controls.Add(control);
    }

    protected void Button2_Click(object sender, EventArgs e)
    {
        Control control = LoadControl("~/WebUserControl.ascx");
        control.ID = "WebUserControl";
        PlaceHolder1.Controls.Clear();
        PlaceHolder1.Controls.Add(control);
    }

}

Webusercontrol.ascx

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<telerik:RadScriptBlock runat="server" ID="RadScriptBlock1">
    <script type="text/javascript">
        function pageLoad() {
            alert('Hello from user control <%=ID %>');
        }

        function sayHello()
        {
            alert('Hello again!');
            alert("<%=Button1.ClientID %>");
        }

        function Sample(sender, args) {

            alert("grid created");
        }
               
    </script>    

</telerik:RadScriptBlock>

<asp:Label runat="server" ID="Label1"/>
<asp:Button runat="server" ID="Button1" OnClientClick="sayHello()" Text="Click ME"/>
<telerik:RadGrid ID="RadGrid1" runat="server"  AutoGenerateColumns="true">
 <ClientSettings EnableAlternatingItems="false" EnableRowHoverStyle="True">
                <ClientEvents OnGridCreated="Sample" />
                </ClientSettings>
</telerik:RadGrid>
<div id="panel">
</div>

On clicking of button 1 i am getting JavaScript error "Sample is undefined" .

Jayesh Goyani
Top achievements
Rank 2
 answered on 19 Jan 2012
2 answers
520 views
Hi,
 I have a radgrid with some image column and other data columns with following configuration.
  static headers, column resizing and clip cell content on resize.

I have set image columns width in code behind in pixels and resizable=false. But when I resize other data columns image column also resizes. I don't want them to get resized. 
 
regards,
Mahesh
Rashmi
Top achievements
Rank 1
 answered on 19 Jan 2012
6 answers
166 views
I have a simple search page that contains a a RadComboBox and some text boxes.  When the user submits the form it displays results on a new page for the user.  When the user hits the browser's back button in IE, the user values in the text boxes and combo box are selected.  When I try the same thing in Firefox or Chrome, only the contents of the text boxes are displayed and the combo box reverts to its original value.

I have tried with versions 2008.1.619.20, 2009.1.527.20 and 2010.3.1317.20, but get the same results.

Any thoughts?  Is this the expected result for Firefox and Chrome?

Thanks!

Hans Gunnar
Top achievements
Rank 1
 answered on 19 Jan 2012
1 answer
143 views
Hi,

I want to calculate total of Quantity column (In Edit Mode) using javascript when I am using group by functionality in Rad Grid. I can do Grand total using javascript but not able to do group by total using javascript as I don't know how to check which group is being edited.

For grand total I am passing Footer value in Java script and deducting it from current value.

Thanks,
Mona

Tsvetina
Telerik team
 answered on 19 Jan 2012
3 answers
206 views
Hi,

I have two questions on the drop down menu. First one should be easier, do you have an EnableAutoScroll as in the RadMenu? I have a drop down that can go beyond the window limits and it would be very useful to have the scroll as there is in the menu.

The second one is a bit more complicated. My drop down is constructed on the client side, and it is based on adding items. However, I noticed that whenever I add first a short text item then a long text item, the long text gets wrapped into two lines or cutoff if I use nowrap. Is there a way to adjust the width of the drop down menu to fit all item texts?

Thanks,
Eduardo
Peter
Telerik team
 answered on 19 Jan 2012
5 answers
764 views
I am building a DataTable dynamically at run time and I am also using templates in the Cells that again are dynamically loaded.
The template is currently extremely simple in that it consists solely a CheckBos and a HiddenField like so:
<asp:CheckBox ID="cb" runat="server" /> <asp:HiddenField ID="hf" runat="server" />

I trap the ItemDataBound Event of the Grid and have code similar to that below:
if (e.Item is GridDataItem)
{
    GridDataItem item = (GridDataItem)e.Item;
    DataRowView drv = (DataRowView)item.DataItem;
    for (int i = 0; i < rgTags.MasterTableView.Columns.Count; i++ )
    {
        string uniqueName = rgTags.MasterTableView.Columns[i].UniqueName;
        if (drv[i] is System.DBNull)
        {
            item[uniqueName].Controls[0].FindControl("cb").Visible = false;
        }
        else
        {
            AdminTag tag = (AdminTag)drv[i];
            ((CheckBox)item[uniqueName].Controls[0].FindControl("cb")).Text = tag.sText;
            ((HiddenField)item[uniqueName].Controls[0].FindControl("hf")).Value = tag.nTagId.ToString();
        }
    }
}

My question is why do I have to have the Controls[0]. before the FindControl() calls? I don't like hard coding things like that and would prefer a more elegant way to find the control in the template.

It is wo0rking now, but it's inelegant and it took me a long time to figure it out and I am sure it will get broken b y a future release.

Martin
Tsvetina
Telerik team
 answered on 19 Jan 2012
1 answer
39 views
The RadMenu control has the Target Property, How do I set this property when binding the menu to a SiteMapDataSource?
Peter
Telerik team
 answered on 19 Jan 2012
4 answers
400 views
Hi All,

i am using a RadMenu on my page and i am handling its click event from server side...

when i click on of the item i open another page in rad window ...

all is ok and the window is opened successfully.... i do what i need there and close it...

BUT

i noticed when i refresh the page that holds the radmenu, the click event is called again and the RadWindow is opened again!!!

how can i avoid this from happening!!!

Best Regards
Asa'ad
Kate
Telerik team
 answered on 19 Jan 2012
1 answer
69 views
Is there a way to limit client-side row selection to one row per grouping in a radgrid without causing a postback every time?

I used an old example (see below), but each click of a checkbox causes a postback which is disruptive to the process. I wasn't sure if there was some built in functionality or an easy way to check at the end if too many were selected.

Thank you..

<radG:GridTemplateColumn UniqueName="CheckBoxColumn">
 <ItemTemplate>
   <asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="true" OnCheckedChanged="CheckedChanged" />
 </ItemTemplate>
</radG:GridTemplateColumn>

public void CheckedChanged(object sender, EventArgs e)
    {
        GridDataItem checkedItem = (GridDataItem)(sender as CheckBox).NamingContainer;
        string checkedItemIndex = checkedItem.GroupIndex.Substring(checkedItem.GroupIndex.LastIndexOf('_'), 2);
 
        foreach (GridDataItem item in checkedItem.OwnerTableView.Items)
        {
            string currItemIndex = item.GroupIndex.Substring(item.GroupIndex.LastIndexOf('_'), 2);
 
            if (checkedItem.GroupIndex.StartsWith(item.GroupIndex.Substring(0,1)) && currItemIndex != checkedItemIndex)
            {               
                (item.FindControl("CheckBox1") as CheckBox).Checked = false;
            }
        }
    }
Tsvetina
Telerik team
 answered on 19 Jan 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?