3 Answers, 1 is accepted
0
Hello Prakash,
The requirement you have could not be achieved, since the "EditItemTemplate" is the same for every grid item and the server-side "TextChanged" event of TextBox control will fire only once (with values from the last edited item).
Since the purpose for that requirement is not specified in your post, I could only suggest an approach for getting the edited items row index by using the "BatchEditCommand" server-side event of the grid:
Hope that helps.
Konstantin Dikov
Telerik
The requirement you have could not be achieved, since the "EditItemTemplate" is the same for every grid item and the server-side "TextChanged" event of TextBox control will fire only once (with values from the last edited item).
Since the purpose for that requirement is not specified in your post, I could only suggest an approach for getting the edited items row index by using the "BatchEditCommand" server-side event of the grid:
protected
void
RadGrid1_BatchEditCommand(
object
sender, GridBatchEditingEventArgs e)
{
for
(
int
i = 0; i < e.Commands.Count; i++)
{
int
itemIndex = (e.Commands[i].Item
as
GridDataItem).ItemIndex;
}
}
Hope that helps.
Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Prakash
Top achievements
Rank 1
answered on 13 Sep 2013, 11:14 AM
Hi Konstantin Dikov,
I will explain you the purpose to which I need.
I have a scenario in which I can type the code of an employee in edititemtemplate textbox, after typing once if i press tab or change the focus of that textbox, I have to retrieve the employee details relative to the code from the database and I should write those details in the same row in columns first name and last name(example say first name and last name of the employee). The first name and last name columns will not have edititemtemplate. All these things should be taken place before saving the grid.
I will explain you the purpose to which I need.
I have a scenario in which I can type the code of an employee in edititemtemplate textbox, after typing once if i press tab or change the focus of that textbox, I have to retrieve the employee details relative to the code from the database and I should write those details in the same row in columns first name and last name(example say first name and last name of the employee). The first name and last name columns will not have edititemtemplate. All these things should be taken place before saving the grid.
0
Hello Prakash,
For such scenario you could handle the "BatchEdit" events of the grid to retrieve the entered details and fire AJAX request through RadAjaxPanel or RadAjaxManager with those details as parameters. Then, on the server you could retrieve the required information for the passed parameters and set them in hidden field for an example. Afterwards on client-side you could set those values to the corresponding columns within the grid.
Here is how you could fire AJAX request on "OnBatchEditCellValueChanged" client-side event of the grid:
Hope that helps.
Konstantin Dikov
Telerik
For such scenario you could handle the "BatchEdit" events of the grid to retrieve the entered details and fire AJAX request through RadAjaxPanel or RadAjaxManager with those details as parameters. Then, on the server you could retrieve the required information for the passed parameters and set them in hidden field for an example. Afterwards on client-side you could set those values to the corresponding columns within the grid.
Here is how you could fire AJAX request on "OnBatchEditCellValueChanged" client-side event of the grid:
function cell
ValueChanged(sender, args) {
var
ajaxPanel = $find(
"<%=RadAjaxPanel1.ClientID%>"
);
ajaxPanel.ajaxRequest(
"parameters"
);
}
Hope that helps.
Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.