Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
113 views
Hi,
I think I found a problem in the Asp Ajax Controls suite, but to reproduce it, is rather difficult. Here it is:

Add a RadTabStrip to a aspx page. Add two tabs. Bellow the tabs, add a RadMultiPage control, and inside add, for each tab, a RadPageView, so that when a tab changes the corresponded pageview will be selected.

Set first tab on radTabStrip as Selected = true.
Set 0 as a default selected tab index on the RadMultiPage (first tab is selected).

Now, on the second tab strip, add a radgrid. Set AutoGenerateColumns to false, and dinamically add some rad columns on Page_Init (so that they are persisted in viewstate, as was nicely described in the online help). In my example, I've added 41 columns, I need to show some data in a pivoted manner. On this pivoted view, i need to set the first column frozen, (so that the other 40 can slide), and so I did, at design time.

If you're still following :), here is the problem:
The page loads fine, with the first tab selected. When I select the second tab, the first column that should be frozen is not frozen but is sliding along with the others. 
I've noticed that if I set that the second tab that contains the grid as selected by default when the page loads, the frozen column remains frozen and is acting as it should. Then if I select the first tab, and than reverse back to the second, the issue reapears.

I'm using the ASP.NET Ajax Controls, version Q2 2010.
Update: Forgot to mention: the bug appears only in IE7 and IE8 :).

Thanks for your help.
Lucian
Pavlina
Telerik team
 answered on 18 Aug 2010
2 answers
159 views
Hi,

Can anyone help.  I have a grid with a GridDropDownColumn as such:

<telerik:GridDropDownColumn UniqueName="CategoryName" HeaderText="Category" DataSourceID="DDL_DS" SortExpression="DC_Name" ListTextField="DC_Name" ListValueField="DC_Id" DataField="DC_Id" />

Grouping is enabled, and when a user drags the Category Header to the grouping pane, my grid groups fine.  However, the group header displays the Id, not the Name.  I've tried using ItemDataBound as below, but I just can't seem to grab that ListTextField.

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)

{

 

 

if (e.Item is GridGroupHeaderItem)

{

 

GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;  

DataRowView groupDataRow = (DataRowView)e.Item.DataItem;

item.DataCell.Text =

 

"( " + groupDataRow["DC_Id"].ToString() + " ) " ;

 

 

}

}

Thanks in advance,
J

 

 

 

Jason
Top achievements
Rank 1
 answered on 18 Aug 2010
1 answer
194 views
Hi,

I would like to place a Grid inside a treeview ,treeview nodes are dynamic..

Click on a particular node , I have to show a grid/list to display values (like a matrix)..

Code that I am trying is below:-

Somehow the datatable is not binding to the grid & generating the script error

 

 

//creates a Node "Interventions"

 

 

 

 

RadTreeNode nodeInterventions = new RadTreeNode();

 

nodeInterventions.Text =

 

 

NodeConstants.InterventionNode;

 

 

 

 

//nodeInterventions.ContextMenuID = "MainContextMenu";

 

 

e.Node.Nodes.Add(nodeInterventions);

 

 

 

DataTable dtintervention=new DataTable();

 

dtintervention.Columns.Add(

 

 

"INTERVENTION");

 

dtintervention.Columns.Add(

 

 

"DISCIPLINE");

 

dtintervention.Columns.Add(

 

 

"FREQUENCY");

 

dtintervention.Columns.Add(

 

 

"DURATION_IN_WEEK");

 

 

 

 

 

foreach (DataRow row in data.Rows)

 

{

dtintervention.Rows.Add(row[

 

 

"INTERVENTION"].ToString(), row["DISCIPLINE"].ToString(), row["FREQUENCY"].ToString(), row["DURATION_IN_WEEK"].ToString());

 

 

}

//adding a dynamic grid to treeview

 

 

RadGrid rgrv_Interventions = new RadGrid();

 

rgrv_Interventions.DataSource = dtintervention;

rgrv_Interventions.DataBind();

//addign the control to the treenode

 

 

 

RadTreeNode nodeint = new RadTreeNode();

 

nodeint.Controls.Add(rgrv_Interventions);

