
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") %>'> |
function getElements(calendarInstance, args) {
1 var grid = $get('<%= grdElectives.ClientID %>');
2 alert(
'gridElectives found: ' + grid);
3 var dates = calendarInstance.get_selectedDates();
4 var i = 0;
5 for (i = 0; i < dates.length; i++) {
6 alert(dates[i]);
7 }
8 var todaysDate = new Date();
9 var todayTriplet = [todaysDate.getFullYear(), todaysDate.getMonth() + 1, todaysDate.getDate()];
10 var tomorrowTriplet = [todaysDate.getFullYear(), todaysDate.getMonth() + 1, todaysDate.getDate() + 1];
11 var selectedDates = [todayTriplet, tomorrowTriplet];
12 calendarInstance.selectDates(selectedDates,
true);
}
Line 1 gets the grid instance correctly (as line 2 is showing Grid Electives found: OBJECT in the alert box)
But i need to find the listbox control that is within that grid (the name of the listbox is lstDates)
I know that once i have an instance of the listbox i can read/write to it.... which is what i need to do despirately
Cannot for the life of me get this to work.
Any help is appreciated.
I have client grouping on and am not able to group by the gridButtonColumn. Here is the line am am using. I have Groupable set to true. Am I missing something here?
<
telerik:GridButtonColumn Groupable="true" HeaderText="View Letter" DataTextField="LetterID" GroupByExpression="LetterID" UniqueName="vLetter" ButtonType="LinkButton">
</telerik:GridButtonColumn>