locked
How to add itemtemplate in silverlight grid like asp.net RRS feed

  • Question

  • Hi,
      I want to add one gridview control like as follows in silverlight application. Can any one help me how to achieve this?
    <asp:GridView ID="gdView" runat="server" AutoGenerateColumns="false" AlternatingRowStyle-CssClass="grdAlterRowColor" 
    HeaderStyle-CssClass="grdHeading" HeaderStyle-HorizontalAlign="Center"
    RowStyle-CssClass="grdLable" RowStyle-HorizontalAlign="left" CellPadding="4" CellSpacing="0">
    <Columns>
    <asp:TemplateField HeaderText="S.No">
    <ItemTemplate>
    <%#Container.DataItemIndex+1 %>
    </ItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField HeaderText="QUESTIONS">
    <ItemTemplate>&nbsp;&nbsp;&nbsp;
    <asp:TextBox ID="txtQuestion" runat="server" TextMode="MultiLine" Width="600px" CssClass="txtBox"></asp:TextBox>
    <div>
    <asp:Panel ID="panelOptional" runat="server">
    <table width="100%" border="0">
    <tr>
    <td class="txtBox" style="width:50%">a. <asp:TextBox ID="txtOpt1" runat="server" Width="90%" ></asp:TextBox></td>
    <td class="txtBox" style="width:50%">b. <asp:TextBox ID="txtOpt2" runat="server" Width="90%" ></asp:TextBox></td>
    </tr>
    <tr>
    <td class="txtBox" style="width:50%">c. <asp:TextBox ID="txtOpt3" runat="server" Width="90%" ></asp:TextBox></td>
    <td class="txtBox" style="width:50%">d. <asp:TextBox ID="txtOpt4" runat="server" Width="90%" ></asp:TextBox></td>
    </tr>
    </table>
    </asp:Panel>
    </div>
    </ItemTemplate>
    </asp:TemplateField>

    <asp:TemplateField HeaderText="TYPE">
    <ItemTemplate>

    <asp:DropDownList ID="ddType" runat="server" Width="80px" CssClass="ddownn">
    <asp:ListItem Value="1">Optional</asp:ListItem>
    <asp:ListItem Value="2">CheckBox</asp:ListItem>
    </asp:DropDownList><br /><br />

    <asp:DropDownList ID="ddStatus" runat="server" Width="80px" CssClass="ddownn">
    <asp:ListItem Value="1">Active</asp:ListItem>
    <asp:ListItem Value="2">Deactive</asp:ListItem>
    </asp:DropDownList>

    </ItemTemplate>
    <HeaderStyle VerticalAlign="Top"/>
    </asp:TemplateField>

    <asp:TemplateField HeaderText="ANSWER">
    <ItemTemplate>
    <%--<asp:DropDownList ID="ddAnswer" runat="server" Width="80px" CssClass="ddownn">
    <asp:ListItem Value="1">a</asp:ListItem>
    <asp:ListItem Value="2">b</asp:ListItem>
    <asp:ListItem Value="3">c</asp:ListItem>
    <asp:ListItem Value="4">d</asp:ListItem>
    </asp:DropDownList>--%>

    <asp:ListBox ID="listAnswer" runat="server" Width="50px" CssClass="ddownn" SelectionMode="Multiple">
    <asp:ListItem Value="1">a</asp:ListItem>
    <asp:ListItem Value="2">b</asp:ListItem>
    <asp:ListItem Value="3">c</asp:ListItem>
    <asp:ListItem Value="4">d</asp:ListItem>
    </asp:ListBox>
    </ItemTemplate>
    <HeaderStyle VerticalAlign="Top" />
    </asp:TemplateField>

    </Columns>
    </asp:GridView>
    
    
    Thanks in advance,
    Rajesh.M
    Monday, August 22, 2011 6:03 AM

Answers

All replies