| function ShowOneTabOrAll(sender, args) { |
| var multiPage = $find("<%=RadMultiPage1.ClientID %>"); |
| var i; |
| if (args.get_tab().get_text() == "All") { |
| for (i = 0; i < multiPage.get_pageViews().get_count(); i++) { |
| multiPage.get_pageViews().getPageView(i).show(); |
| } |
| } else { |
| for (i = 0; i < multiPage.get_pageViews().get_count(); i++) { |
| multiPage.get_pageViews().getPageView(i).hide(); |
| } |
| var tabIndex = args.get_tab().get_index(); |
| multiPage.get_pageViews().getPageView(tabIndex).show(); |
| } |
| } |
Hi
I have a grid with a GridDropDownColomn and i tried to add a requiredFieldValidator to it, but it seems that i"m missing something.... First i use RadGrid1_ItemDataBound to add a "Please select item" in my RadComboBox, after that in the RadGrid1_ItemCreated, i'm looking for my radcombo and i associate the RequiredFieldValidator to it but it does'nt works. I assume that the requiredFieldValidator check for the selected text and not the value , so how i can make it works ? There is my code snippet :
Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound
If
TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode Then
Dim Combo As RadComboBox = TryCast(e.Item.FindControl("RCB_ResponsibleID"), RadComboBox)
Combo.Items.Insert(0,
New RadComboBoxItem(Resources.Resources.GRID_SELECT_RESPONSIBLE, Nothing)
End If
End Sub
Private Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
If TypeOf e.Item Is GridEditableItem And e.Item.IsInEditMode Then
Dim Combo As RadComboBox = TryCast(Item("ResponsibleID").FindControl("RCB_ResponsibleID"), RadComboBox)
Dim ResponsibleValidator As New RequiredFieldValidator
ResponsibleValidator.ControlToValidate = Combo.ID
ResponsibleValidator.InitialValue =
Nothing
ResponsibleValidator.SetFocusOnError = True
ResponsibleValidator.ErrorMessage = Resources.Resources.GRID_MUST_SELECT_RESPONSIBLE
Cell = Combo.Parent
Cell.Controls.Add(ResponsibleValidator)
End If
End Sub
Thanks in advance for your helps !
CREATE TABLE [Rooms]Then, I created a SQLdatasource to access the Appointments table. The connexion is succeful.
(
[ID] INT IDENTITY(1,1) NOT NULL,
[RoomName] nvarchar(255) NOT NULL,
CONSTRAINT [PK_Rooms] PRIMARY KEY CLUSTERED
([ID])
)
GO
CREATE TABLE [Users]
(
[ID] INT NOT NULL,
[UserName] nvarchar(255) NOT NULL,
CONSTRAINT [PK_Users] PRIMARY KEY CLUSTERED
([ID])
)
GO
CREATE TABLE [dbo].[Appointments]
(
[ID] INT IDENTITY(1,1) NOT NULL,
[Subject] nvarchar(255) NOT NULL,
[Start] datetime NOT NULL,
[End] datetime NOT NULL,
[RoomID] INT NULL,
[UserID] INT NULL,
[RecurrenceRule] nvarchar(1024) NULL,
[RecurrenceParentID] INT NULL,
[Annotations] nvarchar(50) NULL,
CONSTRAINT [PK_Appointments] PRIMARY KEY CLUSTERED
([ID]),
CONSTRAINT [FK_Appointments_ParentAppointments] FOREIGN KEY
([RecurrenceParentID])
REFERENCES
[Appointments] ([ID]),
CONSTRAINT [FK_Appointments_Rooms] FOREIGN KEY
([RoomID])
REFERENCES
[Rooms] ([ID]),
CONSTRAINT [FK_Appointments_Users] FOREIGN KEY
([UserID])
REFERENCES
[Users] ([ID])
)
Select the RadScheduler in the designer, and click the ellipsis button on the ResourceTypes property in the property pane.Problem is: I can't add any events in the scheduler. When I double click on the scheduler, I see the box to create a new event, but when i click on the icon to create the event, it just disappear...
In the Resource Type Collection Editor, add a new resource type and configure it to bind to the second SQLDataSource: