Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
109 views
Hi,

   I am using RCB as filter template in RadGrid. Totally i have 3 RCB filters in grid. The problem is have to get ID of this RCB at server side on " rcbFilterIssueStatus_SelectedIndexChanged ".

protected void rcbFilterIssueStatus_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
        {
             // get id of comboBox which is filter in grid
        }

Thanks in advance.


Nagarjun S.
nagarjun
Top achievements
Rank 1
 answered on 14 Apr 2009
1 answer
41.7K+ views
Hi,

Can anyone please shed some light on how to insert a selected image from image manager into the background:url('../Images/Login.png') of a DIV tag?

At the moment the image manager inserts an image with the following markup into the content area of RadEditor:

  <img alt="" src="/Images/SampleImage.jpg" />

I need to do the following process when a user selects an image from image manager, before it is pasted into the content area:

  1) Create a DIV tag with a unique ID;
  2) Place the image into a background:url style element of a DIV tag;
  3) Set the height and width properties of the DIV tag to that of the selected image.

For example the finished markup would look like the following:

<Div id="UniquieID???" STYLE="background:url('../Images/SampleImage.jpg') no-repeat; position:absolute; height: ???px; width: ???px; top: 0px; left: 0px"></Div>

I have tried many many ways to sort this probelm out and to no avail for about 3 weeks now. Please, any help whatsoever here would be greatly appreciated.

Thank you,
Grant
Tervel
Telerik team
 answered on 14 Apr 2009
4 answers
108 views
Awesome software!  I'm playing around w/the trial software, just getting my feet wet.  Everything works great so far, expect for one thing.  All the tasks that I create show up w/the recurring task icon whether they have a recurrence assigned or not.  Likewise, when I click on any item the "Editing a recurring appointment" challenge box pops up.  If I select "Edit the series" the page errors out.  Obviously because there is really no recurrence assigned.  I looked in the db and the recurrence field is empty.

Any ideas?
Matt
Top achievements
Rank 1
 answered on 14 Apr 2009
3 answers
132 views
I am implementing a drilldownable grid with two levels.  To maintain consistency and add some additional features I have subclassed the GridTemplateColumn and in the subclassed column, specify the templates to create the controls I wish to display.  This is working well.

However, when a drill down occurs and the grid performs a postback, the subclassed columns are always blank because no data-bind operation is ever called on them.  Is this a bug or is am I doing something wrong.  I wonder if the value is expected to be in the ViewState (hence no DataBind) but if so, where am I meant to persist the viewstate?

CodeBehind File

using

 

System;

 

 

 

using System.Collections.Generic;

 

 

 

using System.ComponentModel;

 

 

 

using System.Reflection;

 

 

 

using System.Web.UI;

 

 

 

using Telerik.Web.UI;

 

 


namespace 
GridColumns

 

 

{

 


#region
CodeBehind Class

 

  

 

public partial class _Default : System.Web.UI.Page

 

{

 

 

    protected void Page_Load(object sender, EventArgs e)

 

    {

    }

 

}

 

#endregion 

 

CodeBehind Class

 

 

 

 

#region Business Objects

 

 

[

DataObject(true)]

 

 

 

public class BusinessLogic

 

 

 

{

 

 

    public List<BusinessObject> GetList()

 

    {

 

        List<BusinessObject> list = new List<BusinessObject>();

 

        list.Add(

new BusinessObject() { ID = 1, Name = "A" });

 

        list.Add(

new BusinessObject() { ID = 2, Name = "B" }); 
        list.Add(
new BusinessObject() { ID = 3, Name = "C" });
        list.Add(
new BusinessObject() { ID = 4, Name = "D" });

 

 

        return list;

 

    }

 

 

    public List<ChildObject> GetChildren(int parentID)

 

 

    {

 

        List<ChildObject> list = new List<ChildObject>();

 

        list.Add(

new ChildObject() { ID = 100, Parent = parentID, Data = "QWE" });

 

        list.Add(

new ChildObject() { ID = 101, Parent = parentID, Data = "RTY" });

 

 

        return list;

 

    }

}

 

 

public class BusinessObject

 

{

 

 

    public int ID { get; set; }

 

 

    public string Name { get; set; }

 

}

 

 

public class ChildObject

 

{

 

 

    public int ID { get; set; }

 

 

    public int Parent { get; set; }

 

 

    public string Data { get; set; }

 

}

 

#endregion

 

Business Objects

 

 

 

#region 

 

TemplateColumn Classes

 

 

 

public class MyTemplateColumn : GridTemplateColumn

 

{

 

 

    public override void Initialize()

 

    {

 

        base.Initialize();

 

 

        this.ItemTemplate = new MyTemplate(this.DataField);

 

    }

}

 

 

public class MyTemplate : ITemplate

 

{

 

 

    private LiteralControl lControl;

 

 

    private string colname;

 

 

    public MyTemplate(string cName)

 

    {

        colname = cName;

    }

 

    public void InstantiateIn(System.Web.UI.Control container)

 

    {

        lControl =

new LiteralControl();

 

        lControl.ID =

"lControl";

 

        lControl.DataBinding +=

new EventHandler(lControl_DataBinding);

 

        container.Controls.Add(lControl);
    }

 

    public void lControl_DataBinding(object sender, EventArgs e)

 

    {

 

        LiteralControl l = (LiteralControl)sender;

 

 

        GridDataItem container = (GridDataItem)l.NamingContainer;

 

 

        PropertyInfo property = typeof(BusinessObject).GetProperty(colname);

 

        l.Text = property.GetValue(container.DataItem,

null).ToString();

 

    }

}

 

#endregion 

 

TemplateColumn Classes

 

 

}