nodeInterventions.Nodes.Add(nodeint);

}

Hi...
I am able to place a normal grid view..but why not a radgrid..

regards
Delia Joe

 

Pavlina
Telerik team
 answered on 18 Aug 2010
1 answer
216 views
When I collapse/expand my RadDock in code-behind using RadDock1.Collapsed = True, even if I have EnableAnimation="True" set in my RadDock1, it does not show the animation.  Is there a way to do this?
Pero
Telerik team
 answered on 18 Aug 2010
2 answers
92 views
Hi telerik team

I am very pleased with your constant support over my problems but i m stuck with new problem.

I need to add "Export to iCal" link in Appointment context menu.
like:
<appointmentcontextmenus>
      <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
           <Items>
                <telerik:RadMenuItem Text="Edit" Value="CommandEdit" />
                <telerik:RadMenuItem IsSeparator="True" />
                <telerik:RadMenuItem Text="Export" Value="Export" />
           </Items>
       </telerik:RadSchedulerContextMenu>
</appointmentcontextmenus>

but on "AppointmentContextMenuItemClicking" event is not working as required. In debugging mode it never comes to this event. incase of "CommandEdit" it automatically opens the Edit form (i.e. Advanced Edit template).

protected void RadScheduler1_AppointmentContextMenuItemClicking(object sender, AppointmentContextMenuItemClickingEventArgs e)
        {
            if (e.MenuItem.Text.Contains("Export"))
            {
                WriteCalendar(RadScheduler.ExportToICalendar(e.Appointment));
                e.Cancel = true;
            }
        }

Is there any way to call "WriteCalendar(String data)" method through appointment context menu?
please help me to solve this problem.

Regards
Manmeet Singh
Peter
Telerik team
 answered on 18 Aug 2010
1 answer
239 views
Hi There,

Im trying to implement a custom datasource / provider for the filebrowser control.
I've looked at the related samples but am unsure which route to follow;

  1. Subclassing the existing Telerik.Web.UI.Widgets.FileSystemContentProvider and only overriding methods that need changed.
  2. Implementing a new Telerik.Web.UI.Widgets.FileBrowserContentProvider

Any help / pointers / sample code on how to achieve this would be much appreciated!
Below is sample code that is used to retrieve files from a remote machine (Linux) and bind it to a treeview. Also include is the accosiated XML RPC wrapper class.

Usage:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
       'set root path to browse on remote system
       Dim RootPath As String = "/dcinvol2/jobs"
       'create root node for treeview
       Dim RootNode As New TreeNode(RootPath)
       'instantiate new XML RPC class
       Dim XmlRpc As New Magic.XML_RPC
       If XmlRpc.IsRunning Then
           'return all files and folders
           Dim FilesAndFolders As New ArrayList()
           FilesAndFolders.AddRange(XmlRpc.GetFolders(RootPath, False, True, 1))
           If FilesAndFolders.Count > 0 Then
               'add each file or folder to rootnode
               For Each FileOrFolder As String In FilesAndFolders
                   Dim ChildNode As New TreeNode(FileOrFolder)
                   RootNode.ChildNodes.Add(ChildNode)
               Next
               'add rootnode to treeview
               TreeView1.Nodes.Add(RootNode)
           End If
       End If
   End Sub

