Hai ,

I have a gridview containing datalist in it.In the datalist i placed 2 labels.
My problem is that the content of the datalist not placed within a gridview row cell.
The design and css used is:

<ItemTemplate>                                                            
                                        <td>
                                            <asp:DataList ID="DlistItem" runat="server"  
                                                RepeatDirection="Horizontal">
                                                <ItemTemplate>
                                                    <div class="datalisthead">
                                                        <div style="padding-left: 20px; padding-top: 1px;">
                                                            <asp:Label ID="LblStaff" runat="server" Text='<%#Bind("Class") %>'></asp:Label>
                                                            <br />
                                                            <asp:Label ID="LblSubject" runat="server" Text='<%#Bind("Subject_Name") %>'></asp:Label>
                                                        </div>
                                                    </div>
                                                </ItemTemplate>
                                            </asp:DataList>
                                        </td>                                   
                            </ItemTemplate>
.datalisthead
{
	width:150px;
	height:auto;
	border-right:1px;
	border-right-color:Black;
	border-right-style:solid;
}

Thanks in advance,
Sreevidya

Recommended Answers

All 2 Replies

you don't need the <td> tags inside an itemtemplate. The gridview's itemtemplate should generate them automatically. Not sure that is what is causing you're problem or not though. Maybe you could post a screenshot or something so we can better tell what it's doing.

Hai ,
Thank you for your replay.

I got it correctly when running the application after cleared the history and as you said i didnt used the <td> tag.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.