This is a migrated thread and some comments may be shown as answers.

Auto generated command column width?

2 Answers 94 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bob
Top achievements
Rank 1
Bob asked on 30 Dec 2008, 03:26 PM
Hi folks,

Got a tiny problem with width of the edit column.
It is sized correct while it says Edit, but Update Cancel shows as
Update ...
With only the first . visible.

The entire grid is autogenerated declaratively.  It does this no matter what skin I use.

I'm sure it's something from my CSS, but that was designed by another person.  How can I make the autogenerated edit column be wide enough to display its content?

I can get the button like so:
 
        If TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then  
            Dim cancelButton As LinkButton = CType(e.Item.FindControl("AutoGeneratedCancelButton"), LinkButton)  
 

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 30 Dec 2008, 03:43 PM
Hello Bob,

You can use ColumnCreated event to access this auto-generated column:

Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated
            If e.Column.UniqueName = "AutoGeneratedEditColumn" Then
                e.Column.HeaderStyle.Width = Unit.Pixel(100)
            End If
        End Sub

Greetings,
Vlad
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Bob
Top achievements
Rank 1
answered on 31 Dec 2008, 05:54 PM
thanks, that did it.
Tags
Grid
Asked by
Bob
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Bob
Top achievements
Rank 1
Share this question
or