DataGrid column size (Compact Framework) C# -


i'm new datagrids.

my code:

private void populategrid()     {         conn.open();         string query;         query = "select company_id_no, company_name, last_update_datetime, username company";         oracledataadapter da = new oracledataadapter(query, conn);         oracledataset ds = new oracledataset();         da.fill(ds);         dgsku.datasource = ds.tables[0];     } 

this how looks on mobile device:

enter image description here

i want automatically re-size columns 100%, like:

enter image description here

i appreciate if can point me in right direction.

thanks in advance!

        string query;         query = "....sql...";         {             conn.open();              using (oracledataadapter = new oracledataadapter(query, conn))             {                 datatable t = new datatable();                 a.fill(t);                  dgsku.tablestyles.clear();                 datagridtablestyle tablestyle = new datagridtablestyle();                 tablestyle.mappingname = t.tablename;                  foreach (datacolumn item in t.columns)                 {                     datagridtextboxcolumn tbcname = new datagridtextboxcolumn();                     tbcname.width = 80;                     tbcname.mappingname = item.columnname;                     tbcname.headertext = item.columnname;                     tablestyle.gridcolumnstyles.add(tbcname);                 }                 dgsku.tablestyles.add(tablestyle);             }         } 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -