Pages

Friday, 2 March 2012

How to Put Data List Control In Data Grid View


<asp:GridView ID="grvExpendabael" runat="server" Width="660px" AutoGenerateColumns="false"
                            GridLines="None" OnRowDataBound="grvExpendabael_RowDataBound"
                            onrowcommand="grvExpendabael_RowCommand">
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <table width="660px">
                                            <tr>
                                                <td>
                                                    <h3 class="menuheader expandable" style="margin-bottom: 5px;">
                                                        <asp:LinkButton  ID="lblTitle" runat="server" Text='<%#Bind("CName") %>' Font-Underline="false" ForeColor="#706e6e" CommandArgument='<%#Bind("Cid") %>' CommandName="Select"></asp:LinkButton></h3>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <ul class="categoryitems">
                                                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                            <tr>
                                                                <td>
                                                                    <div class="model_img">
                                                                        <asp:DataList ID="galleryDataList" RepeatColumns="4" runat="server" OnItemCommand="galleryDataList_ItemCommand">
                                                                            <ItemTemplate>
                                                                                <div class="image_1">
                                                                                    <asp:Image ID="imgGallery" runat="server" ImageUrl='<%#Bind("PimagePath")%>' Width="50px"
                                                                                        Height="50px" />
                                                                                </div>
                                                                                <div class="text">
                                                                                    <h3>
                                                                                        <asp:Label ID="lblModel" runat="server" Text='<%#Bind("ModelName")%>'></asp:Label>
                                                                                    </h3>
                                                                                    <p>
                                                                                        <asp:Label ID="Label1" runat="server" Text='<%#Bind("Price")%>'></asp:Label></p>
                                                                                </div>
                                                                            </ItemTemplate>
                                                                        </asp:DataList>
                                                                    </div>
                                                                </td>
                                                            </tr>
                                                        </table>
                                        </table>
                                        </ul> </td> </tr> </table>
                                    </ItemTemplate>
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>

No comments:

Post a Comment