or
Protected
Sub
RadGrid1_ItemDataBound(
ByVal
sender
As
System.
Object
,
ByVal
e
As
Telerik.Web.UI.GridItemEventArgs)
Handles
RadGrid1.ItemDataBound
'Change the color of inactive rows
If
TypeOf
e.Item
Is
GridDataItem
Then
Dim
item
As
GridDataItem =
DirectCast
(e.Item, GridDataItem)
Dim
Urgent
As
CheckBox =
DirectCast
(item.FindControl(
"Urgent"
), CheckBox)
If
Urgent.Checked =
True
Then
e.Item.BackColor = Drawing.Color.RoyalBlue
End
If
End
If
End
Sub
<telerik:RadGrid ID=
"RadGrid1"
runat=
"server"
AutoGenerateSelectColumn=
"True"
CellSpacing=
"0"
GridLines=
"Horizontal"
AutoGenerateColumns=
"False"
OnSelectedIndexChanged=
"RadGrid1_SelectedIndexChanged"
OnNeedDataSource=
"RadGrid1_NeedDataSource"
AllowAutomaticUpdates=
"True"
AllowPaging=
"True"
AllowSorting=
"True"
ToolTip=
"Click on a message to view it"
>
<SortingSettings EnableSkinSortStyles=
"false"
/>
<ClientSettings EnablePostBackOnRowClick=
"true"
EnableRowHoverStyle=
"True"
>
<Selecting AllowRowSelect=
"true"
/>
</ClientSettings>
<MasterTableView DataKeyNames=
"UniqueID"
PageSize=
"20"
Width=
"100%"
>
<Columns>
<telerik:GridBoundColumn DataField=
"UniqueID"
HeaderText=
"UniqueID"
UniqueName=
"UniqueID"
FooterStyle-Width=
"1px"
HeaderStyle-Width=
"1px"
ItemStyle-Width=
"1px"
Visible=
"false"
DataType=
"System.Int32"
ReadOnly
=
"True"
SortExpression=
"UniqueID"
>
<FooterStyle Width=
"1px"
></FooterStyle>
<HeaderStyle Width=
"1px"
></HeaderStyle>
<ItemStyle Width=
"1px"
></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"Customer"
HeaderText=
"Customer"
UniqueName=
"Customer"
FooterStyle-Width=
"14%"
HeaderStyle-Width=
"14%"
ItemStyle-Width=
"14%"
FilterControlAltText=
"Filter Customer column"
SortExpression=
"Customer"
>
<FooterStyle Width=
"14%"
></FooterStyle>
<HeaderStyle Width=
"14%"
></HeaderStyle>
<ItemStyle Width=
"14%"
></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"Subject"
HeaderText=
"Subject"
UniqueName=
"Subject"
FooterStyle-Width=
"46%"
HeaderStyle-Width=
"46%"
ItemStyle-Width=
"46%"
SortExpression=
"Subject"
>
<FooterStyle Width=
"46%"
></FooterStyle>
<HeaderStyle Width=
"46%"
></HeaderStyle>
<ItemStyle Width=
"46%"
></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"Name"
HeaderText=
"Taken By"
UniqueName=
"Name"
FooterStyle-Width=
"8%"
HeaderStyle-Width=
"8%"
ItemStyle-Width=
"8%"
DataType=
"System.Int32"
FilterControlAltText=
"Filter TakenByID column"
SortExpression=
"TakenByID"
>
<FooterStyle Width=
"8%"
></FooterStyle>
<HeaderStyle Width=
"8%"
></HeaderStyle>
<ItemStyle Width=
"8%"
></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField=
"TakenOn"
HeaderText=
"TakenOn"
UniqueName=
"TakenOn"
FooterStyle-Width=
"11%"
HeaderStyle-Width=
"11%"
ItemStyle-Width=
"11%"
DataType=
"System.DateTime"
FilterControlAltText=
"Filter TakenOn column"
SortExpression=
"TakenOn"
>
<FooterStyle Width=
"11%"
></FooterStyle>
<HeaderStyle Width=
"11%"
></HeaderStyle>
<ItemStyle Width=
"11%"
></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridCheckBoxColumn DataField=
"Urgent"
DataType=
"System.Boolean"
FilterControlAltText=
"Filter Urgent column"
HeaderText=
"Urgent"
SortExpression=
"Urgent"
UniqueName=
"Urgent"
FooterStyle-Width=
"7%"
HeaderStyle-Width=
"7%"
ItemStyle-Width=
"7%"
>
<FooterStyle Width=
"7%"
></FooterStyle>
<HeaderStyle Width=
"7%"
></HeaderStyle>
<ItemStyle Width=
"7%"
></ItemStyle>
</telerik:GridCheckBoxColumn>
<telerik:GridBoundColumn DataField=
"StatusNew"
HeaderText=
"Status ID"
UniqueName=
"StatusNew"
FooterStyle-Width=
"11%"
HeaderStyle-Width=
"11%"
ItemStyle-Width=
"11%"
SortExpression=
"StatusID"
>
<FooterStyle Width=
"11%"
></FooterStyle>
<HeaderStyle Width=
"11%"
></HeaderStyle>
<ItemStyle Width=
"11%"
></ItemStyle>
</telerik:GridBoundColumn>
<telerik:GridButtonColumn CommandName=
"Delete"
Text=
"Delete"
UniqueName=
"DeleteColumn"
HeaderText=
"Delete"
ButtonType=
"ImageButton"
ImageUrl=
"~/RadControls/Grid/Skins/Default/Delete.gif"
FooterStyle-Width=
"4%"
HeaderStyle-Width=
"4%"
ItemStyle-Width=
"4%"
>
<FooterStyle Width=
"4%"
></FooterStyle>
<HeaderStyle Width=
"4%"
></HeaderStyle>
<ItemStyle Width=
"4%"
></ItemStyle>
</telerik:GridButtonColumn>
</Columns>
<CommandItemSettings ExportToPdfText=
"Export to PDF"
></CommandItemSettings>
<RowIndicatorColumn Visible=
"True"
FilterControlAltText=
"Filter RowIndicator column"
>
<HeaderStyle Width=
"5px"
></HeaderStyle>
</RowIndicatorColumn>
<ExpandCollapseColumn Visible=
"True"
FilterControlAltText=
"Filter ExpandColumn column"
>
<HeaderStyle Width=
"5px"
></HeaderStyle>
</ExpandCollapseColumn>
<EditFormSettings>
<EditColumn FilterControlAltText=
"Filter EditCommandColumn column"
>
</EditColumn>
</EditFormSettings>
</MasterTableView>
<FilterMenu EnableImageSprites=
"False"
>
</FilterMenu>
</telerik:RadGrid>
<%@ Page Title="Home Page" Language="vb" MasterPageFile="~/Site.Master" AutoEventWireup="false"
CodeBehind="Default.aspx.vb" Inherits="TelerikGridControlProject._Default" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<
asp:Content
ID
=
"HeaderContent"
runat
=
"server"
ContentPlaceHolderID
=
"HeadContent"
>
</
asp:Content
>
<
asp:Content
ID
=
"BodyContent"
runat
=
"server"
ContentPlaceHolderID
=
"MainContent"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
<
Scripts
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.Core.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQuery.js"
>
</
asp:ScriptReference
>
<
asp:ScriptReference
Assembly
=
"Telerik.Web.UI"
Name
=
"Telerik.Web.UI.Common.jQueryInclude.js"
>
</
asp:ScriptReference
>
</
Scripts
>
</
telerik:RadScriptManager
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
CellSpacing
=
"0"
GridLines
=
"None"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
Visible
=
"true"
>
<
MasterTableView
EditMode
=
"InPlace"
AutoGenerateColumns
=
"True"
Visible
=
"true"
>
<
Columns
>
<
telerik:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
</
asp:Content
>
Imports Telerik.Web.UI
Public Class _Default
Inherits System.Web.UI.Page
Private _myDataTable As New DataTable
Private _nameColumn As DataColumn
Private _myObjectDataSource As ObjectDataSource
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not IsPostBack Then
BuildDataTable()
FillDataTable()
End If
End Sub
Private Sub FillDataTable()
Dim dataRow As DataRow
For i As Integer = 0 To 1
dataRow = MyDataTable.NewRow()
dataRow("CIFNUMBER") = 1
dataRow("CustomerName") = String.Format("Customer {0}", i)
dataRow("BusinessType") = String.Format("Business {0}", i)
dataRow("Role") = "Role"
dataRow("RelationshipToPrimary") = "Spouse"
dataRow("VotingRights") = i
dataRow("Scored") = i * 100
MyDataTable.Rows.Add(dataRow)
Next
End Sub
Private Sub BuildDataTable()
Dim nameList As List(Of String) = New List(Of String)(New String() {"CIFNUMBER", "CustomerName", "BusinessType", "Role", "RelationshipToPrimary", "VotingRights", "Scored"})
For i As Integer = 0 To nameList.Count - 1
MyDataTable.Columns.Add(i)
MyDataTable.Columns.Add(nameList(i))
Next
End Sub
Public Property MyDataTable As DataTable
Get
Return _myDataTable
End Get
Set(value As DataTable)
_myDataTable = value
End Set
End Property
Protected Sub RadGrid1_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadGrid1.NeedDataSource
RadGrid1.DataSource = MyDataTable
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 GridDataInsertItem AndAlso e.Item.IsInEditMode) Then
'init insert operation triggered
Dim myString As String = "NOTHING"
ElseIf (TypeOf e.Item Is GridEditableItem AndAlso e.Item.IsInEditMode) Then
'edit operation triggered
Dim myString As String = "NOTHING"
End If
End Sub
End Class
<
telerik:RadListBox
ID
=
"rlbItems"
runat
=
"server"
AutoPostBack
=
"true"
Height
=
"200px"
SelectionMode
=
"Multiple"
OnSelectedIndexChanged
=
"items_SelectedIndexChanged"
/>
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
If the string is present, the animation works fine but my page breaks. This application is an old application and difficult to debug why it is breaking. I guess the problem is with some not well written HTML. Is there any way i can get the animation working flawlessly with the above string not present in the page?
<
form
action
=
"formmail.ashx"
method
=
"post"
>
<!-- form contents here -->
</
form
>