missing grid lines in one column

2 posts, 0 answers
  1. Mario
    Mario avatar
    75 posts
    Member since:
    Jun 2009

    Posted 14 Feb 2010 Link to this post

    hi,

    i attach an image of the grid and post the code here:

    asp:

    <telerik:RadGrid ID="radGridChangelog" runat="server" AllowPaging="false" AllowSorting="false" 
                                AutoGenerateColumns="False" GridLines="Both" Width="100%" 
                                OnNeedDataSource="RadGridChangelog_NeedDatasource" 
                                OnItemDataBound="RadGridChangelog_ItemDataBound" 
                                OnItemCreated="RadGridChangelog_ItemCreated"
                                 
                                <MasterTableView DataKeyNames="id"
                                 
                                    <Columns> 
                                        <telerik:GridBoundColumn DataField="Id" Visible="false"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridTemplateColumn DataField="logtypeID" HeaderText="Logtype" UniqueName="Logtype"
                                            <ItemTemplate> 
                                                <asp:Label ID="lblLogtype" runat="server"></asp:Label> 
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridBoundColumn DataField="logdate" HeaderText="Logdate" UniqueName="Logdate"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridTemplateColumn HeaderText="User" UniqueName="User"
                                            <ItemTemplate> 
                                                <asp:Label ID="lblUser" runat="server" Text='<%# DataBinder.Eval(Container.DataItem,"User.firstname").ToString() + " " + DataBinder.Eval(Container.DataItem,"User.lastname").ToString() %>'></asp:Label> 
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridTemplateColumn DataField="message" HeaderText="Message" UniqueName="Message"
                                            <ItemTemplate> 
                                                <asp:Label ID="lblMessage" runat="server"></asp:Label> 
                                            </ItemTemplate> 
                                        </telerik:GridTemplateColumn> 
                                        <telerik:GridBoundColumn DataField="oldValue" HeaderText="OldValue" UniqueName="OldValue"
                                        </telerik:GridBoundColumn> 
                                        <telerik:GridBoundColumn DataField="newValue" HeaderText="NewValue" UniqueName="NewValue"
                                        </telerik:GridBoundColumn> 
                                    </Columns> 
                                    <RowIndicatorColumn> 
                                        <HeaderStyle Width="20px"></HeaderStyle> 
                                    </RowIndicatorColumn> 
                                    <ExpandCollapseColumn> 
                                        <HeaderStyle Width="20px"></HeaderStyle> 
                                    </ExpandCollapseColumn> 
                                     
                                </MasterTableView> 
                            </telerik:RadGrid> 

    codebehind:
    protected void RadGridChangelog_NeedDatasource(object source, GridNeedDataSourceEventArgs e) 
            { 
                RadGrid radGrid = source as RadGrid; 
                radGrid.DataSource = BLDocLog.GetDocLogs(CacheHelper.Instance.Document.id); 
            } 
     
    protected void RadGridChangelog_ItemCreated(object sender, GridItemEventArgs e) 
            { 
                if (e.Item is GridHeaderItem) 
                { 
                    GridHeaderItem headerItem = e.Item as GridHeaderItem; 
     
                    LiteralControl literal = headerItem["Logtype"].Controls[0] as LiteralControl; 
                    literal.Text = LanguageHelper.GetText("Logtype"); 
     
                    literal = headerItem["Logdate"].Controls[0] as LiteralControl; 
                    literal.Text = LanguageHelper.GetText("Logdate"); 
     
                    literal = headerItem["Message"].Controls[0] as LiteralControl; 
                    literal.Text = LanguageHelper.GetText("Message"); 
     
                    literal = headerItem["OldValue"].Controls[0] as LiteralControl; 
                    literal.Text = LanguageHelper.GetText("OldValue"); 
     
                    literal = headerItem["NewValue"].Controls[0] as LiteralControl; 
                    literal.Text = LanguageHelper.GetText("NewValue"); 
                } 
            } 
     
    protected void RadGridChangelog_ItemDataBound(object sender, GridItemEventArgs e) 
            { 
                if (e.Item is GridDataItem) 
                { 
                    GridDataItem item = (GridDataItem)e.Item; 
                    DocLog log = item.DataItem as DocLog; 
     
                    if ((log.logtypeID == 0 || log.logtypeID == 1 ) && log.ValueNameID > -1) 
                    { 
                        System.Web.UI.WebControls.Label lblMessage = item.FindControl("lblMessage"as System.Web.UI.WebControls.Label; 
                        lblMessage.Text = LanguageHelper.GetText("logValueName" + log.ValueNameID.ToString()); 
                    } 
                    else 
                    { 
                        System.Web.UI.WebControls.Label lblMessage = item.FindControl("lblMessage"as System.Web.UI.WebControls.Label; 
                        lblMessage.Text = log.message ?? ""
                    } 
     
                    System.Web.UI.WebControls.Label lblLogtype = item.FindControl("lblLogtype"as System.Web.UI.WebControls.Label; 
                    lblLogtype.Text = LanguageHelper.GetText("logtype" + log.logtypeID.ToString()); 
                } 
            } 

    as you see in the attached image, the GridTemplateColumn DataField="message" is missing its gridlines in some rows. i dont know why its doing that. all other columns show their grid lines.

    telereik dll version: 2009.3.1103.35
    IE version: 7.0.5730.13CO

    thx mario



  2. Daniel
    Admin
    Daniel avatar
    4731 posts
    Member since:
    Sep 2012

    Posted 15 Feb 2010 Link to this post

    Hello Mario,

    Please modify your Message column as shown below:

    <telerik:GridTemplateColumn DataField="message" HeaderText="Message" UniqueName="Message">
        <ItemTemplate>
            &nbsp;<asp:Label ID="lblMessage" runat="server"></asp:Label>
        </ItemTemplate>
    </telerik:GridTemplateColumn>

    Regards,
    Daniel
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.

Back to Top