BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi
Yu,
We are sorry for Delay causes,
No, GridDataControl does not have the method named as DrawToBitmap . Could you please tell me which scenario do you want to use this method? If you share your exact scenario, We would suggest alternate way to achieve your requirement.
Please let us know if you have any queries,
Regards,
Saravnan.M
Hi Yu,
We are sorry for Delay causes,
No, GridDataControl does not have the method named as DrawToBitmap . Could you please tell me which scenario do you want to use this method? If you share your exact scenario, We would suggest alternate way to achieve your requirement.
Please let us know if you have any queries,
Regards,
Saravnan.M
Hi Yu,
We are able to convert the only the visible part of the grid to image, we have created a sample for converting visible part of the grid to image, using RenderTargetBitmap class. Please refer the below code snippet for this
private void Button_Click(object sender, RoutedEventArgs e) { RenderTargetBitmap targetBitmap = new RenderTargetBitmap((int)datagrid.ActualWidth, (int)datagrid.ActualHeight, 96d, 96d, PixelFormats.Default); targetBitmap.Render(datagrid);
// add the RenderTargetBitmap to a Bitmapencoder BmpBitmapEncoder encoder = new BmpBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(targetBitmap));
// save file to disk FileStream fs = File.Open("Grid.bmp", FileMode.OpenOrCreate); encoder.Save(fs); } |
We have attached the sample in the below link for your reference, please refer it.
Sample link: http://www.syncfusion.com/downloads/support/directtrac/123670/CS1344771902.zip
Please let us know if you have any
queries.
Thanks,
Ashok