CSS and textbox size

M

Maziar Aflatoun

Hi everyone,

I have the following EditCommandColumn

<Columns>

<asp:BoundColumn DataField="Qty" HeaderText="Qty"
HeaderStyle-Font-Bold="True" HeaderStyle-CssClass="normtext"
ItemStyle-CssClass="normtext"></asp:BoundColumn>

<asp:EditCommandColumn ButtonType="LinkButton" EditText="Edit"
CancelText="Cancel" UpdateText="Update"
HeaderStyle-CssClass="normtext" ItemStyle-Wrap="false" HeaderText="Edit"
HeaderStyle-Wrap="false" HeaderStyle-Font-Bold="True" />
</Columns>

How do I assign a CSS tag to the hyperlinks 'Edit' and once clicked 'Update'
and 'Cancel' in my datagrid rows? Also, once the user clicks edit on a row
it creates a textbox for users to input their Qty value. How do I set the
TextBox width in that row?

Thank you
Maziar A.
 
T

Trevor Benedict R

Sorry about the previous post.
Change your code to something like this

<Columns>

<asp:BoundColumn DataField="Qty" HeaderText="Qty"
HeaderStyle-Font-Bold="True" HeaderStyle-CssClass="normtext"
ItemStyle-CssClass="normtext"></asp:BoundColumn>

<asp:EditCommandColumn ButtonType="LinkButton" EditText="<div
class='ClassNameHere'>Edit</div>"
CancelText="<div class='ClassNameHere'>Cancel</div>" UpdateText="Update"
HeaderStyle-CssClass="normtext" ItemStyle-Wrap="false" HeaderText="Edit"
HeaderStyle-Wrap="false" HeaderStyle-Font-Bold="True" />
</Columns>


You can even go one step ahead and use an <b>image</b> like this.

<Columns>

<asp:BoundColumn DataField="Qty" HeaderText="Qty"
HeaderStyle-Font-Bold="True" HeaderStyle-CssClass="normtext"
ItemStyle-CssClass="normtext"></asp:BoundColumn>

<asp:EditCommandColumn ButtonType="LinkButton" EditText="<img
src='images/editimage.gif' border=0 class='ClassNameHere'/>"
CancelText="<img src='images/cancelimage.gif' border=0
class='ClassNameHere'/>" UpdateText="Update"
HeaderStyle-CssClass="normtext" ItemStyle-Wrap="false" HeaderText="Edit"
HeaderStyle-Wrap="false" HeaderStyle-Font-Bold="True" />
</Columns>

HTH

Trevor Benedict R
MCSD


*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
T

Trevor Benedict R

and as for the width of the TextBox you can use the designer to Edit the
control or go to the SOurce View in VS.NET and add the WIDTH attribute
to the template column where you have the Textbox declared.

For more sample you can also visit http://www.datagridgirl.com

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 
M

Maziar Aflatoun

Hi,

Thanks for your help. But it still doesn't work and I think it's because the
css appears inside the Edit tag.

<a
href="javascript:__doPostBack('ShoppingCart1$DGShoppingCart$_ctl2$_ctl0','')"><div
class='linksmall'>Edit</div></a>

Is there anyway to add the css to <a href="..."... > tag?

Thanks
Maz.
 
T

Trevor Benedict R

I forgot something. Use this code snippet instead

<Columns>

<asp:BoundColumn DataField="Qty" HeaderText="Qty"
HeaderStyle-Font-Bold="True" HeaderStyle-CssClass="normtext"
ItemStyle-CssClass="normtext"></asp:BoundColumn>

<asp:EditCommandColumn ButtonType="LinkButton" edittext="&lt;img
src='images/editimage.gif' border=0 class='ClassNameHere'&gt;"
canceltext="&lt;img src='images/cancelimage.gif' border=0
class='ClassNameHere'&gt;" UpdateText="Update"
HeaderStyle-CssClass="normtext" ItemStyle-Wrap="false" HeaderText="Edit"
HeaderStyle-Wrap="false" HeaderStyle-Font-Bold="True" />
</Columns>

Regards,

Trevor Benedict R
MCSD

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top