Hello,
I have the following RadGrid with a RadEditor embedded in it. Everything works as expected, except when I change the color of the text in a RadEditor row, I am not able to add another row. I don' receive any errors and I am able to step through the btnAddInstruction_Click and grdInstructions_ItemDataBound events without any issues. It just will not render another row.

btnAddInstruction_Click Code:
public static void AddInstructionGridRow(RadGrid gridName)
{
bool instructionIsNull = false;
ProjectInstruction projectInstruction;
List<ProjectInstruction> projectInstructions = new List<ProjectInstruction>();
RadEditor txtInstruction;
// Iterate through the grid rows and retain all previously entered data.
foreach (GridDataItem gridRow in gridName.Items)
{
// Create new Project Instruction object.
projectInstruction = new ProjectInstruction();
// Project ID (Hidden)
HiddenField hdnProjectID = gridRow.FindControl("hdnProjectID") as HiddenField;
if (hdnProjectID != null)
{
projectInstruction.ProjectID = Convert.ToInt32(hdnProjectID.Value);
}
else
{
projectInstruction.ProjectID = 0;
}
// Project Instruction ID (Hidden)
HiddenField hdnProjectInstructionID = gridRow.FindControl("hdnProjectInstructionID") as HiddenField;
if (hdnProjectInstructionID != null)
{
projectInstruction.ID = Convert.ToInt32(hdnProjectInstructionID.Value);
}
else
{
projectInstruction.ID = 0;
}
// Project Instruction
txtInstruction = gridRow.FindControl("txtInstruction") as RadEditor;
if (txtInstruction.Content.Trim().Length == 0)
{
instructionIsNull = true;
}
projectInstruction.Instruction = txtInstruction.Content;
// Add Project Instruction to Project Instructions object.
projectInstructions.Add(projectInstruction);
}
// Create new Project Instruction object.
if (!instructionIsNull)
{
projectInstructions.Add(AddProjectInstruction());
}
// Update Project Instructions grid.
gridName.DataSource = projectInstructions;
gridName.Rebind();
}
grdInstructions_ItemDataBound
protected void grdInstructions_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
{
// Current row object.
ProjectInstruction projectInstruction = (ProjectInstruction)e.Item.DataItem;
string referenceNumber = string.Empty;
// Row Number
GridDataItem dataItem = (GridDataItem)e.Item;
referenceNumber = Convert.ToString(e.Item.ItemIndex + 1);
dataItem["ReferenceNumber"].Text = referenceNumber;
// Project Instruction
RadEditor txtInstruction = e.Item.FindControl("txtInstruction") as RadEditor;
txtInstruction.Content = projectInstruction.Instruction;
//txtInstruction.Languages.Add(new SpellCheckerLanguage("en-US", "English"));
// Delete Column
GridDataItem item = e.Item as GridDataItem;
// Display Delete option when adding new record and if there is more then one row.
if (grdInstructions.MasterTableView.Items.Count > 0)
{
// Show Delete column during Add.
item["btnDeleteInstructionRow"].Controls[0].Visible = true;
item["btnDeleteInstructionRow"].Attributes["onclick"] = "return confirm('Delete Instruction# " + referenceNumber + "?')";
}
else
{
// Hide Delete option if there is only one row.
item["btnDeleteInstructionRow"].Controls[0].Visible = false;
}
}
}
Can you please tell me what is causing another row not to be rendered when HTML color formatting is applied to the text in a RadEditor row?
Thank Very Much in Advance!
I have the following RadGrid with a RadEditor embedded in it. Everything works as expected, except when I change the color of the text in a RadEditor row, I am not able to add another row. I don' receive any errors and I am able to step through the btnAddInstruction_Click and grdInstructions_ItemDataBound events without any issues. It just will not render another row.
btnAddInstruction_Click Code:
public static void AddInstructionGridRow(RadGrid gridName)
{
bool instructionIsNull = false;
ProjectInstruction projectInstruction;
List<ProjectInstruction> projectInstructions = new List<ProjectInstruction>();
RadEditor txtInstruction;
// Iterate through the grid rows and retain all previously entered data.
foreach (GridDataItem gridRow in gridName.Items)
{
// Create new Project Instruction object.
projectInstruction = new ProjectInstruction();
// Project ID (Hidden)
HiddenField hdnProjectID = gridRow.FindControl("hdnProjectID") as HiddenField;
if (hdnProjectID != null)
{
projectInstruction.ProjectID = Convert.ToInt32(hdnProjectID.Value);
}
else
{
projectInstruction.ProjectID = 0;
}
// Project Instruction ID (Hidden)
HiddenField hdnProjectInstructionID = gridRow.FindControl("hdnProjectInstructionID") as HiddenField;
if (hdnProjectInstructionID != null)
{
projectInstruction.ID = Convert.ToInt32(hdnProjectInstructionID.Value);
}
else
{
projectInstruction.ID = 0;
}
// Project Instruction
txtInstruction = gridRow.FindControl("txtInstruction") as RadEditor;
if (txtInstruction.Content.Trim().Length == 0)
{
instructionIsNull = true;
}
projectInstruction.Instruction = txtInstruction.Content;
// Add Project Instruction to Project Instructions object.
projectInstructions.Add(projectInstruction);
}
// Create new Project Instruction object.
if (!instructionIsNull)
{
projectInstructions.Add(AddProjectInstruction());
}
// Update Project Instructions grid.
gridName.DataSource = projectInstructions;
gridName.Rebind();
}
grdInstructions_ItemDataBound
protected void grdInstructions_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item.ItemType == GridItemType.Item || e.Item.ItemType == GridItemType.AlternatingItem)
{
// Current row object.
ProjectInstruction projectInstruction = (ProjectInstruction)e.Item.DataItem;
string referenceNumber = string.Empty;
// Row Number
GridDataItem dataItem = (GridDataItem)e.Item;
referenceNumber = Convert.ToString(e.Item.ItemIndex + 1);
dataItem["ReferenceNumber"].Text = referenceNumber;
// Project Instruction
RadEditor txtInstruction = e.Item.FindControl("txtInstruction") as RadEditor;
txtInstruction.Content = projectInstruction.Instruction;
//txtInstruction.Languages.Add(new SpellCheckerLanguage("en-US", "English"));
// Delete Column
GridDataItem item = e.Item as GridDataItem;
// Display Delete option when adding new record and if there is more then one row.
if (grdInstructions.MasterTableView.Items.Count > 0)
{
// Show Delete column during Add.
item["btnDeleteInstructionRow"].Controls[0].Visible = true;
item["btnDeleteInstructionRow"].Attributes["onclick"] = "return confirm('Delete Instruction# " + referenceNumber + "?')";
}
else
{
// Hide Delete option if there is only one row.
item["btnDeleteInstructionRow"].Controls[0].Visible = false;
}
}
}
Can you please tell me what is causing another row not to be rendered when HTML color formatting is applied to the text in a RadEditor row?
Thank Very Much in Advance!