i have set the anchor property of datagridview to top,left,bottom,right and scroll bars to both and changed nothing in the property of dgv and then used arrays to create columns [by just dgv.columns.add(arr[r,c]);
the columns were created uptill this was fine
but when used with large deta suppose just 50 columns and 100 rows it collapsed . the dgv exceeded the borders of the form . why ? i have also coded the hscrollbar like this
in the form class i just added the arrar to the dgv and wrote
- class form ()
- {
- hscrollbar hb=new hscrollbar();
- private void form_load()
- {
-
-
- string arr=field [r,c];
- dgv.columns.add( arr,arr);
- hb.scroll +=hb_scroll;
- }
- void hb_scroll()
- {
- for(int i=0;i<dgv.columncount;i++)
- { dgv.columns[i].headertext= field[r,c]; }
- }