Filling row with combos???

  • 12 years ago

    Hi!





    I'm trying to put a combo box in each cell of a row (make a row with combos).

    This would be a first row of a bound datagridview on my form.



    Can anyone help me since I can't find the solution?



    I have several columns with different datatypes in it and many rows. The first row also shouldn't be binded with data as other rows.





    Thanks in advance for any comment or reply.





















  • 12 years ago

    Hi Kdee
     you change your coding in the Script area.
    you can follow in the the following method

    <asp:datagrid  id="dgrdMyReports"  BorderStyle=None runat="server" width="100%" AutoGenerateColumns="False" ShowHeader="False">
     <Columns>
      <asp:TemplateColumn  ItemStyle-BorderStyle="None" ItemStyle-Width="30" ItemStyle-VerticalAlign="Middle">
      <ItemTemplate>
      <asp:RadioButton ID="chkMyReports" Runat="server" CssClass="clsChk"></asp:RadioButton>
       </ItemTemplate>
         </asp:TemplateColumn>

    .another field of the datagird columne
    .
    .
    .

        </Columns>
      </asp:datagrid>   

    Regards
    Hari K
























  • 12 years ago

    Hi kdee ,

    You  first create a template column. Then add this code inside that. This Way u can add any ctrls

    <asp:datagrid  id="dgdgrid"  runat="server" AutoGenerateColumns="False" ShowHeader="False">
     <Columns>
      <asp:TemplateColumn  ItemStyle-BorderStyle="None" ItemStyle-Width="30" >
      <ItemTemplate>
      <asp:DropDownList ID="ddl" Runat="server" ></asp:DropDownList>
       </ItemTemplate>
         </asp:TemplateColumn>

    <BoundColumn>. </BoundColumn>
    .
    .

        </Columns>
      </asp:datagrid>   












Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“The question of whether computers can think is just like the question of whether submarines can swim.” - Edsger W. Dijkstra