So I built a small program for warehouse workers for a company that use this PDA device.
http://www.thebarcodewarehouse.co.uk/Images/Product/Default/large/Honeywell-Dolphin60s-image1.jpg
It has windows mobile operating system 5.0
As shown in the picture, the description and code column have the same size. I know it's an old technology but my manager insists to make the description column wider on the load( Manually we can make it bigger after it loads).
I have written this code.
DataGridTableStyle ts = new DataGridTableStyle();
DataGridTextBoxColumn cs = new DataGridTextBoxColumn();
cs = new DataGridTextBoxColumn();
cs.MappingName = "Desc";
cs.HeaderText = "description";
cs.Width = 150;
ts.GridColumnStyles.Add(cs);
cs = new DataGridTextBoxColumn();
cs.MappingName = "Code";
cs.HeaderText = "code";
cs.Width = 50;
ts.GridColumnStyles.Add(cs);
cs = new DataGridTextBoxColumn();
cs.MappingName = "barcode";
cs.HeaderText = "barcode";
cs.Width = 90;
ts.GridColumnStyles.Add(cs);
DgView.TableStyles.Clear(); //DgView is the Datagrid
DgView.TableStyles.Add(ts);
DgView.DataSource = AllKinds.AsEnumerable().
OrderBy(x => x.Field<string>("Desc")).
Select(p => new
{
Description = p.Field<string>("Desc").Trim(),
Code = p.Field<string>("Code").Trim()
}).ToList();
Copyright Notice:Content Author:「Missak Boyajian」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/42644313/windows-mobile-5-0-datagrid-column-size