You must Sign In to post a response.
  • Category: .NET

    How to create second columns after fill our datagridview fixed rows

    I am creating windows application using c# 2010 – here I am using data grid view, my data grid view default height 363, here I want : my data grid view rows 5 only enough, how to control the grid view.
    And I am entered 5 rows completed automatically create second columns again 5 rows.

    My Colums
    Slno mts cms Slno mts cms
    1 1
    2 2
    3 3
    4 4
    5 5

    How to create above method any one give me ideas.
  • #767110
    Do you want to add a column or what ? check below code to add a column dynamically
    try out below snippet

    for (int i=0; i< datagriview1.coulums.count -1; i++)
    int total + = total + datagridview1.columns[i]
    .cell[index for columns you want to add].formatedvalue.toString();

    Editor, DotNetSpider MVM
    Microsoft MVP 2014 [ASP.NET/IIS]

  • #767128

    Your requirement is little bit confused, you said that after 5 rows you want to create 2nd column, for second column 5 rows finished what happen, need more details about your requirement to help you better.

    Give respect to your work, Instead of trying to impress your boss.

    Blog :

  • Sign In to post your comments