473,326 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

In wpf how to set column width in datagrid??

Expand|Select|Wrap|Line Numbers
  1. double currentWidth = SystemParameters.FullPrimaryScreenWidth - 205;
  2. double colNumber = 10;
  3. double newWidth=currentWidth / colNumber;
  4. datagrid1.ColumnWidth= newWidth;
  5.  
my code not working.
Sep 19 '11 #1
1 3645
Frinavale
9,735 Expert Mod 8TB
Have you considered just setting the width of the columns in XAML to be *?

-Frinny
Sep 19 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: frank | last post by:
How do I set the column width of a column in a DataGrid programatically (in ASP.NET web pages)? I understand I may have to use DataGridTableStyle, but I can't get this to work with web pages. ...
0
by: Lalit Bhatia | last post by:
Hi, In Datagrid, while setting width of column through GridColumnStyles collection. width does not set to exact width that I am setting in my code. If I set width to 13, it is changed to 130 or...
2
by: nj | last post by:
I am trying to set the width of a single column in the datagrid. What is happening is the column seems to stretch to try to accomodate the length of the data contained in it. I want to have it only x...
3
by: Mike Fellows | last post by:
Im trying to set the column width of individual datgrid columns I can set the column widths of all the columns at once using Me.DataGrid1.PreferredColumnWidth = 100 But I am unable to set the...
1
by: Price Brattin | last post by:
How do I set the column width in a datagrid when the datasource is a dataview? I want to use a dataview so data changes, inserts, and deletes are disabled. I can set the column width when I use...
2
by: Jaime Lucci | last post by:
Hi, how've you been? How can I do to set the column width of a datagrid to fix the width of the text in each column? Thanks. Jaime Lucci jaimelucci@hotmail.com
3
by: Aziz | last post by:
1. I have a shopping basket DataGrid with a list of products. What I want to do is when the user clicks on a row, a button will become visible/be created that allows user to edit the quantity. The...
2
by: Charleees | last post by:
Hi all, I have a DataGrid with Template Columns..... There are LAbels,Linkbuttons in the Single Row.. I have to set the Constant Column width for those Template Columns in Grid... Wat...
1
by: Kaushik Gadani | last post by:
I am using .Net Framework 1.1 and ASP.Net & VB.Net. I want to get width of each column after databind method. Please note I have not assigned width design time, as I am not knowing how many...
3
by: remya1000 | last post by:
I’m using Vb.net application program. I created a datagrid having text field and checkbox fields. Everything is displaying correctly. I have 9 Columns and each columns are equally separated. In...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.