Telerik Forums
UI for ASP.NET AJAX Forum
9 answers
338 views
I have a radgrid that uses a usercontrol for its edit form... I have the progress area and the manager on the page with the grid.

The form works fine as long as i dont place a file in the upload control... but if i select a file, when i press the insert button, the page comes with an: internet explorer cannot display the web page...
if i use firefox:
I get this err: The connection was reset
The connection to the server was reset while the page was loading.

How can I get the radupload with progress area to work in a webusercontrol inside of a radgrid ?

Any help would be appreciated

Jeff



Genady Sergeev
Telerik team
 answered on 23 Aug 2010
6 answers
245 views
Hi,

I have an edit form that has previously contained an asp CheckBoxList. I want to change it to use a RadListBox as I have done throughout the rest of the site to make apply styles consistently using AppTheme skinning.

But this edit form initially disables all controls until the user clicks an edit button which enables them. It works with all other RadControls I have in the form (RadComboBox, RadTreeView, RadMaskedTextBox and RadToolTip) but unfortunately when applied in the same way to the RadListBox the client can still check checkboxes and/or select items in the RadListBox.

The function used to disable/enable the controls is as follows:
private static void DisablePageControls(Control myControl, Boolean setEdit)
{
    foreach (Control cntrl in myControl.Controls)
    {
        switch (cntrl.GetType().ToString())
        {
            case "System.Web.UI.WebControls.TextBox":
                ((TextBox)cntrl).Enabled = setEdit;
                break;
            case "Telerik.Web.UI.RadTreeView":
                ((RadTreeView)cntrl).Enabled = setEdit;
                break;
            case "Telerik.Web.UI.RadMaskedTextBox":
                ((RadMaskedTextBox)cntrl).Enabled = setEdit;
                break;
            case "Telerik.Web.UI.RadToolTip":
                ((RadToolTip)cntrl).Enabled = setEdit;
                break;
            case "Telerik.Web.UI.RadDatePicker":
                ((RadDatePicker)cntrl).Enabled = setEdit;
                break;
            case "System.Web.UI.WebControls.DropDownList":
                ((DropDownList)cntrl).Enabled = setEdit;
                break;
            case "System.Web.UI.WebControls.CheckBox":
                ((CheckBox)cntrl).Enabled = setEdit;
                break;
            case "System.Web.UI.WebControls.LinkButton":
                ((LinkButton)cntrl).Enabled = setEdit;
                break;
            case "System.Web.UI.WebControls.CheckBoxList":
                ((CheckBoxList)cntrl).Enabled = setEdit;
                break;
            case "Telerik.Web.UI.RadComboBox":
                ((RadComboBox)cntrl).Enabled = setEdit;
                break;
            case "Telerik.Web.UI.RadListBox":
                ((RadListBox)cntrl).Enabled = setEdit;
                break;
            default:
                break;
        }
        //Call for additional controls:
        if (cntrl.HasControls())
            DisablePageControls(cntrl, setEdit);
    }
}

I would also prefer the checkboxes/items to be "greyed out" or similar as is the case when the asp CheckBoxList is disabled.

Is this at all possible?

Cheers.
Stuart Hemming
Top achievements
Rank 2
 answered on 23 Aug 2010
1 answer
134 views
Can someone please tell me how to remove the lines from the radio button list when used in a RadGridControl? 

<telerik:GridTemplateColumn ItemStyle-Width="80px">
                                        <ItemTemplate>
                                            <asp:RadioButtonList ID="HASelection" runat="server" RepeatColumns="1" RepeatDirection="Vertical">
                                            </asp:RadioButtonList>
                                        </ItemTemplate>
                                    </telerik:GridTemplateColumn>
Dimo
Telerik team
 answered on 23 Aug 2010
1 answer
75 views
Hi,

I am struggling to style a grid, I am using Telerik RadControls for ASPNET AJAX Q2 2008.  I created a test project with a Default.aspx page and referenced the Telerik.Web.UI.dll and dropped a grid on the default page.  Nothing more.  I binded some data to the grid and the grid displayed and there was already styles associated with it.  Where do these styles come from?  I did not copy any of the installed skins to my web project.

The skinning seems to be different from previous versions of Telerik.  In an older project that I worked on, I created a RadControls directory, and then something like Grid/Skins/Default/Styles.css.  How does the directory structure have to look like for ASPNET AJAX Q2 2008.  If I go to the installed directory then it would like something like C:\Program Files\Telerik\RadControls for ASPNET AJAX Q2 2008\Skins\Default.

