This is a migrated thread and some comments may be shown as answers.

Export to word column width problem

3 Answers 118 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nithin
Top achievements
Rank 1
Nithin asked on 11 Oct 2011, 07:39 AM
Hello ,
    
    I have a problem that when export grid data to word ,word column width problem 

Refer attachment 

3 Answers, 1 is accepted

Sort by
0
Nithin
Top achievements
Rank 1
answered on 11 Oct 2011, 08:09 AM
Help Pls 
0
Princy
Top achievements
Rank 2
answered on 11 Oct 2011, 08:27 AM
Hello Nithin,

Try the following code snippet to specify Column width to a column while exporting it to word.
C#:
protected void RadGrid1_ExportCellFormatting(object sender, ExportCellFormattingEventArgs e)
{
  GridDataItem item = e.Cell.Parent as GridDataItem;
  if ((e.FormattedColumn.UniqueName) =="UniqueName")
  {
     e.Cell.Width = Unit.Pixel(100);
  }
}

Thanks,
Princy.
0
Nithin
Top achievements
Rank 1
answered on 11 Oct 2011, 08:42 AM
Hello ,
can't get " ExportCellFormatting "
Tags
Grid
Asked by
Nithin
Top achievements
Rank 1
Answers by
Nithin
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or