1, the project is often inserted in the Table button column, picture column, table column some non-text special columns. How do I implement it in the DevExpress table control Gridcontrol? The following is an example of an implementation of adding a picture column, a button column, a time column, a button column, and a switch column, as follows:
2, data code, wherein the picture column uses two methods, we can change according to their own requirements.
Image img = image.fromfile (application.startuppath+"\\img\\11111.png");//Method 1//byte[] Imgbyte=getimagebyte ("D:\\kkk.png");//Method 2DataTable dt =NewDataTable (); Dt. Columns.Add ("A1"); Dt. Columns.Add ("A2"); Dt. Columns.Add ("A3"); Dt. Columns.Add ("A4",typeof(Image));//Method 1//dt. Columns.Add ("A4", typeof (Byte[]));//Method 2Dt. Columns.Add ("A5"); Dt. Rows.Add (1, DateTime.Now,1Img1);//Method 1//dt. Rows.Add (1, DateTime.Now, 1, imgbyte, 1);//Method 2Gridcontrol1.datasource = DT;
3. Project source link, download link (no points required): http://download.csdn.net/detail/kehaigang29/8851075
DevExpress Table Control Gridcontrol The implementation of special columns such as Picture columns, button columns, time columns, etc.