Class:
Imports CookComputing.XmlRpc
Namespace Magic
    Public Class XML_RPC
        Private _iproxy As XmlRpcInt
        Public Sub New()
            _iproxy = CType(XmlRpcProxyGen.Create(GetType(XmlRpcInt)), XmlRpcInt)
        End Sub
        ''' <summary>
        ''' Check if service is running.
        ''' </summary>
        ''' <returns>True if service is running, otherwise False.</returns>
        Public Function IsRunning() As Boolean
            Dim strRet As String
            Try
                strRet = _iproxy.IsServerRunning()
            Catch ex As Exception
                Return False
            End Try
            If strRet.Length > 0 And strRet <> Nothing Then Return True
            Return False
        End Function
        ''' <summary>
        ''' Gets all sub folders under the path specified.
        ''' <param name="path">Path to query.</param>
        ''' <param name="fullPath">Optional - return the full path</param>
        ''' <param name="returnFiles">Optional - return the files in a dir</param>
        ''' <param name="drill_to_level_x">Optional - return a depth of dirs</param>
        ''' </summary>
        ''' <returns>Array of paths.</returns>
        Function GetFolders(ByVal path As String, Optional ByVal fullPath As Boolean = True, Optional ByVal returnFiles As Boolean = False, Optional ByVal drill_to_level_x As Integer = 0) As Array
            Dim al As New ArrayList
            Try
                Dim a As Array = Nothing
                a = _iproxy.GetFolders(path, fullPath, returnFiles, drill_to_level_x)
                For Each s As String In a
                    'Perform clean up
                    If s = "." Then Continue For
                    If s.StartsWith(".") Then s = s.TrimStart(".")
                    If s.StartsWith("/") Then s = s.TrimStart("/")
                    al.Add(s)
                Next
            Catch ex As Exception
                Return al.ToArray
            End Try
            Return al.ToArray
        End Function
        ''' <summary>
        ''' Looks for file specified and returns file in binary format.
        ''' </summary>
        ''' <param name="filename">The full path to file, including filename.</param>
        ''' <returns>Array in bytecode format.</returns>
        Function GetBinaryFile(ByVal filename As String) As Array
            Dim a As Array = Nothing
            Try
                a = _iproxy.GetBinaryFile(filename)
            Catch ex As Exception
                Return a
            End Try
            Return a
        End Function
        ''' <summary>
        ''' Checks if given path exists.
        ''' </summary>
        ''' <param name="path">The full path to folder/file.</param>
        ''' <param name="folder">Check folder or file exists.</param>
        ''' <returns>True if path exists, False otherwise.</returns>
        Function PathExists(ByVal path As String, Optional ByVal folder As Boolean = True) As Boolean
            Try
                Return _iproxy.PathExists(path, folder)
            Catch ex As Exception
                Return False
            End Try
        End Function
        ''' <summary>
        ''' Returns number of files in given path, currently this descends into sub folders.
        ''' </summary>
        ''' <param name="path">The full path to folder.</param>
        ''' <returns>Number of files in the path.</returns>
        Function GetNumberOfFiles(ByVal path As String) As Integer
            Dim i As Integer = 0
            Try
                i = CInt(_iproxy.GetNumberOfFiles(path))
            Catch ex As Exception
                Return i
            End Try
            Return i
        End Function
        ''' <summary>
        ''' Returns number of kilobytes in given path. 
        ''' </summary>
        ''' <param name="path">The full path to folder.</param>
        ''' <returns>Number of kilobytes in the path.</returns>
        Function GetByteSize(ByVal path As String) As Integer
            Dim i As String = 0
            Try
                i = CInt(_iproxy.GetByteSize(path))
            Catch ex As Exception
                Return i
            End Try
            Return i
        End Function
    End Class
End Namespace

Thanks,
Gordon
Fiko
Telerik team
 answered on 18 Aug 2010
0 answers
59 views
Hi all,

It looks like this server-side method attribute allows the server method to be controlled somehow through client scripting.

Is this correct? If so can a short example be provided please?

I tried just calling the function in script and got an 'Object was expected' null reference error.

Thanks :)
Brad
Top achievements
Rank 1
 asked on 18 Aug 2010
5 answers
776 views
Hello,

Im having an issue with the RadGrid and allowing Column Filtering. Basicly what has happened is that we had a grid. we had filtering on it and the filtering worked for awhile. we updated our controls to .1314, afterwards filtering started throwing an exception "no property or field 'username' exist in object". from my understanding this was an issue nearly a year ago and hotfix was applied.

to make things worse is that through searching the forums i found out setting the EnableLinqExpressions = false will allow the filtering to happen without throwing an exception, but when i set that property to false, the paging on the grid no longer works. the telerik pager, defaults to page 1, but when you click page 3, the pager is saying page 3 but the grid itself is still displaying records from page 1.

for awhile i believed it to be an ajax problem and i disabled all the ajax on the page and the problem still persist.

so, in a nutshell, if EnableLinqExpression is not set to False, we cannot use the Filtering provided in the control, if we do set EnableLineExpression to False, the pager does not work appropriately.

any help at all would be appreciated.

public partial class esAdmin_test : System.Web.UI.Page 
{ 
    public RadPane gridPane; 
    private UserBE.SelectionTypes _selectType = 0; 
    //public RadAjaxManager RadAjaxManager1; 
    //public RadAjaxLoadingPanel RadAjaxLoadingPanel1; 
 
    public UserBE.SelectionTypes SelectType 
    { 
        set { _selectType = value; } 
        get { return _selectType; } 
    } 
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        RadSplitter mpSplitter = (RadSplitter)Master.FindControl("NestedSplitter"); 
        if (mpSplitter != null) 
        { 
            ArrayList panes = mpSplitter.GetPanes(); 
            RadPane pane = (RadPane)panes[2]; 
            gridPane = (RadPane)panes[1]; 
            int paneIndex = pane.Index; 
            mpSplitter.Items.RemoveAt(paneIndex); 
        } 
 
        //RadAjaxManager1 = (RadAjaxManager)Master.FindControl("RadAjaxManager1"); 
        //RadAjaxLoadingPanel1 = (RadAjaxLoadingPanel)Master.FindControl("RadAjaxLoadingPanel1"); 
        //RadAjaxManager.GetCurrent(this.Page).AjaxSettings.AddAjaxSetting(this.RadAjaxManager1, this.RadGrid1, RadAjaxLoadingPanel1); 
        //RadAjaxManager.GetCurrent(this.Page).AjaxSettings.AddAjaxSetting(this.RadGrid1, this.RadGrid1, RadAjaxLoadingPanel1); 
       
    } 
 
    protected void RadGrid1_OnNeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e) 
    { 
        SessionManager _session = new SessionManager(); 
 
        ObjectContainerDataSource _datasource = new ObjectContainerDataSource(); 
        _datasource.DataObjectTypeName = "Peminic.Business.BusinessEntities.UserBE"; 
        _datasource.DataSource = UserBE.GetBySelectionType(UserBE.Context.AreoOfResponsibility, _session.UserID, SelectType); 
 
        RadGrid1.DataSource = _datasource; 
    } 
 
    protected void rdoSelectUser_SelectedIndexChanged(object sender, EventArgs e) 
    { 
        SelectType = (UserBE.SelectionTypes)Convert.ToInt32(rdoSelectUser.SelectedValue); 
        RadGrid1.CurrentPageIndex = 0; 
        RadGrid1.Rebind(); 
    } 
 
    protected override void RaisePostBackEvent(IPostBackEventHandler sourceControl, string eventArgument) 
    { 
        //RadGrid1.Rebind(); 
 
        base.RaisePostBackEvent(sourceControl, eventArgument); 
 
        if (sourceControl is RadAjaxManager) 
        { 
            if (eventArgument == "Rebind") 
            { 
                RadGrid1.MasterTableView.SortExpressions.Clear(); 
                RadGrid1.MasterTableView.GroupByExpressions.Clear(); 
                RadGrid1.Rebind(); 
            } 
 
            if (eventArgument == "ChangePageSize") 
            { 
                Session["itemsCount"] = this.RadGrid1.Items.Count; 
 
                //Depending on the paticular scenario this value may vary. 
                int rows = (Int32.Parse(this.gridPane.Height.Value.ToString()) - 20) / 32; 
                if (rows >= 1) 
                { 
                    RadGrid1.PageSize = rows; 
 
                    // Check whether the CurrentPageIndex is correct. 
                    if (Session["itemsCount"] != null) 
                    { 
                        int itemsCount = (int)Session["itemsCount"]; 
                        int pageCount = (int)Math.Ceiling(((double)itemsCount / rows)); 
                        if (RadGrid1.MasterTableView.CurrentPageIndex > pageCount - 1) 
                        { 
                            RadGrid1.MasterTableView.CurrentPageIndex = pageCount - 1; 
                        } 
                    } 
                    RadGrid1.Rebind(); 
                } 
            } 
        } 
    } 
} 

<asp:Content ID="Content3" runat="server" ContentPlaceHolderID="ContentPlaceHolderRuleNav"> 
    <div class="qsfexHeaderMain">Test Group Filter</div> 
    <asp:RadioButtonList ID="rdoSelectUser" runat="server" AutoPostBack="True"  
        Font-Names="Verdana"   
        style="margin-right: 61px"  
        onselectedindexchanged="rdoSelectUser_SelectedIndexChanged"> 
        <asp:ListItem Selected="True" Value="0">All</asp:ListItem> 
        <asp:ListItem Value="1">Active</asp:ListItem> 
        <asp:ListItem Value="2">Disabled</asp:ListItem> 
        <asp:ListItem Value="3">Last 3 Months</asp:ListItem>          
        <asp:ListItem Value="4">Locked Out</asp:ListItem> 
</asp:RadioButtonList>                            
</asp:Content> 
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server"> 
        <asp:Panel ID="Panel" runat="server"> 
            <telerik:RadGrid ID="RadGrid1" runat="server" PageSize="10" 
                 AllowPaging="True" GridLines="None" AutoGenerateColumns="False"  
                 AllowFilteringByColumn="true" EnableLinqExpressions="false" 
                 OnNeedDataSource="RadGrid1_OnNeedDataSource"> 
                <PagerStyle Mode="NextPrevNumericAndAdvanced"> 
                </PagerStyle> 
                <MasterTableView DataKeyNames="UserID" AllowMultiColumnSorting="True"> 
                    <GroupByExpressions> 
                    </GroupByExpressions> 
                    <Columns> 
                        <telerik:GridBoundColumn DataField="UserID" Visible="false" SortExpression="UserID"> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="LastName" SortExpression="LastName" HeaderText="Last Name"> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="FirstName" SortExpression="FirstName" HeaderText="First Name"> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Username" SortExpression="Username" HeaderText="User ID"> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Email" SortExpression="Email" HeaderText="Email"> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn DataField="Status" SortExpression="Status" HeaderText="Status"> 
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
                <ClientSettings > 
                    <Selecting AllowRowSelect="True"></Selecting> 
                    <Scrolling AllowScroll="True"></Scrolling> 
                    <ClientMessages /> 
                </ClientSettings> 
            </telerik:RadGrid> 
        </asp:Panel> 
</asp:Content> 
 
Dany
Top achievements
Rank 1
 answered on 18 Aug 2010
2 answers
205 views
I have a RadListBox in an editable FormTemmplate inside a RadGrid.  The ListBoxItems have checkboxes, and their data values are populated with a SQL DataSourceId.  When I select a grid row to edit, and the form populates, the ListBoxItem that matches to the data record is highlighted (selected), but its checkbox is not checked as it should be.  I've looked for a property to control this without luck.  How can I bind the ListBox such that it will check 'on' the selected ListBoxItem(s)?

This is the html:
<telerik:RadGrid ID="rgTodos" runat="server" EnableAJAX="True" AllowAutomaticUpdates="False" OnItemCommand="rgTodos_ItemCommand">
  <MasterTableView CommandItemDisplay="Bottom">
     <EditFormSettings EditFormType="Template">
        <FormTemplate>
           <table style="width: 80%" align="center">
              <telerik:RadListBox ID="listWho" runat="server" DataSourceID="dsTodoWho"
                DataTextField="wholist" DataValueField="who" Height="100px" Width="169px"
                Skin="Vista" CheckBoxes="true"  SelectedValue='<%# Bind("who") %>' 
                SelectionMode="Multiple">
              </telerik:RadListBox>

Thanks,  Dan
Dan
Top achievements
Rank 2
 answered on 18 Aug 2010
1 answer
236 views
Hi,

Our application is hosted on IIS7 64-bit, It is working fine on IIS6 but from IIS7 we are facing some issues:

When trying to execute a code which has radconfirm we are getting following errors:

 

  •  ASP.NET Ajax client-side framework failed to load
  • 'Sys' is undefined
  • “Telerik.Web.UI” is undefined

 

I tried with all steps mentioned in http://www.telerik.com/help/aspnet-ajax/troubleshooting.html but of no use.

Please help.

Regards,
Sudhanva

Maria Ilieva
Telerik team
 answered on 18 Aug 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?