I am using the client-side API and use AllowMultiRowSelection="True". I need to rebind a second control when a grid row is selected or deselected. My problem is that using the shift key or the checkbox at the top of the grid, many or all rows can be selected at once and each (correctly) fires the RowSelected event, causing many rebinds of the second control.
I only want to fire the rebind once per user action. Any suggestion is appreciated.
<
telerik:GridTemplateColumn HeaderText="Months To Recall" UniqueName="MonthsCol" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID = "MonthsTxt" runat = "server"></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadNumericTextBox ID = "MonthsEditTxt" runat = "server" ClientEvents-OnValueChanged = "MonthsTextChanged">
<NumberFormat DecimalDigits="0"/>
</telerik:RadNumericTextBox>
<%
--<telerik:RadTextBox ID = "MonthsEditTxt" runat = "server"></telerik:RadTextBox>--%>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<telerik:GridTemplateColumn UniqueName="NextRecallCol" HeaderStyle-HorizontalAlign="Center"
HeaderText="Next Recall" ItemStyle-HorizontalAlign="Center">
<ItemTemplate>
<asp:Label ID = "NextRecall" runat = "server" Width = "150px" Text = '<%#DataBinder.Eval(Container.DataItem, "RecallDate")%>'></asp:Label>
<%
-- <telerik:RadTextBox ID = "NextRecallbox" runat = "server" Text = '<%#DataBinder.Eval(Container.DataItem, "RecallDate")%>' Width = "160px"></telerik:RadTextBox>--%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadDatePicker ID="NextRecallEdit" runat="server" Width="140px" AutoPostBack="true" MinDate="2006/1/1"
DateInput-EmptyMessage="NextRecallDate" DbSelectedDate='<%# Bind("RecallDate") %>' Calendar-ClientEvents-OnDateSelected = "RecallDateChange">
</telerik:RadDatePicker>
<%
--<telerik:RadTextBox ID= "NextRecallEditBox" runat="server"></telerik:RadTextBox>--%>
</EditItemTemplate>
</telerik:GridTemplateColumn>
<script type="text/javascript">
function MonthsTextChanged(sender, eventArgs)
{
<%
for(int index = 0; index < MonthLabelClientIDList.Count; index++)
{
string monthLblClientID = MonthLabelClientIDList[index];
string NextRecallClientID = NextRecllClientIDList[index];
%>
var months = $find("<%=monthLblClientID %>");
var nextrecall = $find("<%=NextRecallClientID %>");
var todaysDate = new Date();
var newdate = [months.get_value(),todaysDate.getDate(),todaysDate.getFullYear()];
nextrecall.set_selectedDate(newdate);
<% } %>
}
protected
IList<string> MonthLabelClientIDList
{
get
{
return (IList<string>)ViewState["MonthLabelClientIDList"];
}
set
{
ViewState[
"MonthLabelClientIDList"] = value;
}
}
protected IList<string> NextRecllClientIDList
{
get
{
return (IList<string>)ViewState["NextRecllClientIDList"];
}
set
{
ViewState[
"NextRecllClientIDList"] = value;
}
}
protected
void ItemDataBound(object sender, GridItemEventArgs e)
{
if (MonthLabelClientIDList == null)
{
MonthLabelClientIDList =
new List<string>();
NextRecllClientIDList =
new List<string>();
}
if (e.Item is GridEditableItem && (e.Item as GridEditableItem).IsInEditMode)
{
GridEditableItem editItem = e.Item as GridEditableItem;
RadNumericTextBox monthsToRecall = (RadNumericTextBox)e.Item.FindControl("MonthsEditTxt");
RadDatePicker nextRecall = (RadDatePicker)e.Item.FindControl("NextRecallEdit");
MonthLabelClientIDList.Add(monthsToRecall.ClientID);
NextRecllClientIDList.Add(nextRecall.ClientID);
}
Please guide me..
Has anyone else tried using the RadListBox in Sitefinity yet?
I have a user controls I've created, and switched from the regular listbox to the radlistbox, but for some reason, each item inside a listbox is preceded with a bullet. It doesn't matter what skin I use, and I've even left the skin blank with EnabledEmbeddedSkins set to false, and it still does it.
I've searched through all the CSS files that sitefinity uses, and I don't see any that would be interfereing with the RadListBox.
(Note: If I create the exact same listbox in a standard aspx, I don't have the problem).
If anyone else can give it a shot, I'd appreciate it.
Note: Using Sitefinity 3.6 SP2.
Since I can't attach a screenshot, it looks something like this inside the list box:
Thanks, Kuba
.Grid(Model)code for .columns goes here........
.Name("DetailGrid")
.RowAction(row =>
{
if (row.DataItem.Status == "X")
{
row.HtmlAttributes["style"] = "background:#FFCCCC;";
}
})
.DataBinding(x => x.Ajax().Select("AjaxDetails", "Policy", new { OID = ViewData["OID"] }))
I hope that has all made sense. Any ideas as to why this happens and what can be done to fix this?
Thanks,
Claudz
Some of my controls render incorrectly in IE8 and 9 when Action Recorder is running. For example, my Telerik RadStrip control renders vertically broken instead of horizontally.
Here's a pic of the incorrect rendering:
http://i1089.photobucket.com/albums/i341/adammil2000/incorrect.png
Here's a pic of the correct rendering when I get rid of action recorder:
http://i1089.photobucket.com/albums/i341/adammil2000/correct.pngPlease help, thanks!