Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
168 views

I need to access the Rows collection of the RadGrid on the client-side in javascript.

I know this can be done usually by doing:

var row = this.Rows[rowIndex];

...but only if you invoke the javascript directly from the grid...
What do I do if I need to access the rows collection and I've declared the grid like this:

var grid = document.getElementById('gvGrid');

var row = ??????

?

Thanks
AndyL

Shinu
Top achievements
Rank 2
 answered on 17 Jul 2008
1 answer
104 views
I am using trial version of Rad Editor

and using the following doctype for all pages

<!

DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > 



Rad Editor is displayed correctly with firefox ... But it displayed with some bad design in IE7.
what can i do for make it working in IE too?
Skins i hav tested are

gud
-----
WebBlue
Web20
Default
Mac
Telerik
Vista
Hay
Sunset
Default2006

bad
-----
Office2007
Inox
Black
Outlook


My aspx page is
----------------------


<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%
@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<!

DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<
html xmlns="http://www.w3.org/1999/xhtml">
<
head runat="server">
<title>Untitled Page</title>
</
head>
<
body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:UpdatePanel ID="upd1" runat="server">
<ContentTemplate><telerik:radeditor id="RadEditor1" runat="server" skin="Outlook">
<Content>

</Content>
</telerik:radeditor>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
</
body>
</
html>


But it works good with 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">



thanks,
RR

Rumen
Telerik team
 answered on 17 Jul 2008
8 answers
607 views
Hello,

When will the skins be available for download for the Q1 2008 release?  As of now, the only ones available are the "uncommon skins".  Thanks,

Shaun.
Dimo
Telerik team
 answered on 17 Jul 2008
1 answer
134 views
Good day folks.

In the RadEditor toolbar I have noted that the "Set Image Properties" button is always enabled, no matter if I am selecting an image or not, I don't saying that is bad or good, simply is not what I want, what I want is that the button gets enabled only if the user is selecting an image, how can I accomplish this task?.

Thanks in advance.
Rumen
Telerik team
 answered on 17 Jul 2008
3 answers
74 views
I have a TreeView above my editor and whenever I expand the treeview, the Design/Preview buttons do not move with the rest of the editor form.

This only happens in IE7. In firefox 3 it acts as expected.

Thanks

-Matt
Rumen
Telerik team
 answered on 17 Jul 2008
1 answer
123 views
Using the below declarations ...

<telerik:RadGrid runat="server" id="grdClients"  
        OnNeedDataSource="grdClients_NeedDataSource" 
        OnItemCreated="grdClients_ItemCreated" 
        Skin="Default2006" 
        AutoGenerateColumns="False" 
        AllowPaging ="True" 
        AllowSorting="True" 
        PageSize="8"  
        GridLines="None"  
        ShowStatusBar="False" 
        Width="100%" > 
         
        <ExportSettings> 
            <Excel Format="Html" /> 
        </ExportSettings> 
         
        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> 
             
        <ClientSettings AllowExpandCollapse="true" />  
     
        <MasterTableView DataKeyNames="Id, SuperClientId"> 
         
            <SelfHierarchySettings ParentKeyName="SuperClientId" KeyName="Id" MaximumDepth="0" /> 
               
            <Columns> 
                <telerik:GridHyperLinkColumn 
                    DataTextField="Id" 
                    DataTextFormatString="edit"  
                    UniqueName="colEditbasePage"  
                    DataNavigateUrlFormatString="editClient.aspx?id={0}"  
                    DataNavigateUrlFields="id"> 
                </telerik:GridHyperLinkColumn> 
                <telerik:GridHyperLinkColumn 
                    DataTextField="Id" 
                    DataTextFormatString="deactivate"  
                    UniqueName="colDeactivateClient"  
                    DataNavigateUrlFormatString="?deactivateid={0}"  
                    DataNavigateUrlFields="Id"> 
                </telerik:GridHyperLinkColumn> 
                 
                <telerik:GridBoundColumn 
                    DataField="CompanyName" 
                    DataType="System.String" 
                    HeaderText="Company Name" 
                    SortExpression="CompanyName" 
                    UniqueName="colCompanyName" > 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn 
                    DataField="City" 
                    DataType="System.String" 
                    HeaderText="City" 
                    SortExpression="City" 
                    UniqueName="colCity" > 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn 
                    DataField="Country" 
                    DataType="System.String" 
                    HeaderText="Country" 
                    SortExpression="Country" 
                    UniqueName="colCountry" > 
                </telerik:GridBoundColumn> 
                 
                <telerik:GridTemplateColumn HeaderText="Roles I fill"> 
                     <ItemTemplate> 
                        <table cellpadding="1" cellspacing="1" class="customTable"> 
                            <tr> 
                                <td style="width: 50%"> 
                                    <%# getRoleIndicator((int)DataBinder.Eval(Container.DataItem, "Id"), Settings.Default.role_clientCGC)%> 
                                </td> 
                                <td style="width: 50%"> 
                                    <%# getRoleIndicator((int)DataBinder.Eval(Container.DataItem, "Id"), Settings.Default.role_clientCC)%> 
                                </td> 
                            </tr> 
                        </table> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                 
                <telerik:GridBoundColumn 
                    DataField="NumOfRequestsBought" 
                    DataType="System.Int32" 
                    HeaderText="Number of Requests Purchased" 
                    SortExpression="NumOfRequestsBought" 
                    UniqueName="colNumOfRequestsBought" > 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn 
                    DataField="NumOfRequestsUsed" 
                    DataType="System.Int32" 
                    HeaderText="Number of Requests Used" 
                    SortExpression="NumOfRequestsUsed" 
                    UniqueName="colNumOfRequestsUsed" > 
                </telerik:GridBoundColumn> 
                 
                <telerik:GridCheckBoxColumn 
                    DataField="PurchasedApprovals" 
                    HeaderText="Purchased Approvals"  
                    AllowSorting="true" 
                    UniqueName="colPurchasedApprovals" > 
                </telerik:GridCheckBoxColumn> 
                <telerik:GridCheckBoxColumn 
                    DataField="PurchasedAgreements" 
                    HeaderText="Purchased Agreements"  
                    AllowSorting="true" 
                    UniqueName="colPurchasedAgreements" > 
                </telerik:GridCheckBoxColumn> 
                                     
            </Columns> 
        </MasterTableView> 
         
    </telerik:RadGrid> 


....  I've tried to programmatically hide the 'plus' sign next to top level nodes with no children nodes using this c# ....

public void Page_PreRenderComplete(object sender, EventArgs e) 
        { 
            HideExpandColumnRecursive(grdClients.MasterTableView); 
        } 
 
        public void HideExpandColumnRecursive(GridTableView tableView) 
        { 
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView); 
             
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems) 
            { 
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews) 
                { 
                    if (nestedView.Items.Count == 0) 
                    { 
                        TableCell cell = nestedView.ParentItem["ExpandColumn"]; 
                        cell.Controls[0].Visible = false; 
                        nestedViewItem.Visible = false; 
                    } 
 
                    if (nestedView.HasDetailTables) 
                         
                        HideExpandColumnRecursive(nestedView); 
                    } 
                } 
            } 
        } 
 


Line 14 above ALWAYS indicates that the "nestedView.Items.Count" equals zero.  I know for a fact that some of the nodes have more than one item in their nested views.  I kn ow this because they show themselves when I comment out line 3 in the C#.

Any help would be greatly appreciated.

Paul
Vlad
Telerik team
 answered on 17 Jul 2008
1 answer
190 views
Hi there,
I have a tree-view with checkboxes. When client checks a parent node, all of its corresponding child nodes should also be checked.

Following doesn't work for me, since I'm using RadTree for Ajax
function clientNodeChecked(sender, eventArgs)
{
   var childNodes = eventArgs.get_node().get_nodes();
   var isChecked = eventArgs.get_node().get_checked();
   UpdateAllChildren(childNodes, isChecked);
}
http://www.telerik.com/help/aspnet-ajax/tree_checkboxesallchildnodes.html

I do realize I have to replace get_nodes() with Nodes and get_checked() to Checked.... however, eventArgs.get_node() fails... I'm not sure what I should change it to... I've read all of
http://www.telerik.com/help/aspnet-ajax/tree_overviermigrating.html

