473,386 Members | 1,673 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,386 software developers and data experts.

controlling panel width from code

I have a panel containing textboxes and buttons which I use as a
header for a datagrid on a webform. I would like the panel width to
match the datagrid width. The datagrid width grows depending on the
data being displayed. I tried setting the panel style width to the
datagrid width after the datagrid is bound. But the panel is being set
to the datagrid width I set at design time, not the actual datagrid
width once it has been rendered. I suspect that there may be a way to
do this using Javascript and will experiment. I was just wondering if
anyone has done something like this. Any guidance or advice would be
greatly appreciated.

Nov 19 '05 #1
3 4135
Don't do this sort of things in javascript. You should align your controls
properly in tables. Put the panel and the datagrid in the same column in an
html table and the browser will do the job for you nicely.

Eliyahu

"dba56" <lo*****@att.net> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
I have a panel containing textboxes and buttons which I use as a
header for a datagrid on a webform. I would like the panel width to
match the datagrid width. The datagrid width grows depending on the
data being displayed. I tried setting the panel style width to the
datagrid width after the datagrid is bound. But the panel is being set
to the datagrid width I set at design time, not the actual datagrid
width once it has been rendered. I suspect that there may be a way to
do this using Javascript and will experiment. I was just wondering if
anyone has done something like this. Any guidance or advice would be
greatly appreciated.

Nov 19 '05 #2


That sounds simple enough. I'll give it a try.

Thanks

Lou
Eliyahu Goldin wrote:
Don't do this sort of things in javascript. You should align your controls properly in tables. Put the panel and the datagrid in the same column in an html table and the browser will do the job for you nicely.

Eliyahu


Nov 19 '05 #3
Eliyahu,

It works perfectly. I set the width of the panel and datagrid to 100%,
put them in the same column of a table with one row and they always
align.

Thanks again.

Lou

Nov 19 '05 #4

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

Similar topics

2
by: TR | last post by:
Hi All: I have a simple test GUI that has 2 panels (a left side and a right side), and each panel is displaying an image. The left panel has a hardcoded size of (600,400) using the Dimension()...
1
by: John | last post by:
I'm trying to use the DrawText() method to draw some very long string text on the Panel with AutoScroll enabled. However, for some unknown reasons, I could not trigger the ScrollBar to show up. ...
2
by: Alexander | last post by:
Hi, I have a simple Problem. I want to center a dialog on a panel of an application. I do the following: public class MyDialog : System.Windows.Forms.Form { private Panel m_ParentPanel; ...
3
by: Harry | last post by:
Hi, Can anyone help. I have a asp.net page (c#), with two panels, both of which have asp:textboxes on. When I press the first button, the second panel shows fine. When I press the button in...
3
by: Pavan | last post by:
Hi All, I am having a wierd problem while displaying my panel. My code is something like this <table> <tr> <td width=100>label</td> <td width=100>label</td> <td width=100>label</td> <td...
1
by: Frank | last post by:
Hello, I have some text boxes and 2 drop down lists (DDL) within a panel like so: Everything updates fine but the values from the DDLs are always the items selected by default. In other words,...
2
by: Diogo Alves - Software Developer | last post by:
Greetings I would like to knowhow can I put a sliding panel... I've done this: if (panel1.Width < 300) { while (panel1.Width < 300) { panel1.Width = panel1.Width + 40;
1
by: mbruyns | last post by:
i have been trying (and sometimes succeeding) to use the modalpopupextender to show various panels of controls on my asp pages. the strange problem that i keep on running into is that sometimes it...
4
hemantbasva
by: hemantbasva | last post by:
We have designed an aspx page having five ajax tab in it. the data of first four are designed on page whereas for the fifth tab it renders a user control named MYDOMAIN. in the tab container's even...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.