Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
540 views
I want to change the background color of the modal overlay from the default gray color to something more consistent with other overlays I am using in my application.  I see that there is access to the TelerikModalOverlay class, however, the div that this is part of has an inline style for the color.  Is there any way to set the color?

The html for the overlay is below:
<div class="TelerikModalOverlay" style="position: absolute; left: 0px; top: 0px; z-index: 7999; background-color: rgb(170, 170, 170); opacity: 0.5; width: 1904px; height: 825px;" unselectable="on"/> 
Georgi Tunev
Telerik team
 answered on 05 Mar 2009
2 answers
498 views

Hi all,

I'm trying to use and customize my radCombox. I created a custom template class which implements ITemplate in order to create multi-columns (4 cols) combo. All have to be done dynamically in the code-behind... I use Internet Explorer 7, and the version of Telerik.Web.UI is 2008.3.1105.20.

First of all I initialize the templates in the Init() method of the page and set them to the combobox.
After I just bind a collection objects to the combobox.
The result is that the headerTemplate table is well sized, its width takes 100% of the container. In the ItemTemplate, the size of the table is not well sized because I suppose the table is contained in ul and li tag which generated by radcombobox.
 
How can I created a table dynamically and set its width to 100% in itemTemplate? Does anyone have an idea?
Find below a little portion of code that may help you...

protected void Page_Init(object sender, EventArgs e)

{

    HeaderTemplate headertemplate = new HeaderTemplate();

    ItemTemplate itemtemplate = new ItemTemplate();

    this.cbxLocation.HeaderTemplate = headertemplate;

    this.cbxLocation.ItemTemplate = itemtemplate;

}

 

public class HeaderTemplate : ITemplate

{

    #region ITemplate Members

        public void InstantiateIn(Control container)

        {

            HtmlTable table = new HtmlTable();

            table.Width = Unit.Percentage(100).ToString();

            HtmlTableRow row = new HtmlTableRow();

            HtmlTableCell cell;

            for (int i = 1; i <= 4; i++)

            {

                cell = new HtmlTableCell();

                cell.Width = Unit.Percentage(100 / 4).ToString();

                switch (i)

                {

                    case 1: cell.InnerText = "Column 1";

                                break;

                    case 2: cell.InnerText = "Column 2";
                                break
;

                    case 3: cell.InnerText = "Column 3";

                                break;

                    case 4: cell.InnerText = "Column 4";

                                break;

               }

               row.Controls.Add(cell);

            }

            table.Controls.Add(row);

            container.Controls.Add(table);

    }

    #endregion

}


 

 

public class ItemTemplate : ITemplate

 

 

 

{

 

 

 

 

#region

ITemplate Members

 

 

    public void InstantiateIn(Control container)

 

    {

 

        HtmlTable table = new HtmlTable();

 

        table.Width =

Unit.Percentage(100).ToString();

 

 

        HtmlTableRow row = new HtmlTableRow();

 

 

        HtmlTableCell cell;

 

 

        for (int i = 1; i <= 4; i++)

 

        {

                cell =

new HtmlTableCell();
                cell.Width = Unit.Pixel(100 / 4).ToString();

 

 

                switch (i)

 

                {

 

                     case 1:

 

                         cell.InnerText = "Data 1";

                         break;

 

 

                    case 2:

 

                         cell.InnerText = "Data 2";

                        break;

 

 

                    case 3:

 

                         cell.InnerText = "Data 3";

                        break;

 

 

                    case 4:

 

                         cell.InnerText = "Data 4";

                        break;

 

                }

                row.Controls.Add(cell);

        }

        table.Controls.Add(row);

        container.Controls.Add(table);

    }

 

 

#endregion


}

 

Thanks for your help

 

Osman
Top achievements
Rank 1
 answered on 05 Mar 2009
1 answer
111 views
Heloo,
I want to use Required field validation in Edit form.
Is it possible to use Purely client side?
Thanks in advance.
-Mahesh. 
Princy
Top achievements
Rank 2
 answered on 05 Mar 2009
2 answers
99 views
If the user is sorting a column in a grid, is there any event which I can use to react on his sorting?

thanks

Christian
Christian
Top achievements
Rank 1
 answered on 05 Mar 2009
3 answers
100 views
Hello.

I know that this is a bug which currently solved in last internal build. My question is: how to install this last internal build. There are many files in that compressed file but I need only bin 3.5 library. There are also some scripts etc.

I need to put it right to product environment...

Thank you very much.

Tom

Rosen
Telerik team
 answered on 05 Mar 2009
1 answer
162 views
I have a self-referencing grid that I created by copying a Telerik example and modifying a few fields to match my application.  When I look at the data table that is being used for the grid, I have 444 rows.  I checked the first row and there are columns for the datakeys that I have defined and there is data in the columns.  However, when the grid loads, it just says "No data to display".  Here is my code:

