This is a migrated thread and some comments may be shown as answers.

issues with css

3 Answers 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
newbie
Top achievements
Rank 1
newbie asked on 13 Feb 2009, 12:17 AM
This is in continuation of my forum posting : http://www.telerik.com/community/forums/aspnet-ajax/grid/having-trouble-with-grid-css.aspx

I have a Grid with a NestedViewTemplate. Inside the NestedViewTemplate I load another grid.

I am having a couple of issues:

Issue #1 (I am still waiting on this from the posting above): My nestedviewtemplate display starts from the second column of the main grid. I want it to be aligned to the main grid.

Issue #2 : For some reason the data in the columns seem to be right aligned. Something is forcing them out of the grid bounds due to which all the columns and data is not properly visible.
I am unable to figure out whats pushing them to the right. My Table layout for the mastertableview is specified as fixed.

Can you please help... I am really stuck with this display issue.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 13 Feb 2009, 09:15 AM
Hi Anumeha,

Please keep try to post all your messages related to a given problem in ONE forum thread. Otherwise it is very inconvenient to track the message history and respond.

Here is a simple web page, which demonstrates how to align the left end of a NestedViewTemplate to the left end of the parent MasterTableView.

<%@ Page Language="C#" %> 
<%@ Import Namespace="System.Data" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<script runat="server"
 
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) 
    { 
        DataTable dt = new DataTable(); 
        DataRow dr; 
 
        for (int j = 1; j <= 5; j++) 
        { 
            dt.Columns.Add(String.Format("Column{0}", j)); 
        } 
 
        for (int i = 1; i <= 5; i++) 
        { 
            dr = dt.NewRow(); 
 
            for (int k = 1; k <= 5; k++) 
            { 
                dr[String.Format("Column{0}", k)] = String.Format("Column{0} Row{1}", k, i); 
            } 
            dt.Rows.Add(dr); 
        } 
 
        (sender as RadGrid).DataSource = dt
    } 
 
    protected void RadGrid1_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if (e.Column is GridExpandColumn) 
        { 
            e.Column.Visible = false
        } 
    } 
 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridNestedViewItem) 
        { 
            (e.Item as GridNestedViewItem).Cells[0].Visible = false
        } 
    } 
     
</script> 
 
<!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"
<meta http-equiv="content-type" content="text/html; charset=utf-8" /> 
<title>RadControls for ASP.NET AJAX</title> 
</head> 
<body> 
<form id="form1" runat="server"
<asp:ScriptManager ID="ScriptManager1" runat="server" /> 
 
<telerik:RadGrid 
    ID="RadGrid1" 
    runat="server" 
    Skin="Office2007" 
    OnNeedDataSource="RadGrid1_NeedDataSource" 
    OnColumnCreated="RadGrid1_ColumnCreated" 
    OnItemCreated="RadGrid1_ItemCreated"
    <MasterTableView HierarchyDefaultExpanded="true"
        <NestedViewTemplate> 
            <div style="background:#ffd;padding:8px 5px"
                This is a NestedViewTemplate 
            </div> 
        </NestedViewTemplate> 
    </MasterTableView> 
</telerik:RadGrid> 
 
</form> 
</body> 
</html> 
 


Regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Dimo
Telerik team
answered on 13 Feb 2009, 09:22 AM
P.S.

As for Issue #2, apparently it is not something in the RadGrid declaration and as far as I can see, it is not something in the RadGrid skin, which you have provided in another forum thread. So you should check your website CSS styles - there must be some text alignment causing this.

Using developer tools such as Firebug for Firefox or Web Developer Toolbar for Internet Explorer are very useful for easy debugging of such issues.

Kind regards,
Dimo
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
newbie
Top achievements
Rank 1
answered on 13 Feb 2009, 09:01 PM
Thanks I was able to resolve my Issue #1 with this.

For Issue No. # 2 I'll look closer into my custom master css.

Tags
Grid
Asked by
newbie
Top achievements
Rank 1
Answers by
Dimo
Telerik team
newbie
Top achievements
Rank 1
Share this question
or