Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
66 views
HI,

I'm building a composite control in Asp.net and having a problem with the RadEditor not returning values on form post. I'm using an updatepanel in which I have various RadComboBoxes, RadTextBoxes and a RadEditor, upon submission of the form the ComboBox and Textbox values are returned fine however the RadEditor returns an empty string. Is there any way to fix this, in IE8 it works fine, the problem is confined to Firefox.

Regards
Rumen
Telerik team
 answered on 18 Feb 2010
2 answers
333 views
Hi, how can I use RadContextMenu for RadPanelBar, please give me an example :)
VnDevil
Top achievements
Rank 2
 answered on 18 Feb 2010
3 answers
109 views

Hi,
I am using Treeview control to create Folder and file structure functionality. I have added context Menu to show New Folder option while right clicking on the Node item. I want to disable the New Folder for the file level. 
case "NewFolder":

 

 

if (treeNode.get_parent() == treeNode.get_treeView())

 

{

menuItem.set_enabled(

true);

 

}

 

else

 

 

 

{

 

menuItem.set_enabled(

true);

 

}

 

break;

Thanks,
Krantikumar Jain

 

Veronica
Telerik team
 answered on 18 Feb 2010
1 answer
184 views
Hello, I have a custom ITemplate class that I am using to format the output of nodes in a RadTreeView.  In the template, I have several asp:Button objects.  I want to wire up the Click events of each, and handle them on the page with AJAX calls to server-side methods.  I have added event handlers for each button to the ITemplate object but as far as I can tell they never fire.  When I click the buttons on the page I get an error message that tells me that ViewState has failed to load, but nothing else happens.  Do I need to do anything special to the page in order to handle the events?

.aspx page markup

<telerik:RadAjaxManager ID="radAjaxManager" runat="server"> 
    <AjaxSettings> 
        <telerik:AjaxSetting AjaxControlID="radOrgNodeTree"> 
            <UpdatedControls> 
                <telerik:AjaxUpdatedControl ControlID="radOrgNodeTree" /> 
            </UpdatedControls> 
        </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 
<telerik:RadTreeView ID="radOrgNodeTree" runat="server" 
    AllowNodeEditing="false" 
    OnClientLoad="tree.load" 
    OnClientNodeClicking="tree.nodeClicking" 
    OnClientNodeClicked="tree.nodeClicked" 
    OnClientContextMenuShowing="tree.contextMenuShowing" 
    OnClientMouseOver="tree.mouseOver" 
    OnClientContextMenuItemClicked="tree.contextMenuItemClicked" 
    > 
    <ContextMenus> 
        <telerik:RadTreeViewContextMenu  
            ID="orgNodeContextMenu"  
            runat="server"  
            ClickToOpen="true"  
            Skin="Vista"> 
            <Items> 
                <telerik:RadMenuItem Text="Add New..." Value="add" /> 
                <telerik:RadMenuItem Text="Edit" Value="edit" /> 
                <telerik:RadMenuItem Text="Delete" Value="delete" /> 
                <telerik:RadMenuItem Text="Collapse All" Value="collapse" /> 
            </Items> 
        </telerik:RadTreeViewContextMenu> 
    </ContextMenus> 
</telerik:RadTreeView> 

code behind
        protected void Page_Load(object sender, EventArgs e) { 
 
            if(!IsPostBack) { 
 
                TreeNodeTemplate treeNodeTemplate = new TreeNodeTemplate(); 
                treeNodeTemplate.Command += treeNodeTemplate_Command; 
                radOrgNodeTree.NodeTemplate = treeNodeTemplate; 
                //set data source 
            } 
 
            radOrgNodeTree.DataBind(); 
        } 
 
        private void treeNodeTemplate_Command(object sender, CommandEventArgs e) { 
            //... 
        }

template class

private class TreeNodeTemplate : ITemplate { 
 
        public event CommandEventHandler Command; 
 
        private void OnCommand(CommandEventArgs e) { 
 
            if (Command != null) { 
                Command(this, e); 
            } 
        } 
 
        public void InstantiateIn(Control container) { 
            //... 
 
            Button saveButton = new Button(); 
            //set properties 
            saveButton.Command += saveButton_Command; 
            //data binding event handler 
            //add to controls collection 
 
            //... 
        } 
 
        private void saveButton_Command(object sender, CommandEventArgs e) { 
            OnCommand(e); 
        } 
    } 





Peter
Telerik team
 answered on 18 Feb 2010
3 answers
132 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
229 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
56 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
151 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
113 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
121 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?