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

Batch Editing

3 Answers 18 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mansi A.
Top achievements
Rank 1
Mansi A. asked on 16 Jun 2014, 04:20 PM
Hi, 
  1- How to avoid adding new record when press enter after editing a cell ? 

  2- How to hide Add new record button ?

Thanks
Mansi 

3 Answers, 1 is accepted

Sort by
0
Mansi A.
Top achievements
Rank 1
answered on 17 Jun 2014, 02:22 AM
Answer 2

protected void RadGrid1_PreRender(object sender, EventArgs e){
 RadGrid1.MasterTableView.CommandItemSettings.ShowAddNewRecordButton = true; 
 RadGrid1.Rebind(); 
}
0
Shinu
Top achievements
Rank 1
answered on 17 Jun 2014, 11:58 AM
Hi Mansi,

1) Try the following js to avoid Add new record popup on enter key press.

JS:
function pageLoad(sender, args) {
      theForm.onkeypress = function (e) {
          e = e || window.event;
          if (e.keyCode == 13) {
              if (e.preventDefault) e.preventDefault();
              if (e.stopPropagation) e.stopPropagation();
              e.cancelBubble = false;
              return false;
          }
      }
  }

2. In order to hide Add New Record button, please set the CommandItemSettings property ShowAddNewRecordButton  as 'False'.

Thanks,
Shinu.
0
Mansi A.
Top achievements
Rank 1
answered on 17 Jun 2014, 03:54 PM
Working, Thank you Shinu
Tags
Grid
Asked by
Mansi A.
Top achievements
Rank 1
Answers by
Mansi A.
Top achievements
Rank 1
Shinu
Top achievements
Rank 1
Share this question
or