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

InPlace Editing and Delete Column

2 Answers 101 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jay Legere
Top achievements
Rank 1
Jay Legere asked on 02 Aug 2009, 12:17 AM
Sorry if this has been answered - I couldn't find anything via Search...

I am using the Q2 2008 version of the grid and I have and edit column and a delete column.  Following the examples, the edit column is a <telerik:GridEditCommandColumn> and the delete column is a <telerik:GridButtonColumn> wuth Command="Delete".

The problem that i'm seeing is that when I put a row in edit mode the delete image disappears (as it should) but the that column has no border on the top or the bottom (I'm using the "Hay" skin).  I was pretty sure that this was because there was nothing rendered in that column when in edit mode and a quick look at the source confirms that it is just an empty table cell (<td></td>).

I tried adding a Label control to that cell at runtime (with Text["&nbsp;") but that didn't work.

Is this a known issue or am I doing something wrong?

Thanks,  Jay

Code for the "<Columns>" section of the grid:

 

<Columns> 
    <telerik:GridTemplateColumn UniqueName="LeftSpacer" 
        HeaderStyle-Width="6" 
        ItemStyle-Width="6">  
        <HeaderTemplate> 
            &nbsp;  
        </HeaderTemplate> 
    </telerik:GridTemplateColumn> 
    <telerik:GridBoundColumn UniqueName="State" 
        HeaderText="State" 
        HeaderStyle-Width="100" 
        ItemStyle-VerticalAlign="Top" 
        ItemStyle-Width="100" 
        DataField="State" /> 
    <telerik:GridBoundColumn UniqueName="ZIPCode" 
        HeaderText="ZIP Code" 
        HeaderStyle-Width="100" 
        ItemStyle-VerticalAlign="Top" 
        ItemStyle-Width="100" 
        DataField="ZIPCode" /> 
    <telerik:GridEditCommandColumn UniqueName="Edit" 
        ButtonType="ImageButton" 
        EditImageUrl="~/_Images/GIF/16x16/Edit.gif" 
        ItemStyle-Width="50" /> 
    <telerik:GridButtonColumn UniqueName="Delete"   
        ButtonType="ImageButton" 
        CommandName="Delete" 
        Text="Delete" 
        ConfirmText="Delete this state and ZIP code?" 
        ConfirmTitle="Delete State and ZIP Code" 
        ImageUrl="~/_Images/GIF/16x16/Delete.gif" /> 
    <telerik:GridTemplateColumn UniqueName="RightSpacer" 
        HeaderStyle-Width="6" 
        ItemStyle-Width="6">  
        <HeaderTemplate> 
            &nbsp;  
        </HeaderTemplate> 
    </telerik:GridTemplateColumn> 
</Columns> 
 

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 03 Aug 2009, 07:37 AM
Hi Jay,

I am using RadControls for asp.net AJAX(2009.01.0311.20). Give a try with the following approach and see whether it helps.

CS:
 
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) 
    { 
        if ((e.Item is GridEditableItem) && (e.Item.IsInEditMode)) 
        { 
            GridEditableItem editItem = (GridEditableItem)e.Item; 
            TableCell cell = (TableCell)editItem["Delete"]; 
            cell.Text = "&nbsp;"
        } 
    } 

If this does not help i would suggest you to upgrade RadControls to the latest version.

Shinu

0
Jay Legere
Top achievements
Rank 1
answered on 03 Aug 2009, 03:08 PM
Shinu,

Worked great!  Thanks!

Jay
Tags
Grid
Asked by
Jay Legere
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jay Legere
Top achievements
Rank 1
Share this question
or