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

[Solved] Grid with EditForms mode hide non-edit row

2 Answers 79 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 28 Oct 2009, 03:49 PM
Hi,

I've got a grid that I am setting up so that ALL rows are editable.  I'm using the second method in the http://www.telerik.com/help/aspnet-ajax/grddefaulteditmodeforgriditemsoninitialload.html example.  This method specifies that you need to set the EditMode of the grid to EditForms.  I've done that and it works however I need the grid to now hide the non-editable rows.  At the moments its:
Row 1 data
Row 1 Edit form
Row 2 data
Row 2 Edit form

I want to get rid of the data row.  Any ideas. 

Regards,

Jon

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 29 Oct 2009, 05:59 AM
Hello Jon,

You can hide the data rows in the grid using the following code:
c#:
 protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        foreach (GridDataItem dataItem in RadGrid1.MasterTableView.Items) 
        { 
            dataItem.Visible = false;               
        }         
    } 

Thanks
Princy.
0
Jon
Top achievements
Rank 1
answered on 29 Oct 2009, 09:19 AM
Many thanks Princy,

Works perfectly!

Best Regards,

Jon
Tags
Grid
Asked by
Jon
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jon
Top achievements
Rank 1
Share this question
or