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

SetInsertRow=true click event

7 Answers 41 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Abhay
Top achievements
Rank 1
Abhay asked on 27 Dec 2011, 05:50 PM
I have applied SetInsertRow=true property to my telerik group but I need to ask if there is any click event associated with this property. When i click on "Click here to add new row" tab which appears when i apply this property I need to carry out some validations and set CanUserInsertRows= true or false based on that. Please tell me if there is any click even for "Click here to add new row" tab????

7 Answers, 1 is accepted

Sort by
0
Accepted
Maya
Telerik team
answered on 27 Dec 2011, 06:25 PM
Hello Abhay,

Actually, when you click on that specific area, AddingNewDataItem event will be fired. As it is cancelable, you can perform the required logic inside and stop insertion of a new item, if it fails. 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Abhay
Top achievements
Rank 1
answered on 28 Dec 2011, 06:18 AM
The solution you have suggested isnt working,,,,,,,,,, i applied AddNewItem event and checked the validation within it but it isnt validating and insertion of rows is happening as usual. Please suggest an alternative or elaborate on the current solution.
0
Maya
Telerik team
answered on 28 Dec 2011, 08:38 AM
Hello Abhay,

Could you verify what is the exact scenario that you want to implement ? Do you want to be able to cancel insertion of a new item or you want to validate it while editing ? Do you require performing validation for all items ?
Generally, any relevant information about your exact requirements would be helpful.

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Abhay
Top achievements
Rank 1
answered on 28 Dec 2011, 10:30 AM
Thanks, that worked! I am facing one more trouble,,,,,,, in my grid I wish to have first column as a Read only Serial number column( should start from 1 and auto increment for each row added). It should be auto increment column and self generation. Is there any such property for columns in radgrid?  
0
Accepted
Maya
Telerik team
answered on 28 Dec 2011, 10:33 AM
Hello,

You can take a look at this demo for a reference.
 

Regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Abhay
Top achievements
Rank 1
answered on 28 Dec 2011, 01:26 PM
It is working,,,, thanks a ton!!!!! Initially I had some trouble with this.Refresh() inside OnPropertyChangedmethod on MyColumn page. In my case i just commented it out and it started working. Could you please explain the purpose of that statement and how it should be?
0
Maya
Telerik team
answered on 28 Dec 2011, 01:30 PM
Hi,

Generally, this statement ensures that when you remove an item, the values of the column (the indices of the items) are correctly recalculated.
 

Greetings,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
GridView
Asked by
Abhay
Top achievements
Rank 1
Answers by
Maya
Telerik team
Abhay
Top achievements
Rank 1
Share this question
or