Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
111 views
Good morning, all.

I have a question regarding the state strings stored in a SQL server.  I have some code in which a user selects a dock from a menu, as well as a zone in which to place the dock.  The docks are created properly and their states are saved as they should be, but I've noticed that any docks with "Closed":"True" are never being deleted from the string that's stored server-side.  For example, I have one user's string with about 34 docks in it, but only 1 of them is open and rendering (which is functioning correctly).  Is there something I'm missing that will get rid of the other 33 docks that are closed?
Jeff
Top achievements
Rank 1
 answered on 04 Dec 2012
2 answers
167 views
Okay so here's the problem I am having.  I am wanting to show a multicolumn radcombobox in a radgrid from a custom inline edit form (user control).  I can get it to work fine on a page but from what I can tell when you run the same code from a user control that is being referenced by a radgrid for CRUD.  What is happening is that the dynamic template that I am creating doesn't get applied until after that data is bound.  From the looks of it the page load doesn't get touched at all.  So from what I can tell I am trying to call a databind within a databind which is my problem.

So for the radgrid when you use a custom form you call most of your bindings in the

private void InitializeComponent()
{
    this.DataBinding += new System.EventHandler(this.RandomName_DataBound);
}

and then you can bind lists etc. in there.  This is not a problem.  I can even databind the combobox.  Where the problem comes in is when I want to databind with a multicolumn format on the combobox. 

ComboBox.ItemTemplate = new ItemTemplate();
ComboBox.ItemDataBound += ComboBox_ItemDataBound;
ComboBox.Width = Unit.Pixel(500);
ComboBox.AllowCustomText = true;
ComboBox.MarkFirstMatch = true;
 
ComboBox.DataSource = GetVendorList();
ComboBox.DataTextField = "Name";
ComboBox.DataBind();
foreach (RadComboBoxItem item in ComboBox.Items)
{
    item.DataBind();
}

The above code is in the system event handler databound method.

protected void RandomName_DataBound(object sender, EventArgs e)
{
    // do stuff here
}

The problem from what I can see is that the Template that I am creating isn't firing until after the data is bound to the grid so it doesn't format the multicolumns properly.

class ItemTemplate : ITemplate
{
    public void InstantiateIn(Control container)
    {
        Table table = new Table();
        table.Width = Unit.Percentage(100);
        TableRow mainRow = new TableRow();
        TableCell cell1 = new TableCell();
        cell1.Width = Unit.Percentage(40);
        cell1.DataBinding += new EventHandler(cell1_DataBinding);
 
        mainRow.Cells.Add(cell1);
        TableCell cell2 = new TableCell();
        cell2.DataBinding += new EventHandler(cell2_DataBinding);
        cell2.Width = Unit.Percentage(30);
        mainRow.Cells.Add(cell2);
 
        TableCell cell3 = new TableCell();
        cell3.DataBinding += new EventHandler(cell3_DataBinding);
        cell3.Width = Unit.Percentage(30);
        mainRow.Cells.Add(cell3);
        table.Rows.Add(mainRow);
        container.Controls.Add(table);
    }
 
    private void cell1_DataBinding(object sender, EventArgs e)
    {
        TableCell target = (TableCell)sender;
        RadComboBoxItem item = (RadComboBoxItem)target.BindingContainer;
        target.Text = (string)DataBinder.Eval(item, "Text");
    }
 
    private void cell2_DataBinding(object sender, EventArgs e)
    {
        TableCell target = (TableCell)sender;
        RadComboBoxItem item = (RadComboBoxItem)target.BindingContainer;
        target.Text = (string)DataBinder.Eval(item, "Attributes[\"Type\"]");
    }
 
    private void cell3_DataBinding(object sender, EventArgs e)
    {
        TableCell target = (TableCell)sender;
        RadComboBoxItem item = (RadComboBoxItem)target.BindingContainer;
        target.Text = (string)DataBinder.Eval(item, "Attributes[\"Phone\"]");
    }
 
}

Any help on a work around would be great.  I have gone through all of the forums and all of the different sections of the radgrid and radcombobox api to see if this was addressed and I didn't find anything.

Thanks,
Kevin
Nencho
Telerik team
 answered on 04 Dec 2012
1 answer
124 views
Hello Telerik team.

We found a problem tabstrip control.
we are using telerik version 2012.2.912.40

