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

[Solved] Alternating Item style messing up cell formatting

2 Answers 113 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Greg
Top achievements
Rank 1
Greg asked on 23 Jun 2008, 10:01 PM
Hi there

As shown in the example code I have multiple items in a grids cell.
The problem I am having is that each alternate row seems to ignore the breaks <br /> between each link button in the cell. This leads to a nasty and inconsistent look.

However when I remove the AlternatingItemStyle 

tag I get the correct result, but of cause I have no alternating color.
<radg:RadGrid id="RadGrid1" runat="server" RadControlsDir="/_Common/RadControls/" GridLines="None" 
  SkinsPath="/_Common/RadControls/Grid/Skins" DataMember="SearchResults" AllowPaging="True" 
  AutoGenerateColumns="False" AllowSorting="True" width="99%" PageSize="50">  
       <PagerStyle Position="TopAndBottom" Mode="NextPrevAndNumeric"></PagerStyle> 
       <MasterTableView EditMode="InPlace" DataMember="SearchResults">  
              <EditFormSettings> 
                       <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
              </EditFormSettings> 
              <HeaderStyle ForeColor="#FFFFFF" BackColor="#0A246A"></HeaderStyle> 
              <AlternatingItemStyle BackColor="#DCDCDC"></AlternatingItemStyle> 
              <Columns> 
                      <radg:GridTemplateColumn Groupable="False" UniqueName="Info">  
                               <HeaderStyle Wrap="False" HorizontalAlign="Left"></HeaderStyle> 
                               <ItemTemplate> 
                                   <asp:ImageButton id="imgMoreInfo" ToolTip="Click here for further information" runat="server" style="cursor:hand" 
                                              ImageUrl='/_Common/Images/information_magnifier.png' BorderStyle="None"></asp:ImageButton> 
                                </ItemTemplate> 
                                                </radg:GridTemplateColumn> 
                                                <radg:GridTemplateColumn HeaderText="Name" Groupable="False" HeaderButtonType="TextButton" UniqueName="Details">  
                                                    <HeaderStyle HorizontalAlign="Left"></HeaderStyle> 
                                                    <ItemTemplate> 
                                                        Name:   
<asp:Label runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.PreferredName") + " " + DataBinder.Eval(Container, "DataItem.LastName")%> ' ID="Label1">  
                                                        </asp:Label> 
                                                        <br /> 
                                                        Division:   
<asp:LinkButton id="Linkbutton4" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Division") %>' CausesValidation="False" CommandName="Select" CommandArgument="Division">  
                                                        </asp:LinkButton> 
                                                        <br /> 
                                                        Team:   
<asp:LinkButton runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Team") %>' CommandName="Select" CommandArgument="Team" CausesValidation="false" ID="Linkbutton5">  
                                                        </asp:LinkButton> 
                                                        <br /> 
                                                        Position:   
<asp:LinkButton runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Position") %>' CommandName="Select" CommandArgument="Position" CausesValidation="false" ID="Linkbutton6">  
                                                        </asp:LinkButton> 
                                                    </ItemTemplate> 
                                                </radg:GridTemplateColumn> 
                                                <radg:GridTemplateColumn HeaderText="Photo" Groupable="False" UniqueName="Photo">  
                                                    <HeaderStyle Wrap="False" HorizontalAlign="Left"></HeaderStyle> 
                                                    <ItemTemplate> 
                                                        <asp:ImageButton id="Imagebutton1" ToolTip="Click here for further information" runat="server" style="cursor:hand" Width="67px" CommandName="SeeDetails" ImageUrl='<%# DataBinder.Eval(Container, "DataItem.EmployeeNum", ImagePath) %>' BorderStyle="None">  
                                                        </asp:ImageButton> 
                                                    </ItemTemplate> 
                                                </radg:GridTemplateColumn> 
</Columns> 
                                        </MasterTableView> 
                                    </radg:RadGrid> 

I dont know where else I can go with this so any help would be appreciated.
 You can have a look at the undesired effect here: http://i303.photobucket.com/albums/nn125/pikkie_Greg/help.jpg

Regards
Greg

2 Answers, 1 is accepted

Sort by
0
Greg
Top achievements
Rank 1
answered on 23 Jun 2008, 10:56 PM

I resolved the issue by removing everything do do with skins and starting over manually. Keeping the alternating item style and item style OUT of the mastertable view.

This seemed to do the trick..

<radg:RadGrid id=RadGrid1 runat="server" RadControlsDir="/_Common/RadControls/"   
GridLines="None" SkinsPath="/_Common/RadControls/Grid/Skins" DataMember="SearchResults"   
AllowPaging="True" AutoGenerateColumns="False" AllowSorting="True" PageSize="50" Skin=" ">  
                                        <PagerStyle CssClass="GridPager_Default" Position="TopAndBottom" Mode="NextPrevAndNumeric"></PagerStyle> 
                                        <AlternatingItemStyle BackColor="#DCDCDC"></AlternatingItemStyle> 
                                        <ItemStyle BackColor="White"></ItemStyle> 
                                        <MasterTableView width="99%" EditMode="InPlace" DataMember="SearchResults">  
                                            <EditFormSettings> 
                                                <EditColumn UniqueName="EditCommandColumn1"></EditColumn> 
                                            </EditFormSettings> 
                                            <HeaderStyle ForeColor="#FFFFFF" BackColor="#0A246A"></HeaderStyle> 
                                            <Columns> 
0
Shinu
Top achievements
Rank 2
answered on 24 Jun 2008, 06:48 AM
Hi Greg,

You can also go through the following help document link.
Customizing row appearance

Shinu
Tags
Grid
Asked by
Greg
Top achievements
Rank 1
Answers by
Greg
Top achievements
Rank 1
Shinu
Top achievements
Rank 2
Share this question
or