There's no mention of what get_node() should be changed to... does eventArgs work anymore? Please help!
Atanas Korchev
Telerik team
 answered on 17 Jul 2008
3 answers
122 views

I am writing an application that allows a user to add many docks to the same page at once.  Currently, when a dock is added, it is placed "in front" of all the previous docks so that if more than one occupy the same screen area, the last one added will be in front of all the others.

I'm looking for a way to set the order of these docks so that the user can choose which docks are in front and in back.  The functionallity I'm looking for can be thought of as a kind of  "bring to front, send to back" type functionallilty seen in many programs.

I've played around with setting the z-index and that works fine when creating a dock in a CreateRadDock() Function using the following code.

dock.Style("z-index") = "1000" 

This same code also works in a dock command to set the z-index to a higher or lower number depending on the command.

The problem comes on postback when running CreateRadDockFromState().  Apparently the dock state doesnt store the front to back order of the docks.  Or at least I cant see it if it does.  So I have no way of determining the current value of z-index for the dock being created from a previous state.

Are there any suggestions or code samples to accomplish this?  Here is my relavant code: 

    Private Function CreateRadDock() As RadDock  
        Dim docksCount As Integer = CurrentDockStates.Count  
        Dim dock As New RadDock()  
        dock.Left = LeftPane.Width.Value - (Width / 2) + (ContentPane.Width.Value / 2)  
        dock.Top = ContentPane.Height.Value / 4  
        dock.Attributes.Add("onclick", "onDockClick(this);")  
        dock.Resizable = True 
        dock.Style("z-index") = "1000"  
 
        'dock.DockMode = DockMode.Floating  
        dock.UniqueName = Guid.NewGuid().ToString()  
        dock.ID = String.Format("RadDock{0}", dock.UniqueName)  
        dock.Text = String.Format("Added at {0}", DateTime.Now)  
        dock.OnClientResizeEnd = "onDockResizeEnd" 
        dock.OnClientDragEnd = "onDockClientDragEnd" 
        dock.OnClientCommand = "onDockCommand" 
 
        Dim cmdSendToBack As New DockCommand  
        cmdSendToBack.Name = "SendToBack" 
        cmdSendToBack.Text = "Send To Back" 
        cmdSendToBack.AutoPostBack = True 
        dock.Commands.Add(cmdSendToBack)  
 
        AddHandler dock.Command, AddressOf dock_Command  
        Return dock  
    End Function  
      
   Private Function CreateRadDockFromState(ByVal state As DockState) As RadDock  
        Dim dock As New RadDock()  
        dock.ID = String.Format("RadDock{0}", state.UniqueName)  
        dock.Attributes.Add("onclick", "onDockClick(this);")  
 
        dock.ApplyState(state)  
        dockdock.Text = dock.UniqueName  
        AddHandler dock.Command, AddressOf dock_Command  
 
        dock.OnClientResizeEnd = "onDockResizeEnd" 
        dock.OnClientDragEnd = "onDockClientDragEnd" 
        dock.OnClientCommand = "onDockCommand" 
 
        Dim cmdSendToBack As New DockCommand  
        cmdSendToBack.Name = "SendToBack" 
        cmdSendToBack.Text = "Send To Back" 
        cmdSendToBack.AutoPostBack = True 
        dock.Commands.Add(cmdSendToBack)  
 
 
        Return dock  
    End Function      
      
    Sub dock_Command(ByVal sender As Object, ByVal e As DockCommandEventArgs)  
        Select Case e.Command.Text  
            Case "Send To Back"  
                Dim myDock As RadDock = DirectCast(sender, RadDock)  
                myDock.Style("z-index") = "500"  
        End Select  
 
    End Sub  

Sophy
Telerik team
 answered on 17 Jul 2008
3 answers
164 views
I've bound my grid to an entity collection derived from a View.  The view is self referencing and I'd like the grid to represent that parent-child relationship.  The top level seems to acting correctly, but when I try and expand a top level node, I get this error.

"Parent table relation set, but no corresponding data-key name  found."