What I am trying to say is that I would change some header text to red (to test it) and then the text still comes out black.  Or I would change to make all the text bigger, then it still displays as the default text size.  I have checked out the articles online and they don't help much.

Can someone please help me on the correct path to do this styling the right way?

Thanks
Brendan
Dimo
Telerik team
 answered on 23 Aug 2010
1 answer
95 views
I m using Radtool tip manager with rad tree view but the tool tip shows the same contents every time even though the Id passed to custom control used to be loaded in tool tip changed but content of the custom control does't changes
Fiko
Telerik team
 answered on 23 Aug 2010
1 answer
358 views
Is there anyway to change the value of a hidden field during postback?
I need to change the asp hidden field during a button click event, but the hidden field value doesn't get retained after the postback.

The button is within a RadAjaxPanel.

I added it to the RadAjaxPanel containing the button, and I also tried additing to RadAjaxManager (see below) but it didn't make any difference.

<

 

telerik:AjaxSetting AjaxControlID="Button" >

 

 

<UpdatedControls>

 

 

<telerik:AjaxUpdatedControl ControlID="hiddenfield" />

 

 

</UpdatedControls>

 

 

</telerik:AjaxSetting>



 

Sebastian
Telerik team
 answered on 23 Aug 2010
4 answers
320 views
HI,

I have a small form with a radcombobox and 2 radtextboxes as below:

 

<asp:Label ID="lblHeaderPrinter" runat="server" Text="" Font-Bold="true" Font-Underline="true"></asp:Label>

 

<table>

 

 

 

<tr>

 

 

 

<td>Manufacturer:</td>

 

 

 

</tr>

 

 

 

<tr 

<td>

 

<telerik:RadComboBox ID="ddlManufacturer2" AutoPostBack="true" runat="server"

 

 

 

AppendDataBoundItems="true" Skin="Windows7" OnSelectedIndexChanged="ddlManufacturer2_SelectedIndexChanged">  

</telerik:RadComboBox>

 

</td 

</tr>

 

</table 

<table>

 

<tr 

<td>Model #:</td>

 

<td>Price:</td 

</tr>

 

<tr 

<td><telerik:RadTextBox ID="txtPrinterModel" Width="400px" runat="server"></telerik:RadTextBox></td>

 

<td>$<telerik:RadTextBox ID="txtPrinterPrice" runat="server"></telerik:RadTextBox></td 

</tr 

 

</table>

 

<table><tr><td 

<asp:Button ID="btnAddPrinter" runat="server" Text="ADD Printer" OnClick="btnAddPrinter_Click" />

 

<asp:Button ID="btnClearP" runat="server" Text="Clear" OnClick="btnClearP_Click" /></td></tr></table 

<asp:Label ID="lblPConfirm" runat="server" Text="" Font-Bold="true" ForeColor="Red"></asp:Label>

 

So, I've noticed that when I click Add Printer, the form data inserts in my database with the exception of the txtPrinterModel text.  Upon further playing around, I discovered that if i have the txtPrinterModel and txtPrinterPrice fields filled in, and then change the selected value of the combobox, the txtPrinterModel field clears out, but the txtPrinterPrice does not.  Why would this be the case?  How can I prevent the autopostback on the comobbox from affecting the txtPrinterModel text box?  I do NOT want to turn the autopost back to false because I'd like to use validator controls, and the ddlManufacturer2_SelectedIndexChanged clears my label out, among other functionality that I'd like to add later.

As of now, the code for ddlManufacturer2_SelectedIndexChanged looks like this and has no interaction with txtPrinterModel

 

public

 

 

void ddlManufacturer2_SelectedIndexChanged(object sender, EventArgs e)

{

lblPConfirm.Text =

 

"";

 

 

}

 

 


All of this is on a user control which has a RadAjaxManagerProxy, however, no ajax settings for any of these controls.  The RadAjaxManager on the main page also has no ajax settings at the moment.

Please help. I've been trying to fix this issue for 2 days!!!!

Thanks,
Jason
Simon
Telerik team
 answered on 23 Aug 2010
6 answers
172 views
I want to provide a "Refresh" link for the user if the Callback fails...is there a way to get the posted Error Value in the Error Callback Method somehow?
Pero
Telerik team
 answered on 23 Aug 2010