I created approximately 15 ~ 20 tabs, click tabstript's scroll button for moving end of right side.
and click the close button while tab count is 0.
sometimes tabcontrol is invisible or cut the left side tab area.

I implemented some codes for reproducing problem at radtabstrip control.
here is my code and screenshots

ScreenshotLinkHere!!!

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <%--Needed for JavaScript IntelliSense in VS2010--%>
                <%--For VS2008 replace RadScriptManager with ScriptManager--%>
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>
        <script type="text/javascript">
            //Put your JavaScript code here.
        </script>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadButtonAdd">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTabStripContent" />
                        <telerik:AjaxUpdatedControl ControlID="LabelCount" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadButtonClose_Click">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadTabStripContent" />
                            <telerik:AjaxUpdatedControl ControlID="LabelCount" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <div style="height: 100px; background-color: gray;">
            <telerik:RadTabStrip ID="RadTabStripContent" runat="server" Skin="Simple" ScrollChildren="true" dir="LTL" EnableEmbeddedSkins="true"
                Visible="true">
                <TabTemplate>
                    <asp:Label ID="LabelTabName" runat="server" />
                    Tab
                </TabTemplate>
            </telerik:RadTabStrip>
        </div>
 
        <telerik:RadButton runat="server" ID="RadButtonAdd" Text="Add" OnClick="RadButtonAdd_Click"></telerik:RadButton>
 
        <telerik:RadButton runat="server" ID="RadButtonClose" Text="close" OnClick="RadButtonClose_Click"></telerik:RadButton>
 
        <asp:Label runat="server"  ID="LabelCount" Text="Tab Count:"></asp:Label>
    </form>
</body>
</html>

using System;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
 
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Telerik.Web.UI;
 
public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void RadButtonClose_Click(object sender, EventArgs e)
    {
        RadTabStripContent.Tabs.RemoveAt(RadTabStripContent.Tabs.Count -4);
 
        LabelCount.Text = "Tab Count:" + RadTabStripContent.Tabs.Count;
    }
    protected void RadButtonAdd_Click(object sender, EventArgs e)
    {
        RadTab tab = new RadTab();
         
        tab.Text = "TAB "+ (RadTabStripContent.Tabs.Count + 1).ToString();
 
        RadTabStripContent.Tabs.Add(tab);
 
        LabelCount.Text = "Tab Count:" + RadTabStripContent.Tabs.Count;
    }
}


Nencho
Telerik team
 answered on 04 Dec 2012
1 answer
194 views
I have a calculated column that will display positive and negative numbers. I want to change the negative numbers color to red. How would I go about doing this. Any help would be great.
Michael
Top achievements
Rank 1
 answered on 04 Dec 2012
7 answers
373 views

Hello techies,

We are using the RagGrid on a test page for performance testing.
We were surprised to notice that a simple page with 100 elements in the GRID takes on an average about 2 seconds. We are doing a load test on Win Server 2008 R2. We are not using a real database. We are using a STUB to generate the 100 odd elements.
The same STUB when used on ASP.net MVC page with simple HTML table rendering out performs the RadGrid Page. The MVC page takes about 0.37 seconds.

 

Test Environment : ASP.net 4.0 / RadControls for ASP.NET AJAX Q2 2011 SP1 / Windows Server 2008 R2 / IIS 7.5  / Application pool type “Integrated Pipeline”

Any ideas?

 

Advance thanks,
Clement
Pavlina
Telerik team
 answered on 04 Dec 2012
1 answer
162 views
Does RadOrgChart support a horizontal orientation?
Peter Filipov
Telerik team
 answered on 04 Dec 2012
1 answer
75 views
I have a Rad combo box that when you type it starts completing sentences instead of just marking the one that is most similar.

<telerik:RadComboBox ID="rcbSiteSearch" runat="server" Width="190px" Height="100px" EnableLoadOnDemand="True" ShowMoreResultsBox="true" MarkFirstMatch="true" AllowCustomText="true" EnableVirtualScrolling="true" OnItemsRequested="rcbSiteSearch_ItemsRequested" />


