or
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
loadGrid();
}
}
protected
void
loadGrid()
{
DATABASE dbcontext =
new
DATABASE();
IEnumerable<LineItem> newlineitem = from p
in
dbcontext.LineItems
select p;
gridDataSource = newlineitem;
RadGrid1.Rebind();
}
public
IEnumerable<LineItem> gridDataSource
{
set
{
Session[
"gridDataSource"
] = value;
}
get
{
if
(Session[
"gridDataSource"
] ==
null
)
return
null
;
else
{
return
((IEnumerable<LineItem>)Session[
"gridDataSource"
]);
}
}
}
protected
void
RadGrid1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
RadGrid1.DataSource = gridDataSource;
}
<
telerik:RadGrid
ID
=
"dltBroadcast"
EnableViewState
=
"false"
runat
=
"server"
AllowPaging
=
"true"
AllowSorting
=
"True"
PageSize
=
"100"
AllowMultiRowSelection
=
"True"
ClientSettings-EnableRowHoverStyle
=
"True"
Width
=
"956px"
CellPadding
=
"0"
CellSpacing
=
"0"
Skin
=
"RadGridCustomBlack"
EnableEmbeddedSkins
=
"False"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
Position
=
"TopAndBottom"
HorizontalAlign
=
"Justify"
AlwaysVisible
=
"True"
/>
<
MasterTableView
ClientDataKeyNames
=
"ElementId,SentimentDesc,CrawledDateTime"
AllowMultiColumnSorting
=
"true"
TableLayout
=
"Fixed"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ElementId"
HeaderText
=
"ElementId"
ReadOnly
=
"True"
UniqueName
=
"colElementId"
Visible
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridClientSelectColumn
UniqueName
=
"SelectColumn"
DataTextField
=
"ElementId"
Resizable
=
"false"
>
<
HeaderStyle
Width
=
"30px"
/>
</
telerik:GridClientSelectColumn
>
<
telerik:GridTemplateColumn
ItemStyle-HorizontalAlign
=
"Left"
ItemStyle-Width
=
"25px"
HeaderStyle-Width
=
"25px"
UniqueName
=
"colSentiment"
Visible
=
"True"
ItemStyle-BorderStyle
=
"None"
Resizable
=
"false"
>
<
ItemTemplate
>
<
div
>
<
a
id
=
"linkSentimentPositive"
runat
=
"server"
>
<
img
id
=
"ImageSentimentPositive"
runat
=
"server"
width
=
"15"
height
=
"14"
border
=
"0"
alt
=
""
src
=
"Images/positiveNormal.png"
class
=
"dtgridSentimentImages"
/></
a
>
<
br
/>
<
a
id
=
"linkSentimentNeutral"
runat
=
"server"
>
<
img
id
=
"ImageSentimentNeutral"
runat
=
"server"
width
=
"15"
height
=
"14"
border
=
"0"
alt
=
""
src
=
"Images/neutralNormal.png"
class
=
"dtgridSentimentImages"
/></
a
>
<
br
/>
<
a
id
=
"linkSentimentNegative"
target
=
"_self"
runat
=
"server"
>
<
img
id
=
"ImageSentimentNegative"
runat
=
"server"
width
=
"15"
height
=
"14"
border
=
"0"
alt
=
""
src
=
"Images/negativeNormal.png"
class
=
"dtgridSentimentImages"
/></
a
>
<
br
/>
<
a
id
=
"linkSentimentUnassigned"
runat
=
"server"
>
<
img
id
=
"ImageSentimentUnassigned"
runat
=
"server"
width
=
"15"
height
=
"14"
border
=
"0"
alt
=
""
src
=
"Images/unassignedNormal.png"
/></
a
>
</
div
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridHyperLinkColumn
DataTextField
=
"Title"
UniqueName
=
"colTitle"
HeaderText
=
"Title"
ItemStyle-Font-Underline
=
"true"
ItemStyle-Width
=
"180px"
HeaderStyle-Width
=
"180px"
ItemStyle-Wrap
=
"true"
SortExpression
=
"Title"
>
<
HeaderStyle
Font-Bold
=
"True"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
Wrap
=
"False"
/>
<
ItemStyle
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
BorderStyle
=
"None"
Wrap
=
"True"
/>
</
telerik:GridHyperLinkColumn
>
<
telerik:GridBoundColumn
DataField
=
"Snippet"
HeaderText
=
"Snippet"
ItemStyle-Width
=
"200px"
HeaderStyle-Width
=
"200px"
ReadOnly
=
"false"
UniqueName
=
"colSnippet"
>
<
HeaderStyle
Font-Bold
=
"True"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
Wrap
=
"False"
/>
<
ItemStyle
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Left"
BorderStyle
=
"None"
Wrap
=
"True"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Tags"
HeaderText
=
"Keywords"
ReadOnly
=
"True"
UniqueName
=
"colkeywords"
ItemStyle-Width
=
"70px"
>
<
HeaderStyle
Font-Bold
=
"True"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
Wrap
=
"False"
/>
<
ItemStyle
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
BorderStyle
=
"None"
Wrap
=
"True"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"HostNameToShow"
HeaderText
=
"Source"
ReadOnly
=
"True"
UniqueName
=
"colHostName"
ItemStyle-Width
=
"80px"
>
<
HeaderStyle
Font-Bold
=
"True"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
Wrap
=
"False"
/>
<
ItemStyle
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
BorderStyle
=
"None"
Wrap
=
"True"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"CrawledDateTime"
HeaderText
=
"Date"
DataType
=
"System.DateTime"
ItemStyle-Width
=
"70px"
HeaderStyle-Width
=
"70px"
DataFormatString
=
"{0:dd/MM/yyyy HH:mm}"
ReadOnly
=
"True"
UniqueName
=
"colCrawledDateTime"
>
<
HeaderStyle
Font-Bold
=
"True"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
Wrap
=
"False"
/>
<
ItemStyle
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
BorderStyle
=
"None"
Wrap
=
"True"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"TagName"
HeaderText
=
"User Tags"
ReadOnly
=
"True"
UniqueName
=
"colTags"
>
<
HeaderStyle
Font-Bold
=
"True"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
Wrap
=
"False"
/>
<
ItemStyle
Font-Bold
=
"False"
Font-Italic
=
"False"
Font-Overline
=
"False"
Font-Strikeout
=
"False"
Font-Underline
=
"False"
HorizontalAlign
=
"Center"
BorderStyle
=
"None"
Wrap
=
"True"
/>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"colButtons"
Visible
=
"True"
ItemStyle-Width
=
"55px"
HeaderStyle-Width
=
"55px"
ItemStyle-BorderStyle
=
"None"
Resizable
=
"false"
>
<
ItemTemplate
>
<
div
style
=
"position: relative;"
>
<
a
id
=
"linkTag"
runat
=
"server"
>
<
img
id
=
"ImageTag"
runat
=
"server"
width
=
"13"
height
=
"13"
border
=
"0"
title
=
"Tag"
alt
=
"Tag"
src
=
"Images/tag.gif"
class
=
"dtgridButtonsLeft"
/></
a
> <
a
id
=
"linkdelete"
runat
=
"server"
>
<
img
id
=
"Imgdelete"
runat
=
"server"
width
=
"13"
height
=
"13"
border
=
"0"
title
=
"Delete"
alt
=
"Delete"
src
=
"Images/delete.gif"
class
=
"dtgridButtonsRight"
/></
a
><
br
/>
<
a
id
=
"linkSendEmail"
runat
=
"server"
>
<
img
id
=
"ImgSendEmail"
runat
=
"server"
width
=
"13"
height
=
"13"
border
=
"0"
title
=
"Email"
alt
=
"Email"
src
=
"Images/email.gif"
class
=
"dtgridButtonsLeft"
/></
a
> <
a
id
=
"LinkHighlited"
runat
=
"server"
>
<
img
id
=
"ImgHighlited"
runat
=
"server"
width
=
"12"
height
=
"12"
border
=
"0"
title
=
"Highlight"
alt
=
"Highlight"
src
=
"Images/highlighted.png"
class
=
"dtgridButtonsRight"
/></
a
><
br
/>
<
a
id
=
"linkEnagagedCommunity"
runat
=
"server"
style="width: 13px; height: 13px; position: absolute;
bottom: -18px; left: 0;">
<
img
id
=
"ImgEnagagedCommunity"
runat
=
"server"
width
=
"13"
height
=
"13"
border
=
"0"
title
=
"Whois?"
alt
=
"Whois?"
src
=
"Images/editUserInfo.gif"
/></
a
><
a
id
=
"LinkUrlAspect"
runat
=
"server"
style
=
"text-align: right; position: absolute; bottom: -16px; right: 0;"
>
<
img
id
=
"ImgUrlAspect"
runat
=
"server"
width
=
"10"
height
=
"10"
border
=
"0"
title
=
"Add to Community..."
alt
=
"Add to Community..."
src
=
"Images/addToCummunity.png"
style
=
"margin-right: 5px;"
/>
</
a
>
</
div
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnCommand
=
"dltBroadcast_Command"
OnRowDataBound
=
"dltBroadcast_RowDataBound"
OnColumnClick
=
"dltBroadcast_ColumnClick"
/>
<
Selecting
AllowRowSelect
=
"true"
/>
<
Resizing
AllowColumnResize
=
"True"
AllowRowResize
=
"false"
ResizeGridOnColumnResize
=
"false"
ClipCellContentOnResize
=
"true"
EnableRealTimeResize
=
"true"
AllowResizeToFit
=
"true"
/>
<
Scrolling
AllowScroll
=
"false"
UseStaticHeaders
=
"false"
></
Scrolling
>
</
ClientSettings
>
</
telerik:RadGrid
>
// shows the notificationForm on the new incident page.
function
showNotification() {
var
oWnd = radopen(
"Notify.aspx"
,
"Notifications"
,
"740"
,
"200"
);
}
<
telerik:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
>
<
Windows
>
<
telerik:RadWindow
ID
=
"Notifications"
runat
=
"server"
Title
=
"Notifications"
Modal
=
"true"
ShowContentDuringLoad
=
"false"
ReloadOnShow
=
"True"
ViewStateMode
=
"Enabled"
VisibleStatusbar
=
"false"
Behavior
=
"None"
Behaviors
=
"None"
VisibleTitlebar
=
"false"
>
</
telerik:RadWindow
>
</
Windows
>
</
telerik:RadWindowManager
>
protected
void
btnSave_Click(
object
sender, EventArgs e)
{
if
(HasNotifications)
{
// Do something
}
else
{
Page.ClientScript.RegisterStartupScript(
this
.GetType(),
"OpenWindow"
,
"showNotification();"
,
true
);
}
}