Telerik Forums
UI for ASP.NET AJAX Forum
11 answers
323 views
Recently, Telerik annonced that its TreeView can bind to any custom collection object implementing IEnumerable.
I am afraid this does not work properly (i.e. all nodes ar displayed as roots)
Below is my object that I tested againest your control
Kindly, investigate and advise if the problem source is my code or your component?

public

class MyObject

{

private int id; private int pId; private string name;

public MyObject(int id, int pId, string name)

{

this.id = id; this.pId = pId; this.name = name;}

public int ID { get { return id; } set { id=value;} }

public int PId { get { return pId; } set { pId=value; } }

public string Name { get { return name; } set { name = value; } }

}

/////////////////////////////////////////// Collection

public

class MyObjectCollection : IEnumerable, IEnumerator

{

private List<MyObject> obCollection = new List<MyObject>();

int position = -1;

public MyObjectCollection()

{

}

public MyObjectCollection(List<MyObject> list)

{

obCollection = list;

}

public IEnumerator GetEnumerator()

{

return new MyObjectCollection(obCollection);

}

public MyObject this[int indexer]

{

get { return obCollection[indexer]; }

set { obCollection[indexer] = value; }

}

public bool MoveNext()

{

position++;

return (position < obCollection.Count);

}

public void Reset()

{

position = -1;

}

public object Current

{

get

{

try

{

return obCollection[position];}

catch (IndexOutOfRangeException)

{

throw new InvalidOperationException();}

}

}

public MyObjectCollection GetObjects()

{

return new MyObjectCollection(obCollection);}

}

Phil C
Top achievements
Rank 2
 answered on 02 Dec 2008
1 answer
174 views

Hi,

I have a scenario about opening a Ajax modal window on a menu item click,Is it possible to open a Ajax modal window annd grey out the parent page and and show focus on modal window using RadMenu.

Normally we do have a aspx page with a button or link button to open a Ajax Model window which is a usercontrol.

Suggest me any ideas.

Thanks

hk

Yana
Telerik team
 answered on 02 Dec 2008
1 answer
308 views
Hi,
It was suggested to be by Vlad that I should be able to throw an alert from the server side with the following code:
    RadAjaxManager.GetCurrent(Page).ResponseScripts.Add("radalert('your text')")

When I tried it, I got this error message.
      Microsoft JScript runtime error: 'undefined' is null or not an object

It was in the telerik.web.ui javascript on line 11869, basically, GetRadWindowManager returned 'undefined'

window.radalert=

function(_1,_2,_3,_4){

 

var

_5=GetRadWindowManager();

 

var

_6=_5._getStandardPopup("alert",_1);

Any help would be great.
BTW, I have both a window manager and a ajaxmanager on the page.
Thanks ... Ed

 




Georgi Tunev
Telerik team
 answered on 02 Dec 2008
1 answer
105 views
Hi

I am wanting to show the context menu I get when I right click, when I also hit enter on a selected row. I have captured the ENTER keypress, but can't fire off the context menu.

I was trying:

function RadGrid1_OnKeyPress(sender, eventArgs)
{
     switch(eventArgs.get_keyCode()) 
     { 
          case 13: 

               var ctmProducts = $find('<%=ctmProducts.ClientID %>'); 
               ctmProducts.show(eventArgs); 

               eventArgs.set_cancel(true); 
               break; 
     }
}               

 

 


Any pointers / thoughts welcome

Cheers

Simon

 

 

Daniel
Telerik team
 answered on 02 Dec 2008
3 answers
173 views
I have a page that works fine in Firefox, but does some strange stuff in Explorer.  I'm using 2008 Q2 version.

The original page had a single normally-functioning RadGrid, wrapped in a PageView and Multipage controls; there's a menu bar at the top of the page, outside of the PageView.   The menu bar is loaded as a custom control in a panel at runtime, since the application has customized uses for application-specific forms, and general forms for all of the uses.

With that all in mind, it's been working great this way.  Until I added two more RadGrids to the page that serve as multi-column listboxes, to go along with several label/textbox pairs of other data.  The headers are disabled, sorting/paging/grouping is all disabled.  Client side scrolling is enabled, and the containing DIV's style sets the height and width of the grid  The two smaller RadGrids are used as two-way pickers for details of the items in the main RadGrid.

Under firefox this is working great, but under IE7, not so great.  Upon entering the form, the "listbox" RadGrids are unpopulated, and everything looks fine.  Once I select a row in the main grid, the codebehind pulls in the relevant data into a collection and binds it to the controls.   In firefox, the controls are loaded and look & work fine.  Under IE7, the controls flash on the screen, then disappear, with the main grid shrinking to  just a couple hundred pixels wide, and even the three-item menu squishes into two lines.    If I hover the mouse pointer over the menu, everything jumps back to correct ordering and spacing, and the two-way listbox actions work correctly even.

If I then select a different row in the main grid, the page blanks out completely.   Using debug bar, I am able to examine the DOM and it appears that everything is there, but nothing is visible on the client area except the background color, not even the menu.

This looks somewhat like the RadSplitter problem reported recently with 2008 Q3, except I have no splitters on my form.

Any ideas?
Dimo
Telerik team
 answered on 02 Dec 2008
1 answer
139 views
Hi All,

I am using RadTabstrip,Radgrid,RadScheduler.

For ex .
Tab1 -contain
RadGrid
Tab2 -contain
RadGrid
Tab3 -contain
RadScheduler

Default page accept one parameter in query string.
Process to follow to occure problem are.
1)Run the page it open without passing parameter to it.(frmDefault.aspx)
2)Then  pass the parameter in query string  and  press refresh button of browser.(frmDefault.aspx?user=ABC)
3)Then go to Tab2 and Tab3.
4)Then click the Forward and Back button of browser 2-3 times.
5)Then  click on Tab3 .(radScheduler Tab)