1 answer
76 views
Hi,


I have requirement to modify the grid header, so that it should full fill our current requirement.

  1. Displaying  x of x Orders  should be on the first row
  2. On the 2nd row, 'Display 10 records per page' should be left aligned
  3. On the same row ( 2nd ), the page navigator should be right aligned.
  4. The width of the grid should not be less than 'Max width of page navigator' + 'Display x records per page'



Thanks in advance
Dimo
Telerik team
 answered on 23 Aug 2010
1 answer
154 views
I have been working on a SharePoint application page that has a RadGrid on it, I've finally managed to get it displaying more or less how i want it, but the cell alignment seems a little odd, and when I try to add a skin it gives me an error saying that the skin wasn't found or something like that. I've attached the aspx and codebehind file, and also a screen of how it is displaying now, I would appreciate any help.

<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/_layouts/application.master" CodeBehind="~/Pages/VersionHistory.aspx.cs"
         Inherits="BlackBlade.ListActions.DocumentSectionManager.Monitor.VersionHistory, BlackBlade.ListActions.DocumentSectionManager.Monitor,Version=1.0.0.0,Culture=neutral,PublicKeyToken=932c3000eeb6dd9c"
    %>
<%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls"
    Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
 
<%@ Register Assembly="Telerik.Web.UI, Version=2008.3.1125.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="cc1" %>
 
<asp:Content ID="Main" runat="server" contentplaceholderid="PlaceHolderMain" >   
 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <!-- content start -->
        
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
         
        <telerik:RadGrid ID="RadGrid1" CssClass=RadGrid runat="server" OnColumnCreated="RadGrid1_ColumnCreated"
            OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound">
            <MasterTableView CssClass=rgClipCells HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" AllowSorting="true"
                DataKeyNames="GUID, ParentGUID" Width="100%">
                <SelfHierarchySettings ParentKeyName="ParentGUID" KeyName="GUID" />
            </MasterTableView>
            <ClientSettings AllowExpandCollapse="true" />
        </telerik:RadGrid>
     
        <!-- content end --> 
     
</asp:Content>
 
<asp:Content ID="PageTitle" runat="server"
             contentplaceholderid="PlaceHolderPageTitle" >
   Version History
</asp:Content>
 
<asp:Content ID="PageTitleInTitleArea" runat="server"
             contentplaceholderid="PlaceHolderPageTitleInTitleArea" >
   BlackBlade Version History
</asp:Content>

using System;
using Telerik.Web.UI;
using Microsoft.SharePoint;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.Reflection;
using System.Collections.Generic;
using Microsoft.SharePoint.WebControls;
using System.Data;
 
namespace BlackBlade.ListActions.DocumentSectionManager.Monitor
{
    public partial class VersionHistory : LayoutsPageBase
    {
        private DataTable dataTable = new DataTable();
        protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
        {
            if (e.Column is GridExpandColumn)
            {
                e.Column.Visible = false;
            }
            else if (e.Column is GridBoundColumn)
            {
                e.Column.HeaderStyle.Width = Unit.Pixel(100);
            }
        }
 
        protected override void OnLoad(EventArgs e)
        {
            try
            {
                base.OnLoad(e);
 
                string strItemId = this.Request["ItemID"];
                string strListId = this.Request["ListID"];
 
                SPWeb site = this.Web;
                SPList list = site.Lists[new Guid(strListId)];
                SPListItem item = list.GetItemById(Convert.ToInt32(strItemId));
                 
                ColumnSetup();
                 
                VersionCollectionTree tree = new VersionCollectionTree(item);
                PopulateData(tree.headers[0], "root");
                RadGrid1.DataSource = dataTable;
 
                RadGrid1.MasterTableView.FilterExpression = "ParentGUID = 'root'";
            }
            catch
            {
            }
        }
 
 
 
        protected override void  OnPreRenderComplete(EventArgs e)
        {
            base.OnPreRenderComplete(e);
            HideExpandColumnRecursive(RadGrid1.MasterTableView);
 
            RadGrid1.MasterTableView.GetColumn("GUID").Visible = false;
            RadGrid1.MasterTableView.GetColumn("ParentGUID").Visible = false;
 
             
        }
 
