473,480 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Why does my datagrid width got narrower in run time?

I set the Locked property = True for the datagrid but in run time the width
shriks automatically making the windows looking messy. How do I fix this so
it would stay the same as in the designer sheet?
Thanks, Alpha
Nov 17 '05 #1
5 1179
Use grid column styles.

--

Derek Davis
dd******@gmail.com
"Alpha" <Al***@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
I set the Locked property = True for the datagrid but in run time the width
shriks automatically making the windows looking messy. How do I fix this
so
it would stay the same as in the designer sheet?
Thanks, Alpha

Nov 17 '05 #2
I set the GridColumn style for each of the column=100 but after I run the
application it's set back to the original 75. I do this in the designer
window's property area. Do I need to add code to set the column width at
loading time for it to work?

Thanks, Alpha

"carion1" wrote:
Use grid column styles.

--

Derek Davis
dd******@gmail.com
"Alpha" <Al***@discussions.microsoft.com> wrote in message
news:EC**********************************@microsof t.com...
I set the Locked property = True for the datagrid but in run time the width
shriks automatically making the windows looking messy. How do I fix this
so
it would stay the same as in the designer sheet?
Thanks, Alpha


Nov 17 '05 #3
See
I set the GridColumn style for each of the column=100 but after I run the
application it's set back to the original 75. I do this in the designer
window's property area. Do I need to add code to set the column width at
loading time for it to work?

Thanks, Alpha


Go here: http://www.syncfusion.com/FAQ/Window...efault.aspx#44

And read FAQ #5.35

Pete
Nov 17 '05 #4
Thank you, that is an informative web site. However, I'm still not sure
where to set the column width. The example uses a click button event. I
just want the grid to come up at the size I specified. I put this in the
designer grid property and also at the loadup time and it still not working.
Thanks, Alpha

"Pete Davis" wrote:
See
I set the GridColumn style for each of the column=100 but after I run the
application it's set back to the original 75. I do this in the designer
window's property area. Do I need to add code to set the column width at
loading time for it to work?

Thanks, Alpha


Go here: http://www.syncfusion.com/FAQ/Window...efault.aspx#44

And read FAQ #5.35

Pete

Nov 17 '05 #5
You need to read about adding DataGridColumnStyles to your grid. With these,
you can specify a specific width for the columns.

Basically, you want to create a DataGridTableStyle, add DataGridColumnStyle
derived objects for each column (either DataGridBoolColumn or
DataGridTextBoxColumn, or one of your own custom DataGridColumnStyle derived
objects). Set the HeaderText and MappingName of the styles and then set the
width. Don't forget to set the MappingName property of the table style as
well.

Then add this DataGridTableStyle to the TableStyles collection of the grid.

Good luck.

Pete

"Alpha" <Al***@discussions.microsoft.com> wrote in message
news:4E**********************************@microsof t.com...
Thank you, that is an informative web site. However, I'm still not sure
where to set the column width. The example uses a click button event. I
just want the grid to come up at the size I specified. I put this in the
designer grid property and also at the loadup time and it still not
working.
Thanks, Alpha

"Pete Davis" wrote:
See
>I set the GridColumn style for each of the column=100 but after I run
>the
> application it's set back to the original 75. I do this in the
> designer
> window's property area. Do I need to add code to set the column width
> at
> loading time for it to work?
>
> Thanks, Alpha
>


Go here: http://www.syncfusion.com/FAQ/Window...efault.aspx#44

And read FAQ #5.35

Pete

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
7646
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official...
8
3116
by: pei_world | last post by:
Hi, there; I have a problem with my datagrid control. I declared it in one of my form, set with DataGridTalbeStyle as well, and when I click on button, I would like to retrive Data from Database...
2
2485
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
5
329
by: Jeremy | last post by:
I have googled for this issue, and many other people have the same problem with no resolution. The data grid column sizes automatically resize based on their contents no matter what the...
0
1284
by: Danny | last post by:
I am trying to sort my second datagrid. And it works but only after i click 2 times on the column header. The first time i click on the header the data in the right order will add to the rows in...
2
6369
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
1
1606
by: rp13 | last post by:
Hi, I am using a asp:datagrid which is editable. Though I have handlers wired to my edit, update & cancel events, some how when i click on the edit button nothing happens. The edit template...
6
2690
by: Roderik | last post by:
I was wondering if there is a good way to avoid a table but achieve the following similar behaviour: Two divs of equal height and undefined width next to each other with a total width of 100%....
2
6556
by: =?Utf-8?B?Y3JlYXZlczA2MjI=?= | last post by:
I have a nested datagrid in a xaml file, the parent datagrid loads the vendor information and the details loads the documents for that vendor in a datagrid. Everything is working fine until I click...
0
7041
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7044
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6739
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6929
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5337
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4779
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
4481
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.