It gives me javascript runtime error as
'Microsoft JScript runtime error: 'Telerik.Web.UI.RadScheduler' is null or not an object'

How can i solve this problem ?

Thanks

Peter
Telerik team
 answered on 02 Dec 2008
3 answers
90 views

I have a grid which has AllowAutomaticUpdates=true. The grid have a telerik:GridDropDownColumn for edit record and a GridBoundColumn to show data. When click Edit, the GridBoundColumn is hidden and the GridDropDownColumn is shown. I like to hide the dropdownlist on the rows that are not in edit. May you give me some hints.
Thanks in advance.

Regards,
d-cpt

d-cpt
Top achievements
Rank 2
 answered on 02 Dec 2008
1 answer
69 views
Hi All,

I am using radScheduler.

I have problem in WeekView while moving the appointment.

When I move the appointment from 'All Day' section of (for ex monday) to tuesday 'All Day section.
Then it shows the appointment.

When i moving the appointment from 'All Day' section of any day(monday to saturday) to 'All Day' Section of sunday.
Appointment has not shown in 'All Day' section of Sunday.

When I click on Day View of having selected date as sunday's date.
Appointment are shown in 'All Day' Section.

I want to show the appointment in sunday's ' All Day' section.

Thanks.
Peter
Telerik team
 answered on 02 Dec 2008
1 answer
74 views

Hi,

An easy scenario I guess but I've looked through the forums etc. but cannot find how.

I have a treeview inside a combobox and I need to get the tree selectedNode.Value when it is clicked - I'll use this value server side to redirect.
I am trying to do this at the moment in the  OnSelectedIndexChanged event of the combobox but suspect this is wrong!

Kind regards,


Jon
Veselin Vasilev
Telerik team
 answered on 02 Dec 2008
1 answer
379 views
Hello, i've been having some problems with a radgrid EnablePostBackOnRowClick event, when this grid is in a web user control.
The reference to radajaxmanager is in the page that contains this webuser control.

It seems that the event only works one time, after the grid is filled, then it makes the ajax call and stops making the row selection.
And if the page changes... well it's does not work either.

Another problem.. but not critical, is that the loading panel is not showing when in an ajax call.

this is an example i've made:

here goes the code:
Main page testform.aspx:
<%@ Page Language="vb" AutoEventWireup="false" codefile="testform.aspx.vb" Inherits="testform" %> 
<%@ Register src="radgrid.ascx" tagname="radgrid" tagprefix="uc1" %> 
<%@ 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"
    <asp:ScriptManager runat="server" ID="scritpManager"></asp:ScriptManager> 
    <telerik:RadAjaxLoadingPanel   ID="LoadingPanel" runat="server" 
            Style="width: 320px; padding-top: 125px;" Height="75px" Width="75px" > 
            <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading7.gif") %>' style="border:0;" /> 
    </telerik:RadAjaxLoadingPanel> 
 
   <telerik:RadAjaxManager ID="mainAjaxManager" runat="server"  DefaultLoadingPanelID="LoadingPanel"
        <AjaxSettings  > 
            <telerik:AjaxSetting AjaxControlID="btn"
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="radgrid1"   LoadingPanelID ="LoadingPanel"/> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
            <telerik:AjaxSetting AjaxControlID="radgrid1"
               <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="radgrid1"   LoadingPanelID ="LoadingPanel"/> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
    </AjaxSettings> 