ASPX File
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="GridColumns._Default" %>

 

<%

@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>

 

<%

@ Register assembly="GridColumns" namespace="GridColumns" tagprefix="me" %>

 

     

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

head runat="server">

 

 

 

<title></title>

 

</

 

head>

 

<

 

body>

 

<form id="form1" runat="server">

 

 

    <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>

 

 

 

    <div>

 

    <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="ObjectDataSource1" 
                    GridLines="None" AutoGenerateColumns="False">

 
        <

 

MasterTableView CellSpacing="-1" DataKeyNames="ID" DataSourceID="ObjectDataSource1">

 

 

 

 

 

            <DetailTables>

 

 

                <telerik:GridTableView runat="server" CellSpacing="-1" DataKeyNames="ID" DataSourceID="ObjectDataSource2">

 

 

 

                <ParentTableRelation>
                    
<telerik:GridRelationFields DetailKeyField="ParentID" MasterKeyField="ID" />
                
</ParentTableRelation>

 

 

 

               <Columns>

 

 

 

                    <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" UniqueName="ID">
                    </telerik:GridBoundColumn>

 

 

 

                    <telerik:GridBoundColumn DataField="Data" HeaderText="Data" UniqueName="Data"> 

 

                    </telerik:GridBoundColumn>

 

 

                </Columns>

 

 

 

                <RowIndicatorColumn><HeaderStyle Width="20px" /></RowIndicatorColumn>

 

 

 

                <ExpandCollapseColumn><HeaderStyle Width="20px" /></ExpandCollapseColumn>

 

 

 

            </telerik:GridTableView>

 

 

 

        </DetailTables>

 

        <

 

RowIndicatorColumn><HeaderStyle Width="20px"></HeaderStyle></RowIndicatorColumn>

 

        <

 

ExpandCollapseColumn Visible="True"><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn>
        <Columns>

 

 

 

            <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" HeaderText="ID" UniqueName="ID">

 

 

 

            </telerik:GridBoundColumn>

 

 

 


            <!-- Standard Template Column -->

 

            <telerik:GridTemplateColumn DataField="Name" HeaderText="Name" UniqueName="Name">

 

                <EditItemTemplate>

 

 

                    <asp:TextBox ID="NameTextBox" runat="server" Text='<%# Bind("Name") %>'></asp:TextBox>

 

 

 

                </EditItemTemplate>

 

 

 

                <ItemTemplate>

 

 

 

                    <asp:Label ID="NameLabel" runat="server" Text='<%# Eval("Name") %>'></asp:Label>

 

 

 

                </ItemTemplate>

 

             

 

</telerik:GridTemplateColumn>

 

 

             

<!-- Subclassed Template Column -->

 

 

            <me:MyTemplateColumn DataField="Name" HeaderText="Name" UniqueName="Name"> 

 

            </me:MyTemplateColumn>

 

 

 

 

 

        </Columns>

    </

 

MasterTableView>

 

 

 

</telerik:RadGrid>

 

 

 

 

<asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetList" 
            TypeName="GridColumns.BusinessLogic">
</
asp:ObjectDataSource>

 

 

 

 

<asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetChildren" 
            
TypeName="GridColumns.BusinessLogic">

 

 

 

    <SelectParameters>

 

 

 

        <asp:Parameter Name="parentID" Type="Int32" />

 

 

 

    </SelectParameters>

 

 

 

</asp:ObjectDataSource>

 

 

</div>

 

 

</form>

 

</

 

body>

 

</

 

html>

Thanks

 

 

 

 

Nikolay Rusev
Telerik team
 answered on 14 Apr 2009