        public void HideExpandColumnRecursive(GridTableView tableView)
        {
            GridItem[] nestedViewItems = tableView.GetItems(GridItemType.NestedView);
            foreach (GridNestedViewItem nestedViewItem in nestedViewItems)
            {
                foreach (GridTableView nestedView in nestedViewItem.NestedTableViews)
                {
                    nestedView.Style["border"] = "0";
                    nestedView.GetColumn("GUID").Visible = false;
                    nestedView.GetColumn("ParentGUID").Visible = false;
 
                    Button MyExpandCollapseButton = (Button)nestedView.ParentItem.FindControl("MyExpandCollapseButton");
                    if (nestedView.Items.Count == 0)
                    {
                        if (MyExpandCollapseButton != null)
                        {
                            MyExpandCollapseButton.Style["visibility"] = "hidden";
                        }
                        nestedViewItem.Visible = false;
                    }
                    else
                    {
                        if (MyExpandCollapseButton != null)
                        {
                            MyExpandCollapseButton.Style.Remove("visibility");
                        }
                    }
 
                    if (nestedView.HasDetailTables)
                    {
                        HideExpandColumnRecursive(nestedView);
                    }
                }
            }
        }
 
        protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
        {
            CreateExpandCollapseButton(e.Item, "Title");
 
            if (e.Item is GridHeaderItem && e.Item.OwnerTableView != RadGrid1.MasterTableView)
            {
                e.Item.Style["display"] = "none";
            }
 
            if (e.Item is GridNestedViewItem)
            {
                e.Item.Cells[0].Visible = false;
            }
        }
 
        protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            CreateExpandCollapseButton(e.Item, "Title");
        }
 
        public void CreateExpandCollapseButton(GridItem item, string columnUniqueName)
        {
            if (item is GridDataItem)
            {
                if (item.FindControl("MyExpandCollapseButton") == null)
                {
                    Button button = new Button();
                    button.Click += new EventHandler(button_Click);
                    button.CommandName = "ExpandCollapse";
                    button.CssClass = (item.Expanded) ? "rgCollapse" : "rgExpand";
                    button.ID = "MyExpandCollapseButton";
 
                    if (item.OwnerTableView.HierarchyLoadMode == GridChildLoadMode.Client)
                    {
                        string script = String.Format(@"$find(""{0}"")._toggleExpand(this, event); return false;", item.Parent.Parent.ClientID);
 
                        button.OnClientClick = script;
                    }
 
                    int level = item.ItemIndexHierarchical.Split(':').Length;
                    if (level > 1)
                    {
                        button.Style["margin-left"] = level * 10 + "px";
                    }
 
                    TableCell cell = ((GridDataItem)item)[columnUniqueName];
                    cell.Controls.Add(button);
                    cell.Controls.Add(new LiteralControl(" "));
                    cell.Controls.Add(new LiteralControl(((GridDataItem)item)[columnUniqueName].Text.ToString()));
                }
            }
        }
 
        void button_Click(object sender, EventArgs e)
        {
            ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand";
        }
 
        private void ColumnSetup()
        {
            dataTable.Columns.Add("Title", typeof(string));
            dataTable.Columns.Add("Version");
            dataTable.Columns.Add("Modified");
            dataTable.Columns.Add("User");
            dataTable.Columns.Add("Size");
            dataTable.Columns.Add("Comment");
            dataTable.Columns.Add("GUID", typeof(string));
            dataTable.Columns.Add("ParentGUID", typeof(string));
        }
 
        private void PopulateData(VersionCollectionTree.Node node, string parentGUID)
        {
            DataRow row = dataTable.NewRow();
 
            string GUID = node.versionCollection.latest.file.UniqueId.ToString();
 
            row["GUID"] = GUID;
            row["ParentGUID"] = parentGUID;
            row["Title"] = node.versionCollection.latest.file.Name;
            row["Version"] = node.versionCollection.latest.versionLabel;
            row["Modified"] = node.versionCollection.latest.created;
            row["User"] = node.versionCollection.latest.user.Name;
            row["Size"] = node.versionCollection.latest.size;
            row["Comment"] = node.versionCollection.latest.comment;
            dataTable.Rows.Add(row);
 
            if (node.hasChildren)
            {
                foreach (VersionCollectionTree.Node child in node.children)
                {
                    PopulateData(child, GUID);
                }
            }
        }
    }
}

Thanks,
Alex
Dimo
Telerik team
 answered on 23 Aug 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?