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

RadGrid InPlace Edit of specific column

3 Answers 471 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 22 Sep 2010, 02:30 PM
Hi,

I have a grid with 5 columns, what I want to do is when editing a row, only the 5th column is editable, columns 1-4 should remain as it is, is this possible? can you please point me to a good example.

Thanks in advance
John

3 Answers, 1 is accepted

Sort by
0
Siddharth Macwan
Top achievements
Rank 1
answered on 22 Sep 2010, 03:33 PM
Hi

I am developing a Bulk edit Grid where the "Note" column is richtext and I have RADEditor to edit in Edit mode... In multiple rows editable mode I am make all cells editable which displays editors for the "Note" colums in all rows which makes the Grid looks so big and bulky...to Improve the UI

(1) I want to show the (minimum size) 1 line radeditor  in all the rows for the "Note" Column and onfocus (in current Cell) the editor should get expanded for edit and should be collapsed on blur

I would appriciate if you can show me some sample to resize radeditor (just for current cell) in edit mode..(using Javascript)

Let me know if you need any clarification

Thanks
Sid
0
Accepted
Carlos Contreras
Top achievements
Rank 1
answered on 22 Sep 2010, 06:45 PM

Hi John!

If you're editing/inserting in InPlace Mode, then the solution is very easy.

You only have to set to True the ReadOnly property of the columns you don't want to be edited/inserted. (In your case, columns 1 to 4),

Note: This way works if you're not using the AutoGenerateColumns option in your RadGrid. Otherwise, you could achieve that in CodeBehind like this:

protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
   if (e.CommandName == "Edit") 
   
      (RadGrid1.MasterTableView.GetColumn("Col1") as GridBoundColumn).ReadOnly = true;
      (RadGrid1.MasterTableView.GetColumn("Col2") as GridBoundColumn).ReadOnly = true;
      RadGrid1.MasterTableView.Rebind(); 
   
}


Where Col1 and Col2 should be your columns' UniqueName.


Good Luck!
0
John
Top achievements
Rank 1
answered on 23 Sep 2010, 02:55 AM
Thanks Carlos, got it to work.
John
Tags
Grid
Asked by
John
Top achievements
Rank 1
Answers by
Siddharth Macwan
Top achievements
Rank 1
Carlos Contreras
Top achievements
Rank 1
John
Top achievements
Rank 1
Share this question
or