Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Datagrid - How to format EditCommandColumn?

Reply
Thread Tools

Datagrid - How to format EditCommandColumn?

 
 
corndog
Guest
Posts: n/a
 
      06-14-2005
I have a Datagrid control with an edit command column, which has a
PushButton ButtonType.

I am trying to apply formatting to the button, to set the font-size and the
font name.

I have only been able to come up with the following...

<asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update"
CancelText="Cancel" EditText="Edit">
<HeaderStyle Width="10%"></HeaderStyle>
<ItemStyle Font-Names="Verdana" Font-Size="8pt"></ItemStyle>
</asp:EditCommandColumn>

This however applies formatting to the cell that the button is contained
in, not the button. Is there any way to do this?

 
Reply With Quote
 
 
 
 
Harolds
Guest
Posts: n/a
 
      06-14-2005
Use the datagrids ItemDataBound, below is a sample where I get the control
and change the text:
Private Sub grd_ItemDataBound(ByVal sender As System.Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
grdIncidentSearch.ItemDataBound
If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
ListItemType.AlternatingItem Then
Dim lnk As LinkButton = e.Item.FindControl("ControlName")
lnk.Text = "text"
End If
End Sub

 
Reply With Quote
 
 
 
 
corndog
Guest
Posts: n/a
 
      06-14-2005
But the EditCommandColumn does not have an "id" property for its button so I
don't believe the FindControl method can be used.

"Harolds" wrote:

> Use the datagrids ItemDataBound, below is a sample where I get the control
> and change the text:
> Private Sub grd_ItemDataBound(ByVal sender As System.Object, ByVal e As
> System.Web.UI.WebControls.DataGridItemEventArgs) Handles
> grdIncidentSearch.ItemDataBound
> If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
> ListItemType.AlternatingItem Then
> Dim lnk As LinkButton = e.Item.FindControl("ControlName")
> lnk.Text = "text"
> End If
> End Sub
>

 
Reply With Quote
 
Harolds
Guest
Posts: n/a
 
      06-14-2005
Use a template column

"corndog" wrote:

> But the EditCommandColumn does not have an "id" property for its button so I
> don't believe the FindControl method can be used.
>
> "Harolds" wrote:
>
> > Use the datagrids ItemDataBound, below is a sample where I get the control
> > and change the text:
> > Private Sub grd_ItemDataBound(ByVal sender As System.Object, ByVal e As
> > System.Web.UI.WebControls.DataGridItemEventArgs) Handles
> > grdIncidentSearch.ItemDataBound
> > If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType =
> > ListItemType.AlternatingItem Then
> > Dim lnk As LinkButton = e.Item.FindControl("ControlName")
> > lnk.Text = "text"
> > End If
> > End Sub
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How can I save the style of a datagrid so that it appears on the automatic format to use iin another datagrid? Luis Esteban Valencia ASP .Net Datagrid Control 1 11-25-2004 08:05 AM
NTFS quick format and normal format Guan Foo Wah MCSE 2 05-08-2004 11:35 PM
Date Format - best way of converting a string into a date format Brian Candy ASP .Net 2 02-18-2004 02:13 PM
To all Gurus: How can I edit/update a DataGrid in a DataGrid (nested DataGrid)? Possible? Andreas Klemt ASP .Net Datagrid Control 0 10-08-2003 01:19 AM



Advertisments