I've checked all the obvious, but alas, I can't find the problem.

 <telerik:RadGrid runat="server" id="grdClients"  
        OnNeedDataSource="grdClients_NeedDataSource" 
        Skin="Default2006" 
        AutoGenerateColumns="False" 
        AllowPaging ="True" 
        AllowSorting="True" 
        PageSize="8"  
        GridLines="None"  
        ShowStatusBar="False" 
        DataKeyNames="Id, SuperClientId" > 
         
        <ExportSettings> 
            <Excel Format="Html" /> 
        </ExportSettings> 
         
        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle> 
             
        <ClientSettings AllowExpandCollapse="true" />  
     
        <MasterTableView> 
         
            <SelfHierarchySettings ParentKeyName="Id" KeyName="SuperClientId" /> 
               
            <Columns> 
                <telerik:GridHyperLinkColumn 
                    DataTextField="Id" 
                    DataTextFormatString="edit"  
                    UniqueName="colEditbasePage"  
                    DataNavigateUrlFormatString="editClient.aspx?id={0}"  
                    DataNavigateUrlFields="id"> 
                </telerik:GridHyperLinkColumn> 
                <telerik:GridHyperLinkColumn 
                    DataTextField="Id" 
                    DataTextFormatString="deactivate"  
                    UniqueName="colDeactivateClient"  
                    DataNavigateUrlFormatString="?deactivateid={0}"  
                    DataNavigateUrlFields="Id"> 
                </telerik:GridHyperLinkColumn> 
                 
                <telerik:GridBoundColumn 
                    DataField="CompanyName" 
                    DataType="System.String" 
                    HeaderText="First Name" 
                    SortExpression="CompanyName" 
                    UniqueName="colCompanyName" > 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn 
                    DataField="City" 
                    DataType="System.String" 
                    HeaderText="City" 
                    SortExpression="City" 
                    UniqueName="colCity" > 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn 
                    DataField="Country" 
                    DataType="System.String" 
                    HeaderText="Country" 
                    SortExpression="Country" 
                    UniqueName="colCountry" > 
                </telerik:GridBoundColumn> 
                 
                <telerik:GridTemplateColumn HeaderText="Roles I fill"> 
                     <ItemTemplate> 
                        <table cellpadding="1" cellspacing="1" class="customTable"> 
                            <tr> 
                                <td style="width: 50%"> 
                                    <%# getRoleIndicator((int)DataBinder.Eval(Container.DataItem, "Id"), Settings.Default.role_clientCGC)%> 
                                </td> 
                                <td style="width: 50%"> 
                                    <%# getRoleIndicator((int)DataBinder.Eval(Container.DataItem, "Id"), Settings.Default.role_clientCC)%> 
                                </td> 
                            </tr> 
                        </table> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                 
                <telerik:GridBoundColumn 
                    DataField="NumOfRequestsBought" 
                    DataType="System.Int32" 
                    HeaderText="Number of Requests Purchased" 
                    SortExpression="NumOfRequestsBought" 
                    UniqueName="colNumOfRequestsBought" > 
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn 
                    DataField="NumOfRequestsUsed" 
                    DataType="System.Int32" 
                    HeaderText="Number of Requests Used" 
                    SortExpression="NumOfRequestsUsed" 
                    UniqueName="colNumOfRequestsUsed" > 
                </telerik:GridBoundColumn> 
                 
                <telerik:GridCheckBoxColumn 
                    DataField="PurchasedApprovals" 
                    HeaderText="Purchased Approvals"  
                    AllowSorting="true" 
                    UniqueName="colPurchasedApprovals" > 
                </telerik:GridCheckBoxColumn> 
                <telerik:GridCheckBoxColumn 
                    DataField="PurchasedAgreements" 
                    HeaderText="Purchased Agreements"  
                    AllowSorting="true" 
                    UniqueName="colPurchasedAgreements" > 
                </telerik:GridCheckBoxColumn> 
                                     
            </Columns> 
        </MasterTableView> 
         
    </telerik:RadGrid> 


protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!Page.IsPostBack) 
            { 
                Page.Title = "GlobeSpec | clients"; 
 
                Page.Form.DefaultFocus = this.txbFilterGrid.ClientID; 
                Page.Form.DefaultButton = this.btnFilterGrid.UniqueID; 
 
                grdClients.MasterTableView.FilterExpression = "SuperClientID = 0 OR SuperClientID IS NULL"; 
            } 
        } 
 
        protected void cmdExcel_Click(object sender, EventArgs e) 
        { 
            this.grdClients.ExportSettings.ExportOnlyData = true; 
            this.grdClients.ExportSettings.IgnorePaging = true; 
            this.grdClients.MasterTableView.ExportToExcel(); 
        } 
 
        protected void grdClients_NeedDataSource(object source, GridNeedDataSourceEventArgs e) 
        { 
            this.grdClients.DataSource = null; 
 
            VClientsGridCollection coll = new VClientsGridCollection(); 
            coll.LoadAll(); 
 
            if (!string.IsNullOrEmpty(this.txbFilterGrid.Text.Trim())) 
            { 
                //coll.Filter += " AND CompanyName Like '" + this.txbFilterGrid.Text.Trim() + @"%'"; 
                coll.Filter = "CompanyName Like '" + this.txbFilterGrid.Text.Trim() + @"%'"; 
            } 
 
            coll.Sort = "CompanyName"; 
 
            this.grdClients.DataSource = coll; 
        } 
 
 
        protected string getRoleIndicator(int clientId, string roleName) 
        { 
            Person me = (Person) Session["User"]; 
 
            l = new Lookup(); 
            l.Query.Where(l.Query.LookupName.Like(roleName.Trim())).Select("Id"); 
            l.Query.Load(); 
 
            pc = new PersonClient(); 
            pc.Query.Where(pc.Query.ClientId.Equal(clientId), 
                           pc.Query.RoleId.Equal(l.Id), 
                           pc.Query.PersonId.Equal(me.Id)); 
             
            if(pc.Query.Load()) 
            { 
                if (roleName.Equals(Settings.Default.role_clientCGC.ToString())) 
                { 
                    return "CGC"; 
                } 
                else if (roleName.Equals(Settings.Default.role_clientCC.ToString())) 
                { 
                    return "CC"; 
                } 
            } 
 
            return string.Empty; 
        } 
 
        protected void btnFilterGrid_Click(object sender, EventArgs e) 
        { 
            this.grdClients.DataSource = null; 
 
            VClientsGridCollection coll = new VClientsGridCollection(); 
            coll.LoadAll(); 
 
            if (!string.IsNullOrEmpty(this.txbFilterGrid.Text.Trim())) 
            { 
                coll.Filter = "CompanyName Like '" + this.txbFilterGrid.Text.Trim() + @"%'"; 
            } 
 
            coll.Sort = "CompanyName"; 
 
            this.grdClients.DataSource = coll; 
            this.grdClients.DataBind(); 
        } 


Any help or ideas would be greatly appreciated..


Sebastian
Telerik team
 answered on 17 Jul 2008
6 answers
299 views
This has to be a bug, the start and end times and display are different in Week View after creating an appointment across multiple days.  I was able to reproduce it using one of your online demos so I wont bother posting code here:

http://www.telerik.com/demos/aspnet/prometheus/Scheduler/Examples/BlackPearl/DefaultCS.aspx

  1. On the demo page, get to Month View (i think it is by default)
  2. Double click on March 5th to create an entry.
  3. Uncheck 'All Day Event' checkbox so you can enter times
  4. set start date/time to Mon March 5th at 1pm
  5. set end date/time to thurs March 8th at 5pm, Click Insert.
  6. This is good and fine in Month View, but now switch to Week View, and go to this week (will show the 4th - 10th).
  7. We see some problems here, first off, in my version I have the All Day row on the top of the Scheduler turned off, so in mine it looks like I only have something scheduled on the 5th and 8th.  In the actual days (not the All Day row), shouldnt it show the 6th and 7th with something scheduled?  Also, look at how far off the time is on thurs the 8th, it starts at 8am, it should start at 1pm.  When you double click on anything though, it shows the correct time.  Bug?  Help please, thank you.
  8. Also try dragging the Monday entry around to a new time (in week view), what it does doesnt even make sense and not even sure how to explain it.
Joe
Top achievements
Rank 1
 answered on 17 Jul 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?