Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
167 views
Hi,

We have built a large backend system for our staff to use, using telerik controls. Obviously with such an application page rendering speed is essential, so I would like your advise on the best browser to use to get the fastest performance from the telerik controls.

Thanks for your help.
-DJ-
Top achievements
Rank 1
 answered on 05 Sep 2008
1 answer
166 views
I'd like to customize the Table Properties dialog by editing the TablePropertiesControl.ascx file, as we did in earlier version (4.5.x) of the editor.
I found information that the folder "EditorDialogs" which contains this file needs to be added manually from the installation files. Problem is that I don't find this folder in the installation files I've downloaded (for version 5.2.0), so my question is where do I find this folder?

BR, Domack


domack
Top achievements
Rank 1
 answered on 05 Sep 2008
7 answers
2.0K+ views
All I want to know is how do you add Telerik.Web.UI in the web.config instead of 

<%

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

right now I have several pages that register the dll on the page but most of my pages are going to use the dll

I am using version 2008.1.415.35

Martin
Top achievements
Rank 1
 answered on 05 Sep 2008
2 answers
253 views
The NestedViewTemplate of a grid always consists of one row showing the comment text pertaining to the parent row.  The parent rows have alternating background colours.  How can I get the background colour of the nested row to match the colour of its parent row?
Princy
Top achievements
Rank 2
 answered on 05 Sep 2008
1 answer
124 views
I have a problem with disabled radcomboboxes.
First, on client side, you cannot select an item while the combo is disabled.
so you need to enable it, set the value, then disable it.
this should be fine but, after a disable() call, the combobox looses the ability of getting the value. this is because the disable function, which looks like (combo.disable.toString() in debugger) :
somecombo.disable = function() {  
var _a0 = this.get_tableElement();  
if (_a0 != null) {  
_a0.className = "rcbDisabled";  
}  
this.set_enabled(false);  
this.set_value(this.get_text());  
this.get_inputDomElement().disabled = "disabled";  
this.disableEvents();  
var _a1 = this._children.get_count();  
for (var i = 0; i < _a1; i++) {  
this._children.getItem(i).disable();  
}  
}  
 

destroys the value, by setting it's text! on the green line 
this.set_value(this.get_text());
this looks like is not correct.
of course, I can workaround this (by changing this function, or by keeping my id before disable then setting it back) but I think this code should be revised.




Rosi
Telerik team
 answered on 05 Sep 2008
3 answers
238 views
I have pre-assigned button themes that are intended to be used as <input ... class="button-red" />. In the GridButtonColumn, I would expect to be able to assign a CSS class to the button itself, not the table cell which isn't very intuitive.

For example, I have a GridButtonColumn in my RadGrid like this:

<telerik:GridButtonColumn
    ButtonType="PushButton"
    CommandName="SendToCart"
    Text="Send To Cart">
    <ItemStyle
        VerticalAlign="Top"
        CssClass="button-red" />
</telerik:GridButtonColumn>

The problem is that the CssClass gets assigned to the table cell like this (which is almost useless for styling buttons using existing themes):

<td class="button-red" valign="top">  
    <input name="main_content_dynamic$WishlistItemsGridView$ctl00$ctl04$ctl00" value="Send To Cart"  
        onclick="javascript:__doPostBack('main_content_dynamic$WishlistItemsGridView$ctl00$ctl04$ctl00','')"  
        type="button">  
</td>  

I'm trying to get the css class "button-red" to be assigned to the <input> button so the html ends up as:



<td valign="top">  
    <input name="main_content_dynamic$WishlistItemsGridView$ctl00$ctl04$ctl00" value="Send To Cart"  
        onclick="javascript:__doPostBack('main_content_dynamic$WishlistItemsGridView$ctl00$ctl04$ctl00','')"  
        type="button" 
        class="button-red">  
</td>

I was hoping to find a "Button-CssClass" property in the GridButtonColumn, but no such luck
. Support told me to use the ItemDataBound event to add the class to the input button. Even though I'm doing this now, this seems like overkill for such a simple issue. Although I don't think it's much to ask to add a Button-CssClass property to the GridButtonColumn, it would really go great lengths in making the GridButtonColumn much more visually functional. Am I alone in this?


Dimo
Telerik team
 answered on 05 Sep 2008
1 answer
95 views
I have a grid where the pager slider will not center in firefox or safari but will in IE.  In firefox and safari, it's always aligned to the left.  I have the grid with autogenerate columns = false, show groupbar, show statusbar, and the pager is set by: <PagerStyle HorizontalAlign="Center" Mode="Slider" />.  I am using the WebBlue skin.  This is on the latest release (826).

