Telerik Forums
UI for ASP.NET AJAX Forum
6 answers
81 views
I am new to the telerik controls. I have looked at a bunch of examples but I cannot seem to get my panel bar to work. It just expands everything for both items and won't collapse. I'm sure it's something simple I just don't know what. Here is my aspx page.
<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="ClickableCommunity.master.vb"
    Inherits="ClickableCommunity.ClickableCommunity" %>

<%@ 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></title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager2" runat="server">
    </telerik:RadScriptManager>
    <div>
        <telerik:RadPanelBar ID="RadPanelBar1" runat="server" Skin="Web20" ExpandMode="SingleExpandedItem">
            <Items>
                <telerik:RadPanelItem Text="test 1" Expanded="True">
                    <ItemTemplate>
                        test<br />
                        test<br />
                    </ItemTemplate>
                </telerik:RadPanelItem>
            </Items>
            <Items>
                <telerik:RadPanelItem Text="Test 2">
                    <ItemTemplate>
                        test<br />
                        test<br />
                    </ItemTemplate>
                </telerik:RadPanelItem>
            </Items>
            <ExpandAnimation Type="InBounce" />
            <CollapseAnimation Type="InExpo" />
        </telerik:RadPanelBar>
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
        </asp:ContentPlaceHolder>
    </div>
    </form>
</body>
</html>

Web Services
Top achievements
Rank 2
 answered on 31 Jul 2009
2 answers
268 views
How to use 

 

foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items)

{


}

to get bound data value.  if I have 2 columns of bound items, one it regular bound item - item1, the other is build in drop down item -item2(NOT template item). I need to get grid cell value in view mode, NOT edit mode.

or there are some other ways to loop the whole grid to get the bound data value?

Thanks,
Jessie

 

Jessie
Top achievements
Rank 1
 answered on 31 Jul 2009
1 answer
241 views
I need a grid that will display formatted text and hyperlinks. There are no issues getting the grid to populate on the server, but I'm having an issue getting client side databinding to work properly. There doesn't seem to be any problem with using a GridBoundColumn, that one gets updated as expected, but other column types I've tried (GridTemplateColumn and GridHyperLinkColumn) don't produce any results.

Here is the script that takes a json array of objects and updates the grid.
The json is something like [{JobCode:"Code1",JobDesc:"Desc1",Primary:1},{JobCode:"Code2",JobDesc:"Desc2",Primary:0}]
<script> 
        function updateGrid(strJSON) { 
            var tableView = $find("grid1").get_masterTableView(); 
            // create the data source 
            var jsonObj = eval("(" + strJSON + ")"); 
            tableView.set_dataSource(jsonObj.RowData); 
            tableView.dataBind(); 
            tableView.get_owner().repaint(); 
        } 
</script> 


Here is the grid template.
                    <telerik:RadGrid ID="grid1" CssClass="grid" Skin="Office2007"  
                        AutoGenerateColumns="False" runat="server">  
                        <MasterTableView CellSpacing="-1">  
                            <NoRecordsTemplate>  
                                <div>  
                                    There are no records to display</div>  
                            </NoRecordsTemplate>  
                            <Columns>  
                                <telerik:GridBoundColumn DataField="JobCode" HeaderText="Job Code">  
                                </telerik:GridBoundColumn>  
                                <telerik:GridBoundColumn DataField="JobDesc" HeaderText="Job Desc">  
                                </telerik:GridBoundColumn>  
                                <telerik:GridTemplateColumn UniqueName="Primary" HeaderText="Primary">  
                                    <ItemTemplate>  
                                        <%#(DataBinder.Eval(Container.DataItem,"Primary").ToString()=="1")?"Y":"N"%>  
                                    </ItemTemplate>  
                                </telerik:GridTemplateColumn>  
                            </Columns>  
                            <AlternatingItemStyle CssClass="altRow" />  
                            <ItemStyle CssClass="row"></ItemStyle>  
                        </MasterTableView>  
                    </telerik:RadGrid>  

This all works well unless I use a column other than the GridBoundColumn.

I've looked in the RadGridScripts.js file to try and figure this thing out.
For the GridTemplateColumn, it tries to fill in the grid using the _fillTemplateEditorsData function. This function is expecting to find some control or element in which to put the contents of the data. There are two searches performed:
var _301 = $telerik.findControl((cell != null) ? cell: row, _300);
and
var _304 = $telerik.findElement((cell != null) ? cell: row, _300);

In both cases, they return nothing, so the function just returns without having updated the cell contents with text.

I would really like to be able to control the grid on the client pc. Can somebody let me know what, if anything, I'm doing wrong and how I can manipulate the grid on the client using columns other than the GridBoundColumn.

I should mention that I'm using  version 2009.1.311.35

Thank you





Sebastian
Telerik team
 answered on 31 Jul 2009
