

In my scenario, I've a remove btn which on clicking should remove the rows.(I cannot rebind the grid). I manually have to
clear the controls.
So, I do the foll:
foreach(GridDataItem obItem in Radgrid1.SelectedItems)
{
obItem.Controls.Clear();
}
But the problem with this approach is , though it clears the rows . the grid has an empty row. I don't need the row at all.
When user selects a row and clicks remove btn, he should not see the contents as well as grid lines. pls help me with code.
Note: pls I cannot rebind. so , give me a diff approach.
<GroupByExpressions>
<telerik:GridGroupByExpression>
<SelectFields>
<telerik:GridGroupByField FieldAlias="searchfield" FieldName="searchfield" HeaderText="Search Field"></telerik:GridGroupByField>
</SelectFields>
<GroupByFields>
<telerik:GridGroupByField FieldName="searchfield"></telerik:GridGroupByField>
</GroupByFields>
</telerik:GridGroupByExpression>
</GroupByExpressions>
<RowIndicatorColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn>
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
<Columns>
.
</
Columns>
</MasterTableView>
</telerik:RadGrid>
Code behind:
protected
void RadGrid1_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
if (item["uemail"].Text.ToLower().Contains(TextBox1.Text.ToLower()))
{
string text = item["uemail"].Text;
string substring = "<b>" + text.Substring(text.IndexOf(TextBox1.Text, System.StringComparison.CurrentCultureIgnoreCase), TextBox1.Text.Length) + "</b>";
item[
"uemail"].Text = Regex.Replace(text, TextBox1.Text, substring, RegexOptions.IgnoreCase);
}
}
}
I'm using 2009 Q2 SP1 and have a RadEditor in a FormView, bound to a datasource using declarative databinding:
| <telerik:RadEditor ID="RadEditor1" runat="server" |
| Content='<%# Bind("Content") %>'> |