Protected Sub rcbSiteSearch_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs)
        Const ItemsPerRequest As Integer = 5
        Dim data As DataTable = GetSiteName(e.Text)
 
        Dim itemOffset As Integer = e.NumberOfItems
        Dim endOffset As Integer = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count)
        e.EndOfItems = endOffset = data.Rows.Count
 
        For i As Integer = itemOffset To endOffset - 1
            rcbSiteSearch.Items.Add(New RadComboBoxItem(data.Rows(i)("name").ToString(), data.Rows(i)("value").ToString()))
        Next
 
        e.Message = GetStatusMessage(endOffset, data.Rows.Count)
    End Sub
    Private Shared Function GetSiteName(ByVal text As String) As DataTable
        Dim StateCode As String = "pa"
        Dim connectionString As String = *Connection String*
        Dim QueryStr As String = *QUERY*
        Dim adapter As New SqlDataAdapter(QueryStr,connectionString)
        Dim Data As New DataTable()
        Try
            adapter.Fill(Data)
        Catch ex As Exception
            Call MsgBox(String.Format("Unexpected Error: {0}", ex.ToString()), 0, "Unexpected Search Error")
        End Try
        Return Data
    End Function
    Private Shared Function GetStatusMessage(ByVal offset As Integer, ByVal total As Integer) As String
        If total <= 0 Then
            Return "No matches"
        End If
 
        Return [String].Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total)
    End Function
Boyan Dimitrov
Telerik team
 answered on 04 Dec 2012
2 answers
154 views
I am using a grid control and when I enable the show group panel and enable that functionality, my columns are shrunk down to fit in the window. There is no overflow shown at all. This issue can be resolved by putting the browser (IE) in to IE8 compatibility Mode with and IE 8 Document Mode. The issue with this is when I make this change, the columns in my grid no longer line up with the header. This issue goes away completely if I remove static headers and scrolling but I need both of those things. This is the grid creation code from the code behind in C#:
protected virtual void SetupGridProperties(int pageSize)
        {
            _gridObj.Width = Unit.Percentage(97);
            _gridObj.Height = Unit.Percentage(95);
 
            _gridObj.ID = "gridRpt";
            _gridObj.Skin = ConfigurationManager.AppSettings.Get("WebGridStyle");
 
            _gridObj.AllowPaging = true;
            _gridObj.PageSize = pageSize;
            _gridObj.PagerStyle.Mode = GridPagerMode.NextPrevNumericAndAdvanced;
            _gridObj.PagerStyle.Position = GridPagerPosition.Top;
            _gridObj.PagerStyle.AlwaysVisible = false;
            
            _gridObj.AllowSorting = true;
            _gridObj.GridLines = GridLines.Both;
 
 
            _gridObj.AllowMultiRowSelection = false;
 
             
            _gridObj.ClientSettings.AllowColumnsReorder = true;
            _gridObj.ClientSettings.ColumnsReorderMethod = GridClientSettings.GridColumnsReorderMethod.Reorder;
             
            _gridObj.ClientSettings.Selecting.AllowRowSelect = true;
            _gridObj.ClientSettings.Selecting.CellSelectionMode = GridCellSelectionMode.SingleCell;
            _gridObj.ClientSettings.Selecting.CellSelectionMode = GridCellSelectionMode.MultiCell;
           // _gridObj.ClientSettings.Selecting.AllowCellSelect = true;
           // _gridObj.ClientSettings.Selecting.AllowMultiCellSelect = true;
 
            _gridObj.ClientSettings.ClientEvents.OnGridCreated = "gridRpt_GridCreated";
            //_gridObj.ClientSettings.ClientEvents.OnRowMouseOver = "_gridObj_RowMouseOver";
            _gridObj.ClientSettings.ClientEvents.OnRowSelecting = "gridRpt_OnRowSelecting";
            _gridObj.ClientSettings.ClientEvents.OnRowDeselecting = "gridRpt_OnRowDeSelecting";
            _gridObj.ClientSettings.ClientEvents.OnRowClick = "gridRpt_OnRowClick";
 
            //_gridObj.ClientSettings.Resizing.AllowRowResize = true;
 
            _gridObj.ClientSettings.Scrolling.AllowScroll = true;
            _gridObj.ClientSettings.Scrolling.UseStaticHeaders = true;
              
 
            _gridObj.GroupPanel.Visible = false;
            _gridObj.ClientSettings.AllowDragToGroup = true;
 
            _gridObj.GroupingEnabled = true;
            _gridObj.ShowGroupPanel = true;
            _gridObj.GroupPanel.Enabled = true;
 
            _gridObj.MasterTableView.TableLayout = GridTableLayout.Auto;
             
 
 
 
            _gridObj.ItemStyle.VerticalAlign = VerticalAlign.Middle;
 
            //this._gridObj.ExportSettings.IgnorePaging = true;
            //this._gridObj.ExportSettings.OpenInNewWindow = true;
            //this._gridObj.ExportSettings.IgnorePaging = true;
 
            _gridObj.MasterTableView.SortExpressions.AllowNaturalSort = false;
 
 
            _gridObj.MasterTableView.HierarchyLoadMode = GridChildLoadMode.ServerBind;
 
            _gridObj.AutoGenerateColumns = false;
            _gridObj.MasterTableView.AutoGenerateColumns = false;
 
 
        }


