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

[Solved] EditForm (in line) - Display/behavior adjustments

6 Answers 87 Views
Grid
This is a migrated thread and some comments may be shown as answers.
J
Top achievements
Rank 1
J asked on 14 Mar 2013, 01:58 PM
See attached screenshot.

Does anyone know how to remove the column border lines?  I'd like to remove the one in between the final 2 columns in the screen shot (the one right before the Delete (X) button).

Also, when I'm using the Tab key to move from column to column, I'd like to prevent the Delete (X) button from being able to be tabbed to.  Any ideas on how to do this?

Thanks again.

6 Answers, 1 is accepted

Sort by
0
J
Top achievements
Rank 1
answered on 18 Mar 2013, 08:21 PM
Anyone know if these are possible?
0
Kostadin
Telerik team
answered on 19 Mar 2013, 01:13 PM
Hello Juan,

You could use a CSS rule in order to remove the borders. Note that you have to set a CssClass in order to apply the style just to that column.
html .RadGrid .rgMasterTable .rgRow .CustomClass,
        html .RadGrid .rgMasterTable .rgAltRow .CustomClass
        {
            border:none;
        }

As to your second requirement you could set a tabindex to -1. This way the delete button could not be focused.

Kind regards,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
J
Top achievements
Rank 1
answered on 19 Mar 2013, 01:34 PM
Where would I set the TabIndex?  I tried on the column's definition and item style but no go.  Here is my column's definition:

<telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" FilterControlAltText="Filter DeleteColumn column"
    ImageUrl="Images/305_Close_16x16_72.png" Text="" UniqueName="DeleteColumn" Resizable="false"
    ConfirmText="Remove this athelete?" ConfirmDialogType="RadWindow" ConfirmTitle="Remove"
    ShowInEditForm="True">
    <HeaderStyle Wrap="False" HorizontalAlign="Left" Width="24px" CssClass="grid-header grid-header-last">
    </HeaderStyle>
    <ItemStyle Width="100%" HorizontalAlign="Right" VerticalAlign="Top" />
</telerik:GridButtonColumn>

I know I can remove it from the edit form, but I don't want that.  I want them to be able to click Delete, just not tab to it.
0
Accepted
Kostadin
Telerik team
answered on 22 Mar 2013, 08:23 AM
Hello Juan,

Note that you have to add it as an attribute of the LinkButton. Check out the following code snippet.
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem item = e.Item as GridDataItem;
            LinkButton delButton = item["DeleteButtonColumnUniqueName"].Controls[0] as LinkButton;
            delButton.Attributes.Add("tabindex", "-1");
        }
    }

Greetings,
Kostadin
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
J
Top achievements
Rank 1
answered on 22 Mar 2013, 12:18 PM
Awesome.  TY so much.
0
J
Top achievements
Rank 1
answered on 29 Mar 2013, 09:41 PM
FYI, I got it working and it doesn't need to be a LinkButton.

Here is the code in case anyone else might find it useful:

protected void grdAthletes_ItemDataBound(object sender, GridItemEventArgs e)
{
Control ctrlFields = null;
 
    try
    {
        if (e.Item.IsInEditMode)
        {
            ctrlFields = ((GridEditableItem)e.Item)["DeleteColumn"].Controls[0];
            ((ImageButton)ctrlFields).TabIndex = -1;
        }
    }
    catch (Exception ex)
    {
        System.Diagnostics.Debug.Print("Error: " + ex.ToString());
        Exceptions.ProcessModuleLoadException(this, ex);
    }
}
Tags
Grid
Asked by
J
Top achievements
Rank 1
Answers by
J
Top achievements
Rank 1
Kostadin
Telerik team
Share this question
or