<
head
runat
=
"server"
>
<
title
>Untitled</
title
>
<
link
rel
=
"stylesheet"
type
=
"text/css"
href
=
"styles.css"
/>
</
head
>
<
body
>
<
form
id
=
"mainForm"
runat
=
"server"
>
<
telerik:RadScriptManager
runat
=
server
ID
=
"ScriptManager"
></
telerik:RadScriptManager
>
<
div
>
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
runat
=
"server"
SelectedIndex
=
"0"
Skin
=
"Vista"
ScrollChildren
=
"true"
ScrollButtonsPosition
=
"Middle"
Orientation
=
"HorizontalTop"
>
<
TabTemplate
>
<
div
class
=
"textWrapper"
>
<%# DataBinder.Eval(Container, "Text") %>
</
div
>
<
span
class
=
"ie6shim"
></
span
>
<
img
src
=
"Images/Close.gif"
alt
=
"Close"
onclick
=
"deleteTab('<%# DataBinder.Eval(Container, "
Text") %>')" />
<
TabTemplate
>
<
Tabs
>
<
telerik:RadTab
runat
=
"server"
Selected
=
"True"
Text
=
"Tab1"
></
telerik:RadTab
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Tab2"
></
telerik:RadTab
>
<
telerik:RadTab
runat
=
"server"
Text
=
"Tab3"
></
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
</
div
>
</
form
>
</
body
>
This is the styles.css file:
.tabStrip
{
position:absolute;
top:0;
}
.rtsIn img
{
vertical-align:middle;
width: 14px;
height: 14px;
margin-left: 10px;
}
.rtsIn .textWrapper
{
display: inline;
}
/* IE6 fixes for line-height bug */
* html .rtsIn img
{
margin-bottom: 10px;
}
* html .rtsIn .textWrapper
{
float: left;
height:26px;
}
* html .rtsIn .ie6shim
{
height: 26px;
display: inline-block;
}
<
asp:Repeater
ID
=
"rptMarkets"
runat
=
"server"
DataSourceID
=
"objMarkets"
>
<
ItemTemplate
>
<
b
>
<%#DataBinder.Eval(Container.DataItem, "Market")%></
b
>
<!-- Nested Repeater Level 2 - START -->
<
asp:HiddenField
ID
=
"HiddenField1"
runat
=
"server"
Value='<%# Eval("MarketID") %>' />
<
asp:ObjectDataSource
ID
=
"objProducts"
runat
=
"server"
SelectMethod
=
"GetProductsByMarketsID"
TypeName
=
"Ceradyne.clsLibrary"
>
<
SelectParameters
>
<
asp:ControlParameter
Name
=
"MarketID"
Type
=
"Int32"
ControlID
=
"HiddenField1"
PropertyName
=
"Value"
/>
</
SelectParameters
>
</
asp:ObjectDataSource
>
<
ul
>
<
asp:CheckBoxList
ID
=
"clProductName"
runat
=
"server"
DataSourceID
=
"objProducts"
DataTextField
=
"ProductName"
DataValueField
=
"ProductID"
RepeatColumns
=
"3"
Font-Size
=
"8px"
>
</
asp:CheckBoxList
>
</
ul
>
<!-- Nested Repeater Level 2 - END -->
</
ItemTemplate
>
<
SeparatorTemplate
>
<
hr
/>
</
SeparatorTemplate
>
</
asp:Repeater
>
Protected Sub RadGrid1_InsertCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand
'save the file to the website
Dim txtPDFFile As String = ""
Dim Upload As RadUpload = TryCast(e.Item.FindControl("upBrochurePDF"), RadUpload)
Dim BrochureFolder As String = Server.MapPath("~/uploads/brochures/")
If Upload.UploadedFiles.Count > 0 Then
For Each file As UploadedFile In Upload.UploadedFiles
txtPDFFile = file.GetName()
file.SaveAs(BrochureFolder & txtPDFFile, True)
Next
End If
'check to see if this file name exists already
'(not written yet)
' save the file name to the database
objBrochure.AddBrochure(txtPDFFile)
'look up the brochure id based on the filename
objBrochure.GetBrochuresByFilename(txtPDFFile)
Dim BrochureID As Integer = objBrochure.BrochureID
'save the value of the check boxes
Dim ProductID As Integer
Dim i As Integer
Dim List As CheckBoxList = DirectCast(e.Item.FindControl("clProductName"), CheckBoxList)
For i = 0 To List.Items.Count - 1
If List.Items(i).Selected = "true" Then
ProductID = List.Items(i).Value
'add brochure links to products
objBrochure.AddBrochureProductLink(BrochureID, ProductID)
End If
Next
Response.Redirect("/admin/Library/ManageBrochures.aspx")
End Sub
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"] }))