2 answers
212 views
I have been developing a control, using Radgrid, which will get its list of columns and mappings from a database. We had previously done this using the Radgrid control, wrapped in a composite control, but there were several complications, the work arounds for which turned the control into a rather daunting piece of code. We also had many difficulties in getting the filtering to work properly with the dynamic databinding and the dynamic fields. The result of all this was a difficult to maintain code base, with no ability to do filtering (weren't using Linq at that time).

Since then, I have rewritten the control, removing much of the logic which was extraneous to the function of the grid, and made it to use databinding through Linq to an IEnumerable object. I had alot of success inheriting from Radgrid (which I know you don't officially support) and have followed the recommendations I could find as best I could. There's really only one issue now that I am having difficulty getting past, and I'm not really sure where to look.

When there is a postback from either the built in Radgrid sort or Paging, the very first record in the result gets duplicated when it is rendered. The dataset it is bound to has 100 records, yet it renders 101 records, with two occurances of the first record on the first page. If I do a postback using either of the other controls built in (like a custom checkbox column), then the first record is not duplicated. The same is true on consecutive searches, no duplicate record.

I was wondering if you had a hint as to where I can look to see the process of binding the datasource to the grid, or perhaps you have an idea as to what is differrent on a sort or paging event, as opposed to a CheckChanged event. The only thing I can see is that I am calling the Rebind method on the CheckChanged event (which is bubbled to the enclosing user control) and for the Radgrid Paging and Sorting postbacks it is calling CreateTableView and NeedDataSource. On CreateTableView, I am building a GridTableView object based on the configured columns in the database and returning this, and on the NeedDataSource I am pulling the datasource from the session (and have verified this contains only 100 records).

Any ideas would be appreciated.
Thanks,
Tyson Brown
Rosen
Telerik team
 answered on 31 Jul 2009
1 answer
83 views
I have a license for Telerik Asp.net Ajax UI controls. And when I downloaded the Telerik controls, I cannot see the folder for skins on my hard drive. I want to customize the skins for the Radgrid. Where can I get the .css files for the built-in  skins for radgrid controls.
Thanks
Anil Makhija  
Sebastian
Telerik team
 answered on 31 Jul 2009
1 answer
127 views
1) The Office 2007 skin is being applied to our application via the web.config, but the MultiColumn comboBox we are creating does not seem to inherit the look and feel that the rest of the controls get (We are using an item template). How do we fix that?
2) How do you apply a Selected Value column to the MultiColumn example? We are using the item template, and have specified the DataValueField and DataTextField names in the declaration, is that all there is to it?
I am guessing that we don't use the id which we want to use for the selected value in the item template, and it will bind but be invisible to the user?
Peter
Telerik team
 answered on 31 Jul 2009
3 answers
129 views
Folks,

Here is the Scenario.

I have a Master Page (Main.Master) and 2 Content Pages(Default & Default1.aspx). Master Page page has Company Header Logo and Other controls that are common to both .aspx Pages.. When I add both .aspx pages in the Project, I indicated Main.Master is their Master Page.

I have  Link Buttons controls in Both Pages for Navigation Purposes. For Default.aspx Link1 Button On Click Event, Resonse.redirect("Default1.aspx") and Vice Versa.

My question is there any sample site or example in Radcontrols for Asp.Net Ajax to accomplish the Task? That will be appreciated.. I looked at Live Demos/Menu/Examples/Functionality/Templates/DefaultVB.aspx, tried to implement in Master Page. But the problem is that If I click the content pages Navigation Buttons, I loose my Master Page header contents (TEMPLATES logo in this example). I do not want to loose the header content of my Master Page, I want to retain them as I navigate between content pages.   In the Past, I did this type of Job via SiteMapDataSource but I would like to implement from Telerik Rad Menu if possible..I am using RadControls for ASP.NET AJAX Q2 2009. Also any Telerik Tutorial will be Helpful.

Thanks

Ghulam
gc_0620
Top achievements
Rank 1
 answered on 31 Jul 2009
3 answers
82 views
Hello,

We are using Q2 2009 and are noticing that our grid filter boxes do not display correctly in FireFox and the filter condition buttons sometimes do not display either.
Thanks,
Larry
Pavlina
Telerik team
 answered on 31 Jul 2009
1 answer
118 views

Hi,

I am using master and content page in my application.
master page controls are radscriptmanager,radajaxmanger,
content page controls are radajaxproxymanager,radwindowmanager, radtabstrip and rad multipageview.

Windowmanager settings are
<telerik:RadWindowManager ID="rWindowManager" runat="server"

 

 

 

ClientCallBackFunction="CallBackData"

 

 

Left="" Skin="Vista" Top="" Behavior="Reload,Close" InitialBehavior="None" >

 

 

 

<Windows>

 

 

 

