This question is locked. New answers and comments are not allowed.
Beethoven124
Top achievements
Rank 1
Beethoven124
asked on 26 May 2010, 06:25 PM
Hi,
I have a grid with ajax databinding and my question is whether is it possible to set the edit mode by default on the grid? So I will load the page to see my grid in edit mode.
Dear Beethoven
I have a grid with ajax databinding and my question is whether is it possible to set the edit mode by default on the grid? So I will load the page to see my grid in edit mode.
Dear Beethoven
7 Answers, 1 is accepted
0
Hi Beethoven124,
It is possible by using the grid client-side API. You can call the editRow JavaScript method of the grid. This can be done by handling the initial ondatabound event
<script type="text/javascript">
function ondatabound(){
setTimeout(function() {
var grid = $('#Grid').data('tGrid');
grid.editRow($('#Grid tr:has(td):eq(0)'));
}, 0);
}
</script>
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
It is possible by using the grid client-side API. You can call the editRow JavaScript method of the grid. This can be done by handling the initial ondatabound event
<script type="text/javascript">
function ondatabound(){
setTimeout(function() {
var grid = $('#Grid').data('tGrid');
grid.editRow($('#Grid tr:has(td):eq(0)'));
}, 0);
}
</script>
Regards,
Atanas Korchev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Beethoven124
Top achievements
Rank 1
answered on 28 May 2010, 06:52 PM
Hi,
i tried it but i get an error in firebug for firefox "data is undefined". What´s going wrong?
Beethoven
i tried it but i get an error in firebug for firefox "data is undefined". What´s going wrong?
Beethoven
0
Hello Beethoven124,
Did you search for correct grid? In $('#Grid') you need to replace "#Grid" with the id of your grid. For instance if the grid ID is "TestGrid", the code should look like so $('#TestGrid'). If the problem still persists, you can try to debug the code and see if the $('#Grid_ID') actually returns something.
Regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Did you search for correct grid? In $('#Grid') you need to replace "#Grid" with the id of your grid. For instance if the grid ID is "TestGrid", the code should look like so $('#TestGrid'). If the problem still persists, you can try to debug the code and see if the $('#Grid_ID') actually returns something.
Regards,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Beethoven124
Top achievements
Rank 1
answered on 28 May 2010, 07:38 PM
Hi,
I will try it, but #Grid is the name of my Grid like Html.Telerik().Grid<NerdDinner.Models.DinnerFormViewModel>().Name("Grid")....
The <NerdDinner.Models.DinnerFormViewModel> is corrent. I see my Grid with all the data. Unfortunately, I can only test on monday. And I will debug my code.
Thx for your help.
Beethoven
0
H
Top achievements
Rank 1
answered on 26 Aug 2010, 02:27 PM
I'd like to use this to default to Edit mode too - but I can't figure out where I place the script. Where do I place the script to get it to execute?
We are not using Ajax, does that make a difference?
Thanks.
We are not using Ajax, does that make a difference?
Thanks.
0
Emmanuel
Top achievements
Rank 1
answered on 01 Sep 2010, 08:09 PM
I am getting the same issue
Error message in Firebug: "data is undefined"
I am pointing at the right Id and the Id does exist.
(Why does the code have to be in a Timeout method?)
Also, is it possible to have more than one row in Edit mode at the same time?
Error message in Firebug: "data is undefined"
I am pointing at the right Id and the Id does exist.
(Why does the code have to be in a Timeout method?)
Also, is it possible to have more than one row in Edit mode at the same time?
0
Donna Stewart
Top achievements
Rank 1
answered on 28 Jan 2011, 09:34 PM
Did anyone ever get this to work?
Thanks!
Donna
Thanks!
Donna