2 answers
175 views
I have a "links" section on the site that displays links as descriptions in a column in a RadGrid.  Using the ItemCommand event I get the dataitem and establish the hyperlink or location the user can visit.  Using RegisterStartupScript and the RadWindowManager I can bring up a modal style window for the user that works great for presentation.  

protected void grdSponsoredLinks_ItemCommand(object source, GridCommandEventArgs e) 
    {    
        SponsoredLink sponsoredLink = GlobalMethods.GetController().DataCache.SponsoredLinks[e.Item.ItemIndex]; 
        switch ( e.CommandName ) 
        { 
            case "RowClick"
                { 
                    string normalizedURL = sponsoredLink.LinkNavigationURL; 
                    if ( !normalizedURL.Contains("http") ) 
                    { 
                        normalizedURL = "http://" + normalizedURL; 
                    } 
 
 
                    RadAjaxPanel ajaxPanel = (RadAjaxPanel) HTMLUtility.FindControlRecursive(this.Master, "ajaxPanelLinks");                 
                    RadWindowManager windowManager = (RadWindowManager) HTMLUtility.FindControlRecursive(this.Master, "RadWindowManagerLinks"); 
                     
                    string myScript = String.Format("$find('{0}').open('" + normalizedURL + "');", windowManager.ClientID); 
                    ScriptManager.RegisterStartupScript(this.Page, typeof(Page), "OpenWindowKey", myScript, true); 
                    
                    break
                  } 
        } 


The questions I have are:
  1. The MainMenu (RadMenu) component on the MasterPage does not remain behind the modal window when the window is moved around on the screen (using IE 7).  I tried setting the z-index using another thread in these forums (z-index) and it has no effect.  Actually the hyperlink manager dialog we use in these forums to insert hyperlinks displays the window in a modal mode and has the effect I desire.
  2. Is there a way to create a master page for the window that opens that could contain a large close or bookmark button?
  3. Setting the RadWindowManager width and height seems to correlate to the window sizes.  Is this better controlled otherwise?
  4. Once Maximized when the user browses back on the IE navigation it leaves the host page and returns to the previous page, in this case the main or default page.  Is there a way to stop that behaviour so that as the popup modal window browses back (unless they have clicked links on the "links" page they were directed to) it closes instead of navigating off the :links" page?

Thanks

Reid
Top achievements
Rank 2
 answered on 14 Apr 2009
1 answer
222 views
I know the modal EditForm is a child element of the rad grid.  Is there anyway to center the modal window on the page?  It looks pretty bad in the default position.
Pavlina
Telerik team
 answered on 14 Apr 2009
1 answer
45 views
When using EditMode="EditForms" in a RadGrid, is it possible to place the edit form at the end of the currently displayed list of items instead of the apparent default of putting the edit form at the beginning before the the list of items?

So far, I have not found any property or setting that allows me to choose where to place the edit form. Thanks.
Pavlina
Telerik team
 answered on 14 Apr 2009
1 answer
50 views
Hi,

we are using telerik grid and telerik treeview in our project. Its working fine. But recently, we got one prolem reported by our client. When he works on the page for quite long time, then there is a performance degradation.

Our page contains a Rad Treeview on left pane, which shows the hierarcy. On click of any node, we are refreshing the radgrid on right pane using the client side binding. There is no refresh anywhere on page. Is it because of javascript memory leaks.

Please do the needful.

Thanks
Vijay Joshi
Georgi Krustev
Telerik team
 answered on 14 Apr 2009
4 answers
99 views
Hi All. We have been working with RadComboBox for about 6 - 8 months. We are having a problem with the Text of the items being wider than the Width of the ComboBox. Everything works just fine when the page first loads. But when there is a postback, the Text of the items in the dropdown list do not wrap properly and all the text overlaps creating a very ugly display for the user. Any information you could provide would be helpful. Thanks very much for all of your help in the past.

Sincerely, Isaac Koss.
Yana
Telerik team
 answered on 14 Apr 2009
3 answers
117 views
Hi,

Has anyone managed to have 2 different "alignments" on a radmenu?

what i want to do is create a horisontal menu with the navigation aligned to the left and then i would like a dropdown and a label aligned to the right on the menu to choose language and show who´s logged in.

for example, (might not show up corretly in the forum)

Home | Company | Contact            (space)                     Logged in as: Username | Dropdown

I have tried several things, using 2 menu objects dident do it, when changing between skins (the site will have different skins set by the user) i got bad breakings, mis-alignment, size and height issues on the menu that holds the dropdown etc.

does anyone have an idea?
Yana
Telerik team
 answered on 14 Apr 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?