</telerik:RadAjaxManager> 
 <asp:button ID="btn" runat="server" Text="clickMe to show/PopulateGrid" value="0" OnClick="doClick"/> 
<br/> 
    <uc1:radgrid ID="radgrid1" runat="server" />
</form>
</body> 
</html> 


testform.aspx.vb
Partial Public Class testform 
    Inherits System.Web.UI.Page 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
 
    End Sub 
 
    Public Sub doCLick(ByVal sender As ObjectByVal e As System.EventArgs) 
        radgrid1.populateGrid("BTN Click"
    End Sub 
End Class 


radgrid.ascx

<%@ Control Language="vb" AutoEventWireup="false" codefile="radgrid.ascx.vb" Inherits="radgrid_test" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<script language="javascript" type="text/javascript"
function doSomething(){ 
    alert("Row_click"); 
</script> 
Grid begins here   
<telerik:RadGrid id="list"    AutoGenerateColumns="False" AllowPaging="True" 
    PageSize="12" GridLines="None" Skin="Default"  runat="server" BorderStyle="None" > 
<MasterTableView   PageSize="12" AllowSorting="false"  AllowPaging="true" GridLines="None" DataKeyNames="id"  > 
<PagerStyle  AlwaysVisible="True" Mode="NextPrevAndNumeric" PagerTextFormat="{2} to {3} of {5} records | {4}"></PagerStyle> 
        <AlternatingItemStyle BackColor="LightGray"/> 
               <Columns > 
                   <telerik:GridBoundColumn DataField="ref" HeaderText="ref" 
                    UniqueName="ref" Visible="true" > 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="desc" HeaderText="desc" 
                    UniqueName="desc" Visible="true"
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="id" Visible="true" UniqueName="id" HeaderText="ID"></telerik:GridBoundColumn> 
            </Columns> 
             
              </MasterTableView> 
              <ClientSettings EnablePostBackOnRowClick="true"  > 
               <Selecting AllowRowSelect="True"  ></Selecting
               <ClientEvents OnRowClick="doSomething"/> 
               <ClientEvents/> 
               </ClientSettings>     
    </telerik:RadGrid> 
Grid Ends here   
<br /> 
Trace Events: 
<asp:TextBox runat="server" ID="debug" TextMode="MultiLine" Rows="10" Columns="60" EnableViewState="false" ></asp:TextBox> 
 




radgrid.ascx.vb
Imports System.Data 
Partial Public Class radgrid_test 
    Inherits System.Web.UI.UserControl 
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load 
        If Not Page.IsPostBack And Not Page.IsAsync And Not Page.IsCallback Then 
            debug.Text = "" 
 
        End If 
    End Sub 
 
 
    Public Sub populateGrid(ByVal lvDebugString As String
        debug.Text &= Chr(10) & lvDebugString 
        Dim lvDataView As New DataView() 
        Dim lvDataTable As New DataTable() 
        Dim lvDataRow As DataRowView 
        lvDataTable.TableName = "testing" 
        lvDataTable.Columns.Add("ref"
        lvDataTable.Columns.Add("desc"
        lvDataTable.Columns.Add("id"
        lvDataView.Table = lvDataTable 
 
        For lvI = 1 To 40 
 
            lvDataRow = lvDataView.AddNew() 
            lvDataRow.Item("ref") = "test ref" 
            lvDataRow.Item("desc") = "test desc" 
            lvDataRow.Item("id") = lvI 
        Next 
        list.VirtualItemCount = 40 
        list.DataSource = lvDataView 
        list.DataBind() 
 
    End Sub 
 
 
    Private Sub list_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles list.ItemCommand 
        If (e.CommandName = "RowClick" AndAlso TypeOf e.Item Is Telerik.Web.UI.GridDataItem) Then 
            e.Item.Selected = True 
            debug.Text &= Chr(10) & "ItemCommand=" & e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("id"
            list.ClientSettings.EnablePostBackOnRowClick = True 
        End If 
    End Sub 
 
    Private Sub list_PageIndexChanged(ByVal source As ObjectByVal e As Telerik.Web.UI.GridPageChangedEventArgs) Handles list.PageIndexChanged 
        list.CurrentPageIndex = e.NewPageIndex 
        populateGrid("PageIndexChanged"
    End Sub 
End Class 

  

current RadControls for Asp.Net Ajax Version: 2007.3 1425


Thanks

Expedita
Top achievements
Rank 1
 answered on 02 Dec 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?