Windows Mobile 5.0 Datagrid Column Size
NickName:Missak Boyajian Ask DateTime:2017-03-07T17:17:41

Windows Mobile 5.0 Datagrid Column Size

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 enter image description here 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

More about “Windows Mobile 5.0 Datagrid Column Size” related questions

Windows Mobile 5.0 Datagrid Column Size

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 wi...

Show Detail

C# How do you lock columns in a DataGrid on Windows Mobile 5.0?

I am trying to freeze columns in a DataGrid in C#. By freezing I mean making the column always visible even when horizontal or vertical scrolling occurs(as in Excel). My target platform is Windows ...

Show Detail

windows mobile 6.5 vs 6.0 datagrid not working

when data is displayed on a Windows Mobile 6.0 or 5.0 device, the datagrid columns width can be controlled and look fine. However when running on a Windows Mobile 6.5 device, there is no control of...

Show Detail

Change Windows Mobile 5.0 Emulator RAM Size

I can't change the memory size for a Windows Mobile 5.0 emulator. This is what I have tried. In Visual Studio 2008 Professional, I can try to change the RAM size of an Emulator by going to Tools->

Show Detail

AutoSizeColumnsMode for DataGrid in Windows Mobile Appllication

In Windows Application, There is one property AutoSizeColumnsMode for DataGrid, which determines auto size modes for the visible columns. I am developing Windows Mobile Application using .Net Fram...

Show Detail

Portability of an mobile application from Windows Mobile 5.0 to Windows Mobile 6.5

My customer has an existing application on Windows Mobile 5.0. He wants to have the same application working on Windows Mobile 6.5. I don't have a Windows Mobile 6.5 device on my hands, so I can't do

Show Detail

Windows Forms mobile application: DataGrid with ComboBox column

I'm working on a Windows Mobile 5 application - C# .NET 3.5. Are you aware of some approach to having a ComboBox column within a DataGrid ? The user must be able to select certain values on certai...

Show Detail

Column width of a DataGrid in Windows Mobile Application (Motorola MC55)

I try to adjust the column width of a DataGrid in C# for a Windows Mobile application that will run on a Motorola MC55. I use the following code to do this: dataGrid1.TableStyles.Clear();

Show Detail

how to change header text by C# code in Windows-Mobile DataGrid?

how to change header text and column size - by C# code in Windows-Mobile DataGrid ?

Show Detail

DataGrid Width has no affect in Windows Mobile. C#

I a beginner in Windows Mobile development and found that when I set the Width using a DataGridTextBoxColumn it does not affect the DataGrid column size. Here is my code: DataGridTableStyle

Show Detail