<telerik:RadWindow ID="rWindowUsersList" runat="server" Height="270px" Left="50px"

 

 

 

Modal="True" NavigateUrl="" ReloadOnShow="True" Title="Users List" Top="50px"

 

 

 

VisibleStatusbar="False" Width="280px"

 

OnClientClose

 

="DateWindowCancelClicked"

 

 

 

 

 

 />

 

 

 

</Windows>
</telerik:RadWindowManager>

When i open the radwindow on button click first time its work fine.
when i use javascript  to do postback by using following method.

 

 

var ajaxManagerMaster = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");

 

ajaxManagerMaster.ajaxRequest();

 

But when  second time i open the window it is not opening with the proper size which are specified in radwindow.
It is also not calling the OnClientClose function specified in radwindow manager.

How can sovle this issue?

Thanks

Fiko
Telerik team
 answered on 31 Jul 2009
0 answers
136 views
I have 2 RadTreeView inside a user control.  I am also using master pages.  When I run the web page the includes the user control.  The RadTreeViews inside the controls can not be found.  Below is my code.  Any help would be greatly appreciated.

        private void ParentDataSource(DataSet data, string nodeTextField, string nodeValueField, bool allowAddNew)
        {            
            **************** Object reference not set to an instance of an object. *************************************************
            rtvHierarchy.Nodes[0].AllowDrop = false;     *********************** I get the error here **********
        }




<%

@ Control Language="C#" AutoEventWireup="true" CodeBehind="Hierarchy.ascx.cs" Inherits="KMSF.Library.Telerik.Custom.Hierarchy" %>

 


 

    <telerik:RadAjaxPanel ID="rpnlPanel" runat="server" Width="100%">   
   
    <table border="1">
        <tr>
            <td>
                <telerik:RadTreeView ID="rtvHierarchy" runat="server" OnNodeExpand="rtvHierarchy_NodeExpand"
                    OnContextMenuItemClick="rtvHierarchy_ContextMenuItemClick"
                    OnNodeEdit="rtvHierarchy_NodeEdit" OnNodeDrop="rtvHierarchy_NodeDrop" 
                    Height="500px" Skin="WebBlue">
                    <ContextMenus>
                        <telerik:RadTreeViewContextMenu ID="ContextMenu1" runat="server">
                            <Items>
                                <telerik:RadMenuItem Value="Create" Text="Add New">
                                </telerik:RadMenuItem>
                            </Items>
                        </telerik:RadTreeViewContextMenu>
                    </ContextMenus>
                    <Nodes>
                        <telerik:RadTreeNode runat="server" ContextMenuID="ContextMenu1" Text="Root" Expanded="true">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeView>
            </td>
            <td>
                <telerik:RadTreeView ID="rtvAvailable" runat="server" EnableDragAndDrop="true"
                    OnContextMenuItemClick="rtvAvailable_ContextMenuItemClick"
                    OnNodeEdit="rtvAvailable_NodeEdit" OnNodeDrop="rtvAvailable_NodeDrop"
                    Height="500px" BorderStyle="None" Skin="WebBlue">
                    <ContextMenus>
                        <telerik:RadTreeViewContextMenu ID="ContextMenu2" runat="server">
                            <Items>
                                <telerik:RadMenuItem Value="Create" Text="Add New">
                                </telerik:RadMenuItem>
                            </Items>
                        </telerik:RadTreeViewContextMenu>
                    </ContextMenus>
                    <Nodes>
                        <telerik:RadTreeNode runat="server" ContextMenuID="ContextMenu2" Text="Root" Expanded="true">
                        </telerik:RadTreeNode>
                    </Nodes>
                </telerik:RadTreeView>
            </td>
        </tr>
    </table>
   
    </telerik:RadAjaxPanel>



 

<%@ Page Language="C#" MasterPageFile="~/WorkQueue.Master" AutoEventWireup="true"
CodeBehind="ManageDeptDivHierarchy.aspx.cs" Inherits="KMSF.WorkQueue.UI.Web.MasterFiles.ManageDeptDivHierarchy" Title="Department Division Hierarchy Management" %>

<%@ MasterType VirtualPath="~/WorkQueue.Master" %>
<%@ Register Assembly="KMSF.Library.Telerik.Custom" Namespace="KMSF.Library.Telerik.Custom" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="Hierarchy1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Hierarchy1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnSave">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Hierarchy1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <table>
        <tr>
            <td>
            <asp:Button ID="btnSave" runat="server" Text="Save Changes" onclick="btnSave_Click"/><br />
            <cc1:Hierarchy ID="Hierarchy1" runat="server" ParentTreeViewTitle="Departments"
        ChildTreeViewTitle="Divisions" Height="200px" Width="150px" />
            </td>
        </tr>
    </table>
   
</asp:Content>

Robert
Top achievements
Rank 1
 asked on 31 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?