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

RadGrid - Set Edit mode on Particular Column.

1 Answer 264 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 18 Dec 2014, 01:53 PM
Hi..

I'm looking to set the edit mode of a particular column.. I have Editforms Mode setup on rest of the RadGrid which I would like to retain.  I wish to load the page with this column in batch edit mode so I can type a reference and use this to extract information in each row..

How can I dynamically set the edit mode to batch for this particular column, whilst retaining the editforms mode for my other columns..?

1 Answer, 1 is accepted

Sort by
0
Dave
Top achievements
Rank 1
answered on 22 Dec 2014, 12:28 PM
rather a bog way of doing it but in the end I set the edit mode to batch on click of a button and back again when the button was toggled.. It works for what I need..

 protected void rut_Click(object sender, EventArgs e)
        {
           if (RadGrid1.MasterTableView.GetColumn("Map").Display != true)
            {
                RadGrid1.MasterTableView.EditMode = GridEditMode.Batch;
                RadGrid1.MasterTableView.BatchEditingSettings.EditType = GridBatchEditingType.Cell;
                RadGrid1.MasterTableView.GetColumn("Map").Display = true;
                foreach (GridColumn col in RadGrid1.MasterTableView.Columns)
                    if (col.UniqueName == "sample" || col.UniqueName == "test")
                    {
                        GridBoundColumn boundColumn = col as GridBoundColumn;
                        boundColumn.ReadOnly = true;
                    }
                                       
             }
               
           else
            {
               RadGrid1.MasterTableView.EditMode = GridEditMode.EditForms;                
               RadGrid1.MasterTableView.GetColumn("Map").Display = false;
               foreach (GridColumn col in RadGrid1.MasterTableView.Columns)
                   if (col.UniqueName == "sample" || col.UniqueName == "test")
                   {
                       GridBoundColumn boundColumn = col as GridBoundColumn;
                       boundColumn.ReadOnly = false;
                   }
            }
           
            RadGrid1.Rebind();
        
        }
Tags
Grid
Asked by
Dave
Top achievements
Rank 1
Answers by
Dave
Top achievements
Rank 1
Share this question
or