<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Outlook" OnColumnCreated="RadGrid1_ColumnCreated" 
        OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound" 
        GridLines="None" OnNeedDataSource="RadGrid1_NeedDataSource">  
        <MasterTableView CommandItemDisplay="None" HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" 
            AllowSorting="false" DataKeyNames="OrganizationID, ParentOrganizationID" Width="100%" AutoGenerateColumns="False">  
            <SelfHierarchySettings ParentKeyName="ParentOrganizationID" KeyName="OrganizationID" MaximumDepth="5" /> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="OrganizationID" HeaderText="OrganizationID" 
                    ReadOnly="True" UniqueName="OrganizationID">  
                </telerik:GridBoundColumn> 
                <telerik:GridBoundColumn DataField="Total" HeaderText="Total" UniqueName="Total">  
                </telerik:GridBoundColumn> 
            </Columns> 
        </MasterTableView> 
        <ClientSettings AllowExpandCollapse="true" /> 
        <FilterMenu Skin="Outlook" EnableTheming="True">  
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        </FilterMenu> 
    </telerik:RadGrid> 

protected void Page_Load(object sender, EventArgs e)  
        {  
            if (Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("3.5") != -1)  
            {  
                RadGrid1.MasterTableView.FilterExpression = @"it[""ParentOrganizationID""] = Convert.DBNull";  
            }  
            else 
            {  
                RadGrid1.MasterTableView.FilterExpression = "ParentOrganizationID IS NULL";  
            }  
        }  
 
        protected void RadGrid1_ColumnCreated(object sender, Telerik.Web.UI.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 void RadGrid1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)  
        {  
            //Hide headers without MasterTableView's header  
            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, Telerik.Web.UI.GridItemEventArgs e)  
        {  
            //Create Expand/Collapse button for each table view  
            CreateExpandCollapseButton(e.Item, "OrganizationID");  
        }  
 
        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("&nbsp;"));  
                    cell.Controls.Add(new LiteralControl(((GridDataItem)item).GetDataKeyValue(columnUniqueName).ToString()));  
                }  
            }  
        }  
 
 
        public void Page_PreRenderComplete(object sender, EventArgs e)  
        {  
            HideExpandColumnRecursive(RadGrid1.MasterTableView);  
        }  
 
        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";  
 
                    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 button_Click(object sender, EventArgs e)  
        {  
            ((Button)sender).CssClass = (((Button)sender).CssClass == "rgExpand") ? "rgCollapse" : "rgExpand";  
        }  
 
        protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)  
        {  
            RadGrid1.DataSource = MyDataTable;  
        }  
 
        private DataTable MyDataTable  
        {  
            get 
            {  
                object obj = Session["GridData"];  
                if ((!(obj == null)))  
                {  
                    return ((DataTable)(obj));  
                }  
                DataTable myDataTable = GetDataTable(); //call to service layer - returns 444 rows  
                Session["GridData"] = myDataTable;  
                return myDataTable;  
            }  
        } 
Tsvetoslav
Telerik team
 answered on 05 Mar 2009
5 answers
117 views
Helo,

I have an error with RadUpload:

I can't select a file with the button "select" until I have clickd the button "clear".

Has anyone an idea how to fix this?

regards
Christian
Genady Sergeev
Telerik team
 answered on 05 Mar 2009
1 answer
96 views
Is it just me, or is it common for the page to do a PostBack (flicker) the first time the RadAjaxManagerProxy is used?

I've placed a RadAjaxManagerProxy on my page (actually, it's a template for a custom module in Sitefinity), and set the AjaxControlId and the ControlId to the name of a panel on my page. This panel wraps a bunch of textboxes, dropdown lists and buttons that are on a page. When I select an item in a dropdown, or click on a button, the page does what looks like a post back (flickers). After this though, whenever I click on a button or select an item in the dropdown, the action is performed without the flicker.

The RadAjaxManagerProxy is on several custom module templates, and this behaviour happens on all of them.

Thanks,
Carl J
Rosen
Telerik team
 answered on 05 Mar 2009
1 answer
153 views
Hi,

I have an issue with a maximised RadWindow.   I am programattically adding a RadWindow to the WindowManager described below.  

     <telerik:RadWindowManager ID="ucRadWindowManager" runat="server" RestrictionZoneID="divRadZone" 
         KeepInScreenBounds="true">  
         <Windows> 
            <telerik:RadWindow ID="RadWindow1" runat="server">  
            </telerik:RadWindow> 
         </Windows> 
      </telerik:RadWindowManager> 

