Hi,
Thank you very much for your reply.
But in the example
http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-66566/main.htmWhen I select some item in the combo box it is showing the message that selected index fired. But I need to see the item what ever I have selected. Now it is showing always 'none' first item after each load. So please suggest me how to retain the selected value after page resfresh.
>Hi Sowmya,
Thank you for choosing Syncfusion products.
Please refer the below update to your queries:
1. Sample:
Below is the sample link which contains the modified code according to the 5.1 version.
http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-66566/main.htmThere is no need to use the code,
GridGroupingControl3.DataBind();
Once on defining the DataSource property, the Grid gets binded to the corresponding DataSource.
2. I have tried using the CurrentRecordContextChange event but the action EndEditCalled is never fired:
Please refer the below sample link in which the 'EndEditCalled' fired on the CurrentRecordContextChange event.
http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-64541-1/main.htmIn the sample the once the 'EndEditCalled' action is completed the Server side event GridGroupingControl1_CurrentRecordContextChange will help you to get the details of the Edited record as well as AddNew records.
3. Adding dropdownlistbox dynamically into the second column of the grid:
Could you please let us is your requirement is to add dropdownlistbox at the time of editing?
If your requirement is to add the template during the time of editing the below information will help you,
i. You can change the celltype of the column to 'ComboBox' if you want the dropdown to be displayed while editing.
Below is the sample link which will shown the dropdownlist on the column while editing.
http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Incident-35505/main.htmThe records enters into editable mode on double clicking it. The 'CellType' of the 'City' field is set to 'ComboBox'. The 'ComboBox' is binded to the DataSource.
ii. You can also use templates at the runtime and design to add dropdownlistbox.
4. Firing the ItemSelectionChanged event for the dropdownlistbox:
The below code which is placed in the 'QueryCellStyleInfo' will help you to fire the 'SelectedIndexChanged' event.
if (e.TableCellIdentity.Column.Name == "Column2")
{
//Changes the EditItem template of the column specified as DropDownListBox
DropDownList dropdown = new DropDownList();
dropdown.Items.Add("None");
dropdown.Items.Add("Row0");
dropdown.Items.Add("Row1");
dropdown.Items.Add("Row2");
dropdown.Items.Add("Row3");
dropdown.Items.Add("Row4");
dropdown.AutoPostBack = true;
dropdown.SelectedIndexChanged += new EventHandler(dropdown_SelectedIndexChanged);
//Here we adding the DropDownListBox programatically using ITemplate Interface
TemplateClass mytemp = new TemplateClass(dropdown);
e.TableCellIdentity.Column.EditItemTemplate = mytemp;
}
5. Save changes to the DataTable.
You can use 'CurrentRecordContextChange' event to save the changes to the datatable.
6. How do I find out the value that is entered in a particular column of the grid?
To find out the updated values[edited values], you can use the 'CurrentRecordContextChange' event.
The below sample helps you to achieve the same.
http://websamples.syncfusion.com/samples/Grid.Web/5.1.0.51/Forum-64541-1/main.htmPlease let us know if you have any other queries.
Regards,
Valli