This is a link to what I am seeing: BROKEN GRID . This only happens when I drag a column to group by.
Pavlina
Telerik team
 answered on 04 Dec 2012
7 answers
655 views
I am facing an issue while using RadGrid. I need horizontal scroll within grid because I have too many columns to show in the grid  and control is providing me that which good enough for me. Problem is that grid is causing horizontal scroll on page and which is very odd for application view. can anybody help me out for this?
Pavlina
Telerik team
 answered on 04 Dec 2012
3 answers
133 views
Hi,
when I upload the image is sent but does not appear radprogressarea, why?

<form id="form1" runat="server">
    <div>
         <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
        <telerik:RadProgressManager ID="RadProgressManager1" Runat="server" />
        <br />
        <table style="width:100%;">
            <tr>
                <td>
                    <telerik:RadUpload ID="RadUpload1" Runat="server"
                        AllowedFileExtensions=".jpg,.jpeg" OverwriteExistingFiles="True"
                        TargetFolder="image/image_utenti">
                    </telerik:RadUpload>
                </td>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="Nessun file caricato"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadProgressArea ID="RadProgressArea1" Runat="server">
                    </telerik:RadProgressArea>
                </td>
                <td>
                    <asp:Repeater ID="Repeater1" runat="server" Visible="False">
                                        <HeaderTemplate>
                                        <div class="title">
                                        File caricato:</div>
                                        </HeaderTemplate>
                                        <ItemTemplate>
                                            <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                                            <%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>
                                            <br />
                                        </ItemTemplate>
                    </asp:Repeater>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="Button1" runat="server" Text="Button" />
                </td>
                <td>
                     </td>
            </tr>
        </table>
     
    </div>
    </form>

Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.IO
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports Telerik.Web.UI
Public Class UploadImgCard
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    End Sub
 
    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        If RadUpload1.UploadedFiles.Count > 0 Then
            Repeater1.DataSource = RadUpload1.UploadedFiles
            Repeater1.DataBind()
            Label1.Visible = False
            Repeater1.Visible = True
        Else
            Label1.Visible = True
            Repeater1.Visible = False
        End If
    End Sub
    Private callBack As CacheItemRemovedCallback
    Private Sub AddDeleteDependencyForFile(ByVal uploadedFileCollection As UploadedFileCollection)
        Dim uploadedFile As UploadedFile
        For Each uploadedFile In uploadedFileCollection
            Dim timeOut As TimeSpan = TimeSpan.FromMinutes(5)
 
            callBack = New CacheItemRemovedCallback(AddressOf DeleteFile)
 
            Dim fullPath As String = Path.Combine(Server.MapPath(RadUpload1.TargetFolder), uploadedFile.GetName())
 
            Context.Cache.Insert(uploadedFile.FileName, fullPath, Nothing, DateTime.Now.Add(timeOut), TimeSpan.Zero, CacheItemPriority.Default, callBack)
        Next
    End Sub
    Private Sub DeleteFile(ByVal key As String, ByVal path As Object, ByVal reason As CacheItemRemovedReason)
        File.Delete(DirectCast(path, String))
    End Sub
    Protected Sub RadUpload1_FileExists(sender As Object, e As Telerik.Web.UI.Upload.UploadedFileEventArgs) Handles RadUpload1.FileExists
        Dim counter As Integer = 1
 
        Dim file As UploadedFile = e.UploadedFile
 
        Dim targetFolder As String = Server.MapPath(RadUpload1.TargetFolder)
 
        Dim targetFileName As String = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension())
 
        While System.IO.File.Exists(targetFileName)
            counter += 1
            targetFileName = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension())
        End While
 
        file.SaveAs(targetFileName)
 
    End Sub
End Class
Kate
Telerik team
 answered on 04 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?