VB.Net Datagrid

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • krndhi1983
    New Member
    • Jun 2007
    • 22

    VB.Net Datagrid

    Hi to all,

    I want to give serial number in to datagrid in vb.net.Any one can help me?Pls.
  • vanc
    Recognized Expert New Member
    • Mar 2007
    • 211

    #2
    What are you trying to do? Insert a value into a cell in datagrid or get serial number from barcode?

    Comment

    • krndhi1983
      New Member
      • Jun 2007
      • 22

      #3
      Originally posted by vanc
      What are you trying to do? Insert a value into a cell in datagrid or get serial number from barcode?
      Thanks for ur reply.

      I want to insert a value in to datagrid cell. when i show a table by a datagrid if it has 10 rows, it needs serial no 1 to 10 in left most side of datagrid.
      ex;
      s.no name age
      1 aaa 10
      2 bbb 21
      3 ccc 12
      4 ddd 15
      5 eee 13
      6 fffff 16


      The actual table having the columns are name and age.when i show the table by a datagrid, i want to display with serial no like the above.

      Comment

      • nateraaaa
        Recognized Expert Contributor
        • May 2007
        • 664

        #4
        Originally posted by krndhi1983
        Thanks for ur reply.

        I want to insert a value in to datagrid cell. when i show a table by a datagrid if it has 10 rows, it needs serial no 1 to 10 in left most side of datagrid.
        ex;
        s.no name age
        1 aaa 10
        2 bbb 21
        3 ccc 12
        4 ddd 15
        5 eee 13
        6 fffff 16


        The actual table having the columns are name and age.when i show the table by a datagrid, i want to display with serial no like the above.
        I am assuming that this serial number is saved in a database table. If so just add a boundcolumn to your datagrid and set the name of your database column that contains the serial numbers as the DataField.

        Nathan

        Comment

        • vanc
          Recognized Expert New Member
          • Mar 2007
          • 211

          #5
          Originally posted by krndhi1983
          Thanks for ur reply.

          I want to insert a value in to datagrid cell. when i show a table by a datagrid if it has 10 rows, it needs serial no 1 to 10 in left most side of datagrid.
          ex;
          s.no name age
          1 aaa 10
          2 bbb 21
          3 ccc 12
          4 ddd 15
          5 eee 13
          6 fffff 16


          The actual table having the columns are name and age.when i show the table by a datagrid, i want to display with serial no like the above.
          I think you don't customize the datagrid manually, so you have no choice to insert a new column into datagrid.
          You should configure your datagrid manually. By this way you can add any custom column as you like.
          eg:
          Datagrid.Column Count = <Number of column it will show>
          Datagrid.Column[index].Name = <Name of the column>
          Datagrid.Row.Ad d(<Value>)

          cheers.

          Comment

          Working...