how to set row/column's height/width in datagrid??
-
Hello,everyone: Now i have a datagrid, in which each cell may contain many words. it looks quite ugly because the datagrid automatically make the words vertical displayed. Therefore, i wonder if we could solve it through making all the cells have the same fixed heigh/width??and how could we fix the height/width? i have tried to set it in the property builder, however, it does not work:( Looking forward to ur reply, thanks in advance!
-
Hello,everyone: Now i have a datagrid, in which each cell may contain many words. it looks quite ugly because the datagrid automatically make the words vertical displayed. Therefore, i wonder if we could solve it through making all the cells have the same fixed heigh/width??and how could we fix the height/width? i have tried to set it in the property builder, however, it does not work:( Looking forward to ur reply, thanks in advance!
Try to use PreRender in DataGrid: Private Sub grd_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdDefinitionList.PreRender grd.Columns(1).ItemStyle.Width = Unit.Pixel(24) grd.Columns(2).ItemStyle.Width = Unit.Pixel(24) grd.Columns(3).ItemStyle.Width = Unit.Pixel(24) End Sub =postmaster http://www.programmingknowledge.com/[^]
-
Hello,everyone: Now i have a datagrid, in which each cell may contain many words. it looks quite ugly because the datagrid automatically make the words vertical displayed. Therefore, i wonder if we could solve it through making all the cells have the same fixed heigh/width??and how could we fix the height/width? i have tried to set it in the property builder, however, it does not work:( Looking forward to ur reply, thanks in advance!
Hi, U can convert the columns to template column in property builder then set following properties according to your requirement: Thanks, Prabir
-
Hi, U can convert the columns to template column in property builder then set following properties according to your requirement: Thanks, Prabir
First of all,thank u all for the replies!:rose: However, i am using databinding like this: I am creating a DataGrid form a DataSet with autogeneratecolumns: dg.DataSource = ds; dg.DataBind(); all the columns are autogenerated, thus, we could not convert a specific column into template column. am i right? looking forward to ur reply;P
-
Try to use PreRender in DataGrid: Private Sub grd_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles grdDefinitionList.PreRender grd.Columns(1).ItemStyle.Width = Unit.Pixel(24) grd.Columns(2).ItemStyle.Width = Unit.Pixel(24) grd.Columns(3).ItemStyle.Width = Unit.Pixel(24) End Sub =postmaster http://www.programmingknowledge.com/[^]
I m using Datagrid with Autogenerated Columns. I want to set width of Autogenerated Columns. I used that Code told by you. But it is giving me error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index So can u explain me more and sort out this Problem... Any help will be greatly appreciated...........