DataGrid Width has no affect in Windows Mobile. C#
NickName:Zzub Ask DateTime:2009-02-18T02:05:55

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 tableStyle = new DataGridTableStyle();
        tableStyle.MappingName = "MainStyle";

        DataGridTextBoxColumn tbcName = new DataGridTextBoxColumn();
        tbcName.Width = 120;
        tbcName.MappingName = "Name";
        tbcName.HeaderText = "Name";
        tableStyle.GridColumnStyles.Add(tbcName);

        DataGridTextBoxColumn tbcValue = new DataGridTextBoxColumn();
        tbcValue.Width = 200;
        tbcValue.MappingName = "Value";
        tbcValue.HeaderText = "Value";
        tableStyle.GridColumnStyles.Add(tbcValue);

        // dgUserAttributes is defined as a System.Windows.Forms.DataGrid
        dgUserAttributes.TableStyles.Clear();
        dgUserAttributes.TableStyles.Add(tableStyle);            

Any ideas?

Copyright Notice:Content Author:「Zzub」,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/558026/datagrid-width-has-no-affect-in-windows-mobile-c-sharp

More about “DataGrid Width has no affect in Windows Mobile. C#” related questions

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

Set cell width of a Datagrid in a c# windows application

I have a datagrid in my c# windows application and my code is private void BindGrid(SmsPdu pdu) { DataRow dr=dt.NewRow(); SmsDeliverPdu data = (SmsDeliverPdu)pdu; dr[0]=data.

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 bind DataGrid column width to column width of parent grid

I have a fairly complex financial report with a number of headers and summarizing footers and with tabular data inbetween. Here is what is supposed to look like: The topmost container of the page ...

Show Detail

how to put checkboxes in datagrid in windows mobile 6 using c#?

how to put checkboxes in datagrid in windows mobile 6 using c#? dataset dsAgent=table; DataTable dataTable = dsAgent.Tables[0]; DataGridTableStyle tableStyle = new DataGridTableStyle...

Show Detail

how to put checkboxes in datagrid in windows mobile 6 using c#?

how to put checkboxes in datagrid in windows mobile 6 using c#? dataset dsAgent=table; DataTable dataTable = dsAgent.Tables[0]; DataGridTableStyle tableStyle = new DataGridTableStyle...

Show Detail

WPF Datagrid Column Width Issue

I have columns in a DataGrid that are being set by an ObservableCollection that is the type of a simple data object that I created. The first column has a width set to "Auto" and the second column ...

Show Detail

Set the Scrollbar width of a DataGridView

I'm working on an app for a mobile device and would like to make a datagrid scrollbar button larger to enhance the touch screen usability. I do not want to alter the system settings windows display

Show Detail

width of datagrid column is not as declared

I have a DataGrid with some columns set. In addition, there's Grid, whose column width I want to set (not bind) to the total of 3 DataGrid's columns width. What I'm trying to do is practically some "

Show Detail

how to refresh datagrid in windows mobile?

how to refresh datagrid in windows mobile? by using c#. how to clear to datagrid and re bind ? datagrid bind to table. it is not refreshing when i insert another row please give any solution fo...

Show Detail