Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
1.67/5 (3 votes)
See more:
Hi Everyone,

I am writing a code to set the width of column in datagrid for my Mobile application. But I am getting an error at the below line.

DataGrid1.TableStyles(0).GridColumnStyles(1).Width = 10

Error is "Specified argument is out of the range of valid values"

Can anyone help me where I am wrong, or any other way to set the column width in datagrid.


Thanks in advance.
Posted
Updated 25-Aug-11 20:59pm
v5
Comments
Suresh Suthar 26-Aug-11 2:12am    
Can you post the error message.
Pravin Patil, Mumbai 26-Aug-11 2:22am    
He has already posted it : "Specified argument is out of the range of valid values"
Suresh Suthar 26-Aug-11 2:53am    
Have you seen the first draft?
Its updated later.
Saumyavemula 26-Aug-11 3:10am    
I didn't get what you said?

Can you help me for setting the width of datacolumn...

 
Share this answer
 
Comments
Saumyavemula 26-Aug-11 2:37am    
Its not helpful, i tried all this........

I am using datagrid not datagridview
Did you try to add the Columns code behind ?

As mentioned in this link:
http://stackoverflow.com/questions/1051690/column-width-of-a-datagrid-in-a-windows-mobile-application[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900