When I open the window, I am opening it maximised.  When the RadWindow opens, the parent window underneath adjusts itself and the width and height of the page both extend beyond 100%, which means that scroll bars appear on both axis. 
When using the built-in 'Close' in the corner of the RadWindow to close, the parent window adjusts itself and the scroll bars disappear.  However, when using a button in the RadWindow as a mean of closing, the readjustment of the parent window does not occur and you are left with scroll bars and part of the parent page has now extending beyond 100%.

This only occurs when the RadWindow is opened maximised.

I am closing the RadWindow using this code :

      function GetRadWindow() {  
         var oWindow = null;  
         oWindow = window.frameElement.radWindow;  
         return oWindow;  
      }  
 
         GetRadWindow().close();  
     

In an attempt to combat this issue I am trying to utilise a restriction zone for the RadWindow.

I have the DIV for the RestrictionZone set up as follows :

<div id="divRadZone" style="position: absolute; left: 0px; top: 40px; width: 800px; height:400px; z-index:0;"

This works fine, with one important and serious limitation.  The div appears over a RadTree, and the + symbols are not able to be clicked through the DIV.  The node names can be clicked, just not the '+' expanding icon.

As you can see, I have 2 issues here, a solution to either would be fantastic!

Regards,

Sean Duffy
Georgi Tunev
Telerik team
 answered on 05 Mar 2009
3 answers
399 views
Hi,

I am showing a radtooltip(which is having some controls and a save button) onclik of a image button which is in radGrid,

Now my question is I want to close the tooltip automatically after clicking on save button and at the same time, the radGrid shold be refreshed ?
my tooltip decleration is as follows

 

<telerik:GridTemplateColumn HeaderText="Status" UniqueName="TemplateColumn">

 

 

 

<ItemTemplate>

 

 

 

 

<asp:ImageButton ID="Img" runat="server" ImageUrl='<%#DataBinder.Eval(Container.DataItem, "Image") %>' />

 

 

 

<telerik:RadToolTip ID="RadToolTip1" runat="server" Height="200px" Width="500px"

 

 

 

TargetControlID="Img" ManualClose="True" Position="TopRight" ShowCallout="False"

 

 

 

Skin="Gray">

 

 

 

<div id="NessCheck" runat="server">

 

 

 

<asp:Image ID="Imagt" runat="server" ImageUrl="~/images/screen.gif" />

 

 

 

<asp:Label ID="lblOld" Text="( Old Screen Shot )" runat="server" />

 

 

 

<asp:LinkButton ID="lDetails" Text="View Detail" runat="server" />

 

 

 

<br />

 

 

 

<br />

 

 

 

<asp:Label ID="lblDocument" Text="Do you want to attach ?" runat="server" />

 

 

 

&nbsp

 

 

 

<input type="radio" id="rbYes" value="Yes" name="screenshot"

 

 

 

runat="server" />

 

 

 

&nbsp

 

 

 

<input type="radio" id="rbNo" value="No" name="screenshot" runat="server" />

 

 

 

</div>

 

 

 

<div id="CheckT" runat="server" style="display: none">

 

 

 

<asp:Label ID="lblVerification" Text=" Verification:" runat="server" />

 

 

 

<asp:TextBox ID="txtScreen" runat="server" />

 

 

 

&nbsp;

 

 

 

<asp:Button ID="btnBrowse" Text="Browse..." runat="server" />

 

 

 

</div>

 

 

 

<asp:Button ID="btnSave" Text="Save" CommandName="SaveFile" CommandArgument=""

 

 

 

runat="server" />

 

 

 

&nbsp;&nbsp

 

 

 

<asp:Button ID="btnCancel" Text="Cancel" runat="server" />

 

 

 

</telerik:RadToolTip>

 

 

 

<telerik:RadToolTip ID="RadToolTip2" runat="server" Height="200px" Width="500px"

 

 

 

TargetControlID="Img" ManualClose="True" Position="TopRight" ShowCallout="False"

 

 

 

Skin="Gray">

 

 

 

<div id="screenshot1" runat="server" >

 

 

 

<asp:Label ID="lblAttachs" Text="verification "

 

 

 

runat="server" />

 

 

 

<asp:TextBox ID="txtScreen" runat="server" />

 

 

 

&nbsp;

 

 

 

<asp:Button ID="btnBrowse1" Text="Browse..." runat="server" />

 

 

 

<asp:Button ID="btnSave1" Text="Save" CommandName="SaveFile" runat="server" />

 

 

 

&nbsp;&nbsp

 

 

 

<asp:Button ID="btnCancel1" Text="Cancel" runat="server" />

 

 

 

</div>

 

 

 

</telerik:RadToolTip>

 

 

 

</ItemTemplate>

 

 

 

</telerik:GridTemplateColumn>

How can I do this,

Thanks,

 

 

Svetlina Anati
Telerik team
 answered on 05 Mar 2009
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?