The actual Page: 1 out of X pages does center, left, or right according to the HorizontalAlign property but the slider will always stay to the left.
Dimo
Telerik team
 answered on 05 Sep 2008
1 answer
96 views

I want to create a radgrid which resizes to the screen. It must be paged, so the pagesize must be changed when resizing the screen. I can get the radgrid to fill the area (using height=”100%”) but the pagesize is not changed accordingly.

The result must be that on a larger window, less pages are needed, because more rows per page are visible.

Dimo
Telerik team
 answered on 05 Sep 2008
1 answer
107 views
To whom it concerns:

I've recently encounted issues with the dynamically generated span's that are generated when you click on a grid header column to resize it (see in the telerik.web.ui source code GridColumnResizer.js, ~line 14 and GridCommon.js, ~line 644 for the one i'm referring to). The issues occur when the grid(s) in question exist inside of an absolutely positioned window that is then able to be scrolled (overflow-y:scroll being set on the content container within that window).. Since the auto generated spans are absolutely positioned based on the body  element, it doesn't know that the grid it is supposed to sit on top may be scrolled out of the way. A couple suggested fixes would be to generate those spans relatively positioned within the immediate container to the grid. A quick fix would have been to give those spans a class so that we can just hide them, since they don't 100% work across browsers anyway (not for me at least).

I'd love to hear if there are other suggestions to that issue.

Thanks!
Seth Messer
Dimo
Telerik team
 answered on 05 Sep 2008
2 answers
291 views
I'm attempting to modify your drag & drop grid sample to allow dropping back and forth between both grids rather than just allowing drag from one grid to the other.  I can get it to work dragging from the left to the right grid, but when I attempt to drag from the right to the left, the row is removed from the right grid, but does not show up in the left until I do a refresh of the page.

Modified JavaScript:
function onRowDropping(sender, args) {  
    debugger;  
    if (sender.get_id() == '<%=grdAvailable.ClientID %>')  
    {  
        var node = args.get_destinationHtmlElement();   
        if(!isChildOf('<%=grdSelected.ClientID %>', node) && !isChildOf('<%=grdAvailable.ClientID %>', node) )  
        {   
            args.set_cancel(true);   
        }  
    }  
    if (sender.get_id() == '<%=grdSelected.ClientID %>')  
    {  
        var node = args.get_destinationHtmlElement();   
        if(!isChildOf('<%=grdAvailable.ClientID %>', node) && !isChildOf('<%=grdSelected.ClientID %>', node) )  
        {   
            args.set_cancel(true);   
        }  
    }  

Grids:
<table> 
    <tr> 
        <td style="width: 100%; padding-left: 5px; padding-right: 5px;">  
            <div style="float: left; padding: 0 6px 0 10px">  
                <h2> 
                    Available</h2> 
                <telerik:RadGrid runat="server" ID="grdAvailable" Skin="Office2007" OnNeedDataSource="grdAvailable_NeedDataSource" 
                    Width="550px" AllowMultiRowSelection="true" AutoGenerateColumns="false" OnRowDrop="grdAvailable_RowDrop">  
                    <MasterTableView DataKeyNames="fieldname" Width="95%" TableLayout="Fixed">  
                        <Columns> 
                            <telerik:GridBoundColumn HeaderText="Field Name"></telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn HeaderText="Column Description"></telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn HeaderText="Column Width"></telerik:GridBoundColumn> 
                        </Columns> 
                    </MasterTableView> 
                    <ClientSettings AllowRowsDragDrop="True">  
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" /> 
                        <ClientEvents OnRowDropping="onRowDropping" /> 
                        <Scrolling AllowScroll="true" UseStaticHeaders="true" /> 
                    </ClientSettings> 
                    <PagerStyle Mode="NextPrevAndNumeric" /> 
                </telerik:RadGrid> 
            </div> 
        </td> 
        <td valign="top">  
            <div style="float: right; padding: 0 10px 0 6px">  
                <h2> 
                    Selected</h2> 
                <telerik:RadGrid runat="server" ID="grdSelected" Skin="Office2007" OnNeedDataSource="grdSelected_NeedDataSource" 
                    Width="550px" AllowMultiRowSelection="true" AutoGenerateColumns="false" OnRowDrop="grdSelected_RowDrop">  
                    <MasterTableView DataKeyNames="fieldname" Width="100%">  
                        <Columns> 
                            <telerik:GridBoundColumn HeaderText="Field Name"></telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn HeaderText="Column Description"></telerik:GridBoundColumn> 
                            <telerik:GridBoundColumn HeaderText="Column Width"></telerik:GridBoundColumn> 
                        </Columns> 
                    </MasterTableView> 
                    <ClientSettings AllowRowsDragDrop="True">  
                        <Selecting AllowRowSelect="True" EnableDragToSelectRows="true" /> 
                        <ClientEvents OnRowDropping="onRowDropping" /> 
                    </ClientSettings> 
                </telerik:RadGrid> 
            </div> 
            <div style="clear: both;">  
                <!-- --> 
            </div> 
        </td> 
    </tr> 
</table> 

C# code(I have commented out the sql query that populates grdAvailable and hard-coded 2 rows, eventually I will need to query to populate both grids):
        protected void grdAvailable_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            grdAvailable.DataSource = AvailableFields;  
        }  
        protected void grdSelected_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            grdSelected.DataSource = SelectedFields;  
        }  
 
        protected IList<Field> AvailableFields  
        {  
            get 
            {  
                try 
                {  
                    object obj = Session["AvailableFields"];  
                    if (obj == null)  
                    {  
                        obj = GetAvailableFields();  
                        if (obj != null)  
                        {  
                            Session["AvailableFields"] = obj;  
                        }  
                        else 
                        {  
                            obj = new List<Field>();  
                        }  
                    }  
                    return (IList<Field>)obj;  
                }  
                catch 
                {  
                    Session["AvailableFields"] = null;  
                }  
                return new List<Field>();  
            }  
            set { Session["AvailableFields"] = value; }  
        }  
 
        protected IList<Field> SelectedFields  
        {  
            get 
            {  
                try 
                {  
                    object obj = Session["SelectedFields"];  
                    if (obj == null)  
                    {  
                        Session["SelectedFields"] = obj = new List<Field>();  
                    }  
                    return (IList<Field>)obj;  
                }  
                catch 
                {  
                    Session["SelectedFields"] = null;  
                }  
                return new List<Field>();  
            }  
            set { Session["SelectedFields"] = value; }  
        }  
 
        protected IList<Field> GetAvailableFields()  
        {  
            IList<Field> results = new List<Field>();  
            //using (IDbConnection connection = DbProviderFactories.GetFactory("System.Data.SqlClient").CreateConnection())  
            //{  
            //    connection.ConnectionString =  
            //        ConfigurationManager.ConnectionStrings["NorthwindConnectionString"].ConnectionString;  
            //    using (IDbCommand command = connection.CreateCommand())  
            //    {  
            //        command.CommandText =  
            //            "SELECT o.OrderID, o.CustomerID, o.RequiredDate, c.CompanyName FROM orders o INNER JOIN customers c on o.customerID = c.customerID";  
            //        connection.Open();  
            //        try  
            //        {  
            //            IDataReader reader = command.ExecuteReader();  
            //            while (reader.Read())  
            //            {  
            //                string fieldName = (!reader.IsDBNull(reader.GetOrdinal("fieldname")))  
            //                                        ? (string)reader.GetValue(reader.GetOrdinal("CustomerID"))  
            //                                        : string.Empty;  
            //                string description = (!reader.IsDBNull(reader.GetOrdinal("description")))  
            //                                            ? (string)reader.GetValue(reader.GetOrdinal("RequiredDate"))  
            //                                            : string.Empty;  
            //                string width = (!reader.IsDBNull(reader.GetOrdinal("width")))  
            //                                         ? (string)reader.GetValue(reader.GetOrdinal("CompanyName"))  
            //                                         : string.Empty;  
                            results.Add(new Field("jobid""Ticket""150"));  
                            results.Add(new Field("status""S""150"));   
            //            }  
            //        }  
            //        catch  
            //        {  
            //            results.Clear();  
            //        }  
            //    }  
            //}  
            return results;  
        }  
 
        protected void grdAvailable_RowDrop(object sender, GridDragDropEventArgs e)  
        {  
            if (string.IsNullOrEmpty(e.HtmlElement))  
            {  
                if (e.DraggedItems[0].OwnerGridID == grdAvailable.ClientID)  
                {  
                    // items are drag from available to selected grid  
                    if ((e.DestDataItem == null && SelectedFields.Count == 0) ||  
                        e.DestDataItem != null && e.DestDataItem.OwnerGridID == grdSelected.ClientID)  
                    {  
                        IList<Field> selectedFields = SelectedFields;  
                        IList<Field> availableFields = AvailableFields;  
                        foreach (GridDataItem draggedItem in e.DraggedItems)  
                        {  
                            Field tmpField = GetField(availableFields, (string)draggedItem.GetDataKeyValue("fieldname"));  
                            if (tmpField != null)  
                            {  
                                selectedFields.Add(tmpField);  
                                availableFields.Remove(tmpField);  
                            }  
                        }  
                        SelectedFields = selectedFields;  
                        AvailableFields = availableFields;  
                        grdAvailable.Rebind();  
                        grdSelected.Rebind();  
                    }  
                    else if (e.DestDataItem != null && e.DestDataItem.OwnerGridID == grdAvailable.ClientID)  
                    {  
                        //reorder items in available  grid  
                        IList<Field> availableFields = AvailableFields;  
                        Field field = GetField(availableFields, (string)e.DestDataItem.GetDataKeyValue("fieldname"));  
                        int destinationIndex = availableFields.IndexOf(field);  
                        List<Field> fieldsToMove = new List<Field>();  
                        foreach (GridDataItem draggedItem in e.DraggedItems)  
                        {  
                            Field tmpField = GetField(availableFields, (string)draggedItem.GetDataKeyValue("fieldname"));  
                            if (tmpField != null)  
                                fieldsToMove.Add(tmpField);  
                        }  
                        foreach (Field fieldToMove in fieldsToMove)  
                        {  
                            availableFields.Remove(fieldToMove);  
                            availableFields.Insert(destinationIndex, fieldToMove);  
                        }  
                        AvailableFields = availableFields;  
                        grdAvailable.Rebind();  
                        e.DestDataItem.Selected = true;  
                    }  
                }  
            }  
        }  
 
        private static Field GetField(IEnumerable<Field> fieldsToSearchIn, string fieldName)  
        {  
            foreach (Field field in fieldsToSearchIn)  
            {  
                if (field.fieldName == fieldName)  
                {  
                    return field;  
                }  
            }  
            return null;  
        }  
 
        protected void grdSelected_RowDrop(object sender, GridDragDropEventArgs e)  
        {  
            if (string.IsNullOrEmpty(e.HtmlElement))  
            {  
                if (e.DraggedItems[0].OwnerGridID == grdSelected.ClientID)  
                {  
                    // items are drag from selected to available grid  
                    if ((e.DestDataItem == null && AvailableFields.Count == 0) ||  
                        e.DestDataItem != null && e.DestDataItem.OwnerGridID == grdAvailable.ClientID)  
                    {  
                        IList<Field> availableFields = AvailableFields;  
                        IList<Field> selectedFields = SelectedFields;  
                        foreach (GridDataItem draggedItem in e.DraggedItems)  
                        {  
                            Field tmpField = GetField(selectedFields, (string)draggedItem.GetDataKeyValue("fieldname"));  
                            if (tmpField != null)  
                            {  
                                availableFields.Add(tmpField);  
                                selectedFields.Remove(tmpField);  
                            }  
                        }  
                        AvailableFields = availableFields;  
                        SelectedFields = selectedFields;  
                        grdSelected.Rebind();  
                        grdAvailable.Rebind();  
                    }  
                    else if (e.DestDataItem != null && e.DestDataItem.OwnerGridID == grdSelected.ClientID)  
                    {  
                        //reorder items in selected  grid  
                        IList<Field> selectedFields = SelectedFields;  
                        Field field = GetField(selectedFields, (string)e.DestDataItem.GetDataKeyValue("fieldname"));  
                        int destinationIndex = selectedFields.IndexOf(field);  
                        List<Field> fieldsToMove = new List<Field>();  
                        foreach (GridDataItem draggedItem in e.DraggedItems)  
                        {  
                            Field tmpField = GetField(selectedFields, (string)draggedItem.GetDataKeyValue("fieldname"));  
                            if (tmpField != null)  
                                fieldsToMove.Add(tmpField);  
                        }  
                        foreach (Field fieldToMove in fieldsToMove)  
                        {  
                            selectedFields.Remove(fieldToMove);  
                            selectedFields.Insert(destinationIndex, fieldToMove);  
                        }  
                        AvailableFields = selectedFields;  
                        grdSelected.Rebind();  
                        e.DestDataItem.Selected = true;  
                    }  
                }  
            }  
        }
        #region Nested type: Field  
        protected class Field  
        {  
            private string _fieldName;  
            private string _description;  
            private string _width;  
            public Field(string fieldName, string description, string width)  
            {  
                _fieldName = fieldName;  
                _description = description;  
                _width = width;  
            }  
            public string fieldName  
            {  
                get { return _fieldName; }  
            }  
            public string description  
            {  
                get { return _description; }  
            }  
            public string width  
            {  
                get { return _width; }  
            }  
        }
        #endregion  
 
bdk0172
Top achievements
Rank 1
 answered on 05 Sep 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?