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

RadGrid Column horizontal grid lines blank

4 Answers 330 Views
Grid
This is a migrated thread and some comments may be shown as answers.
marksweat
Top achievements
Rank 1
marksweat asked on 15 Jul 2008, 10:31 PM
I've got an editable RadGrid with several text based columns. I don't always have data for these columns in my data set. When there is no data for the columns the bottom horizontal gridline running across the row for the column is interupted (blank) for the columns with no data.

This seems to be a problem only if the grid is editable.

In my application I use GridTemplateColumns with an asp:Label control to display the text. If the string bound to the label control is null, empty or blank space string (" "), the row gridline for the column is interupted.

I found the same grid line behavior when I created a small test application and had a GridBoundColumn bound to a DataTable where the column was a blank space string (" ").

--Mark

4 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 16 Jul 2008, 04:45 AM
Hi,

Try the following code snippet in the PreRender event and see whether it helps.

CS:
protected void RadGrid2_PreRender(object sender, EventArgs e)   
    {   
        foreach (GridDataItem dataItem in RadGrid2.Items)   
        {   
            foreach (GridColumn col in RadGrid2.Columns)   
            {   
                if (dataItem[col.UniqueName].Text == string.Empty)   
                    dataItem[col.UniqueName].Text += " ";     
    
            }   
        }   
    }   
 

Thanks
Princy.
0
marksweat
Top achievements
Rank 1
answered on 16 Jul 2008, 05:21 AM
Princy,

After some observation I noticed that label is actually overwriting the horizontal grid line for the columns at the top and not at the bottom.

If I set the ASP Label control property BorderStyle = "None" the gird lines draw properly.

--Mark
0
HL
Top achievements
Rank 1
answered on 10 Apr 2011, 11:52 PM
hi all:
  I have the same issue .but my data is always not empty since it is all madatary feild.any suggestion?

code:
<telerik:RadGrid ID="ProgressNoteRadGird" runat="server" AllowPaging="false"   AllowSorting="True"  
           GridLines="Both" AutoGenerateColumns="false"  >
           <ClientSettings>
             <ClientEvents OnRowMouseOver="RowMouseOver"/>
             </ClientSettings>  
            <MasterTableView  AllowMultiColumnSorting="true"  ShowHeadersWhenNoRecords="false" Width="100%"  TableLayout="Fixed">  
              <HeaderStyle CssClass="InnerHeaderStyle" />
              <ItemStyle CssClass="InnerItemStyle" />
              <AlternatingItemStyle CssClass="InnerAlernatingItemStyle" />
              <Columns>
                 <telerik:gridboundcolumn DataField="ProgressNoteDate" HeaderText="Date" dataformatstring="{0:dd-MMM-yyyy}" SortExpression="ProgressNoteDate" UniqueName="ProgressNoteDate"   ItemStyle-Wrap="false">
                     <HeaderStyle Width="75px"   />   
                 </telerik:gridboundcolumn>
                  <telerik:gridboundcolumn DataField="SubjectArea" HeaderText="Subject"  ItemStyle-Wrap="true" SortExpression="SubjectArea"
                 <HeaderStyle Width="70px"   />   
                  </telerik:gridboundcolumn>
                  <telerik:GridTemplateColumn HeaderText="Note" ItemStyle-Wrap="true" >
                    <ItemTemplate >
                           <asp:label id="lblNote" runat="server" text='<%# DataBinder.Eval(Container, "DataItem.Note") %>'></asp:label
                   </ItemTemplate>
                     <HeaderStyle Width="100%"   />   
                  </telerik:GridTemplateColumn>  
                 <telerik:gridboundcolumn DataField="Note"  Visible="true" Display="false"   UniqueName="Note"/>                                                                                         
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
0
Mira
Telerik team
answered on 14 Apr 2011, 08:13 AM
Hello Helena,

The provided information is not enough for us to fully understand the issue. Could you please provide us at least a screenshot and the custom CSS rules used?

Opening a formal support ticket and sending us a sample project will be highly appreciated.

All the best,
Mira
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
marksweat
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
marksweat
Top achievements
Rank 1
HL
Top achievements
Rank 1
Mira
Telerik team
Share this question
or