Hi,
I have a RadGrid with the following definition in ascx control:
I have a RadGrid with the following definition in ascx control:
<telerik:RadGrid ID="GridCountryBand" runat="server" AutoGenerateColumns="false" Skin="Simple" CssClass="caronte-phase-grid" AllowPaging="False" AllowSorting="false" AllowFilteringByColumn="true" OnNeedDataSource="GridCountryBand_NeedDataSource" OnBatchEditCommand="GridCountryBand_BatchEditCommand" OnItemDataBound="GridCountryBand_ItemDataBound" > <GroupingSettings CaseSensitive="false" /> <ClientSettings> <Scrolling AllowScroll="true" UseStaticHeaders="true" SaveScrollPosition="true" /> <Selecting AllowRowSelect="true" /> <ClientEvents OnBatchEditOpening="batchEditOpening" /> </ClientSettings> <MasterTableView HeaderStyle-HorizontalAlign="Center" Width="100%" AutoGenerateColumns="false" DataKeyNames="ID_COUNTRY" EditMode="Batch"> <BatchEditingSettings EditType="Cell" OpenEditingEvent="MouseOver" /> <Columns> </Columns> </MasterTableView> </telerik:RadGrid>
Columns are added in Page_Load:
private void AddGridColumns()
{
int idTech = Convert.ToInt32(ddlTechnology.SelectedValue);
ITechnologyBandService service = SharePointServiceLocator.GetCurrent().GetInstance<ITechnologyBandService>();
DataSet data = service.GetBandsByTechnology(idTech);
if (data != null && data.Tables.Count > 0)
{
GridCountryBand.MasterTableView.Columns.Clear();
GridBoundColumn boundColumn = new GridBoundColumn();
GridCountryBand.MasterTableView.Columns.Add(boundColumn);
boundColumn.DataField = "DES_COUNTRY";
boundColumn.HeaderText = "Country";
boundColumn.ShowFilterIcon = false;
boundColumn.FilterControlWidth = Unit.Percentage(100);
boundColumn.AutoPostBackOnFilter = true;
boundColumn.HeaderStyle.Width = Unit.Pixel(150);
boundColumn.ItemStyle.Width = Unit.Pixel(150);
foreach (DataRow row in data.Tables[0].Rows)
{
GridCheckBoxColumn checkboxColumn = new GridCheckBoxColumn();
GridCountryBand.MasterTableView.Columns.Add(checkboxColumn);
checkboxColumn.DataField = row["ID_BAND"].ToString();
checkboxColumn.HeaderText = row["BAND_NAME"].ToString();
checkboxColumn.ShowFilterIcon = false;
checkboxColumn.AutoPostBackOnFilter = true;
checkboxColumn.ItemStyle.HorizontalAlign = HorizontalAlign.Center;
checkboxColumn.HeaderStyle.Width = Unit.Pixel(150);
checkboxColumn.ItemStyle.Width = Unit.Pixel(100);
}
}
I have an ASP.NET DropDownList in the ascx, outside the RadGrid. When page is loaded DropDownList value cannot be changed (if I set onchange JavaScript event it is not fired) until I try to edit cells (checkboxes).
If I remove batch editing mode, values in DropDownList can be changed with no problem.
Thanks and best regards,
Alfonso