Datagrid & windows forms

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Lane

    Datagrid & windows forms

    I'm completly LOST !!!
    I need to create a datagid with data from a database which i can do, but i need a additional row appended to the grid as a textbox for information to be gathered and stored.

    Please Help
  • Mohamoss

    #2
    RE: Datagrid & windows forms

    Hi
    If you are building a web application , then it is fairly easy .. this
    example use a button columns , you will use a textbox one
    <asp:datagrid DataKeyField="D iscId" id="DataGrid1" style="Z-INDEX: 110;
    LEFT: 8px; POSITION: absolute; TOP: 408px"
    runat="server" AutoGenerateCol umns="False" CellPadding="8"
    BorderWidth="2p x" BorderColor="Ye llow">
    <HeaderStyle ForeColor="Whit e" BackColor="Indi go"></HeaderStyle>
    <Columns>
    <asp:BoundColum n DataField="Disc Id" HeaderText="ID" >
    <ItemStyle HorizontalAlign ="Center" ForeColor="Whit e"
    BackColor="Purp le"></ItemStyle>
    </asp:BoundColumn >
    <asp:BoundColum n DataField="Floa tDiscNumber" SortExpression= "DES"
    HeaderText="Flo atNumber">
    <ItemStyle HorizontalAlign ="Center"></ItemStyle>
    </asp:BoundColumn >
    <asp:BoundColum n DataField="Pack Description" HeaderText="Cat agory">
    <ItemStyle HorizontalAlign ="Center"></ItemStyle>
    </asp:BoundColumn >
    <asp:BoundColum n DataField="Ship mentName" HeaderText="Iss ue Date">
    <ItemStyle HorizontalAlign ="Center"></ItemStyle>
    </asp:BoundColumn >
    <asp:BoundColum n DataField="Labe lText" HeaderText="DVD Content">
    <ItemStyle HorizontalAlign ="Center"></ItemStyle>
    </asp:BoundColumn >
    <asp:BoundColum n DataField="Colo r" HeaderText="Col or">
    <ItemStyle HorizontalAlign ="Center"></ItemStyle>
    </asp:BoundColumn >
    <asp:BoundColum n DataField="Disc ImageFile" HeaderText="Ima ge">
    <ItemStyle HorizontalAlign ="Center"></ItemStyle>
    </asp:BoundColumn >
    <asp:ButtonColu mn Text="Book" ButtonType="Pus hButton"
    HeaderText="Res erve" CommandName="re serve">
    <ItemStyle BackColor="Purp le"></ItemStyle>
    </asp:ButtonColum n>
    <asp:TemplateCo lumn HeaderText="DVD View">
    <ItemStyle BackColor="Purp le"></ItemStyle>
    <ItemTemplate >
    <asp:Button runat="server" Text="Details" CommandName="op encontent"
    CausesValidatio n="false"></asp:Button>
    </ItemTemplate>
    </asp:TemplateCol umn>
    </Columns>
    </asp:datagrid>
    if you are using window, you still can do it with columns style elemnts
    Mohamed Mahfouz
    MEA Developer Support Center
    ITworx on behalf of Microsoft EMEA GTSC

    Comment

    • Nicholas Paldino [.NET/C# MVP]

      #3
      Re: Datagrid &amp; windows forms

      Lane,

      You can always add a new row, assuming that the view on the data allows
      it.

      If you want to place a singular textbox as the last row (even though you
      have more columns), then you will have to manage this separately, as this is
      data that doesn't fit into the schema of the table that you are displaying
      (most likely, unless you have a table with a single character column, in
      which case, you can just add a new row).

      Hope this helps.


      --
      - Nicholas Paldino [.NET/C# MVP]
      - mvp@spam.guard. caspershouse.co m

      "Lane" <Lane@discussio ns.microsoft.co m> wrote in message
      news:64B00478-53D1-4E7C-8C24-09A91626B4AD@mi crosoft.com...[color=blue]
      > I'm completly LOST !!!
      > I need to create a datagid with data from a database which i can do, but i[/color]
      need a additional row appended to the grid as a textbox for information to
      be gathered and stored.[color=blue]
      >
      > Please Help[/color]


      Comment

      Working...