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

Grid - Edit mode Styling issues

3 Answers 98 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Richard
Top achievements
Rank 2
Richard asked on 19 Mar 2009, 01:29 PM
Hello

I am fiddling with the MasterTableView/EditMode by setting the property to InPlace/EditFormsPopup but I seem to have some styling issues possibly.

When I click "Edit" for a record, the textfields that are generated are very short (enough for around 3 characters).  I am not sure if a page stylesheet is causing this, but how can I see the default size of all textboxes or each one individually if possible?

Also, how do I set Update/Cancel to be image icons instead of text if possible please?
Thank you
R

3 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 20 Mar 2009, 10:59 AM
Hello Richard,

To set the textbox width of the GridBoundColumn when it is in edit mode, you can either use the following code:

  protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)  
    {  
        if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode))  
        {  
            GridEditableItem edititem = (GridEditableItem)e.Item;  
            TextBox txtbx = (TextBox)edititem["ColumnUniqueName"].Controls[0];  
            txtbx.Width = Unit.Pixel(100);  
        }   
          
    }  
Or you can set column editors for various columns and set their styles declaratively. Refer to the following help document for more information:
Declarative style editors

Also check out the following help document to display the action buttons as images:
Customizing the action buttons in Telerik RadGrid

Thanks
Princy.
0
Richard
Top achievements
Rank 2
answered on 25 Mar 2009, 03:06 PM
Hi
Any chance of getting this in Vb please? I tried converting it myself but found myself a little muddled.
Cheers
R

Also, is this the main telerik way of setting default width for fields in edit mode? 
thx
0
Accepted
Sebastian
Telerik team
answered on 25 Mar 2009, 04:10 PM
Hello Richard,

You can use our free online converter to port the C# code in VB.NET language:

http://converter.telerik.com/

Additionally, you may consider the declarative approach with style editors explained in the first help article linked by Princy in the previous reply.

Best regards,
Sebastian
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Richard
Top achievements
Rank 2
Answers by
Princy
Top achievements
Rank 2
Richard
Top achievements
Rank 2
Sebastian
Telerik team
Share this question
or