|
Paul Riley wrote:
I haven't played with WebControls yet but that's a good plan.
Yes, its very easy
Just make your control in your favourite HTML editor. Copy the HTML to C# strings, make some variables and use String.Format() to assign in HTML. As easy as pie (not that I ever made one, but at least I'm eating one now )!
Cheers
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
actually, CheckBox is a special case. MS made some tradeoffs with CheckBox and RadioButton which aren't readily apparent until you try to add script to them. The surrounding span tag exists so that styles applied to the checkbox will also apply to the label.
one would be better off using the HtmlInputCheckBox and HtmlInputRadioButton for these types of issues. This is because these two more closely match the API for the html elements, and thus have better javascript integration abilities.
|
|
|
|
|
I have a result set in an array of objects, which I bind to the data grid. How can I page this? I tried the properties, I actually paged, except that inspite of clicking on page 1 or 2, it always shows page 1. How does page 2 get shown?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
When you click on a page link, it simply throws back a PageIndexChanged event which you then need to handle. DataGrid1.CurrentPageIndex = e.NewPageIndex will change the page for you but note that you must DataBind the grid after you change the index.
Paul
|
|
|
|
|
Thank you.
I am getting used to others doing the work for me
modified 29-Aug-18 21:01pm.
|
|
|
|
|
The paging works! Thanks again.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Hi all
I have a TextArea in a TABLE, but I want it t occupy the width of the table. How can this be done? COLS property is not handy at all!
CHeers
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
I think you can use width="100%" but I also have it in mind that this only works in IE5+. I may be wrong on both counts. I tend to stick to set widths wherever possible with textboxes; not pretty but it works and with all browsers.
Paul
|
|
|
|
|
|
Roger Wright wrote:
Use COLSPAN instead.
Doesnt work either....
Thanx
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Give us an example of your code.
Paul
|
|
|
|
|
OK
I have tried the COLSPAN in the TD , and width in TD.
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
You only have one TD in a TR? Is that common all the way down?
Did I read your question right the first time around? Was you saying that the textarea must fill the TD? In which case I return to my original answer: style="width: 100%" .
We were thinking you said that it must fill the width of the TABLE, so you needed to use colspan to make the TD several columns wide.
Paul
|
|
|
|
|
Paul Riley wrote:
style="width: 100%".
Ahhh thanx, learnt something new there It works now, just had to add to my CSS class.
Cheers
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
How are you using it? A TEXTAREA tag must have a /TEXTAREA closing tag, and is valid only within a form. Put a form inside a TD element, with a TEXTAREA inside the form, and apply the COLSPAN attribute to the TD.
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Like this? Same problem TEXTAREA is fixed.
???
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
I copied this code exactly into a new html document and it worked perfectly. Within the TEXTAREA tagset the COLS attribute controls how many horizontal character spaces are dislayed; initially I saw about 80% width, so I then changed it to display COLS="120". This expanded the display area to the full screen width. The size of a TEXTAREA is measured in characters and rows of characters; I know of no way to make it variable. The COLSPAN attribute works only to allow it to spread across multiple columns of a table - your example is a one column table, so it wouldn't have any effect.
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Roger Wright wrote:
I know of no way to make it variable
Using style="width:100%;" works
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Roger Wright wrote:
A TEXTAREA tag must have a /TEXTAREA closing tag, and is valid only within a form.
OK I assume for the text to be sent to the server it must be in a FORM tag. Then I add this, BUT the FORM tag creates these extra padding inside the table as if was adding another row/line. Is there a way make this go away?
OK I have solved Just added the FORM tags around the TD tags... is that oK?
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
I'm still experimenting myself... I figure whatever works is good enough. Elegant solutions can wait until I'm an expert
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Woops. I read your question completely wrong. Go with Roger's answer
Paul
|
|
|
|
|
leppie wrote:
I have a TextArea in a TABLE, but I want it t occupy the width of the table. How can this be done? COLS property is not handy at all!
Use CSS like so:
<table style="width:400px; height: 400px;">
<tr>
<td>Description</td>
<td style="width: 200px;"><textarea id="txtDescription style="width: 100%; height: 100%"></textarea></td>
</tr>
</table>
In that example you are "telling" the textarea element to fill it's containing elements available space by using the 100% attribute value.
CSS rocks people, use it
|
|
|
|
|
Paul Watson wrote:
CSS rocks people, use it
I use where I can It does get confusing sometimes though
Before you criticize a man, walk a mile in his shoes. That way, when you do criticize him, you'll be a mile away and have his shoes.
|
|
|
|
|
I was under the impression that CSS has serious limitations with uniform behavior over a variety of browsers, so I've been sticking to what I can do with the basics. Is that not the case anymore?
Word of the day: Rotundacrat
Extra Credit will be awarded for: Quasimobo...
|
|
|
|
|
Roger Wright wrote:
I was under the impression that CSS has serious limitations with uniform behavior over a variety of browsers, so I've been sticking to what I can do with the basics. Is that not the case anymore?
It's less true since NS6 came out but it can still be a pain. I guess it depends if you want to be able to appeal to the 5%-or-so of people who refuse to use IE
Paul
|
|
|
|