or
<
telerik:RadGrid
ID
=
"MyGrid"
runat
=
"server"
AllowPaging
=
"false"
AutoGenerateColumns
=
"false"
GridLines
=
"None"
ShowHeader
=
"True"
OnNeedDataSource
=
"MyGrid_NeedDataSource"
OnItemCommand
=
"MyGrid_ItemCommand"
OnItemDataBound
=
"MyGrid_ItemDataBound"
>
<
MasterTableView
AutoGenerateColumns
=
"false"
Width
=
"100%"
TableLayout
=
"Fixed"
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"Id"
DataField
=
"PlanId"
HeaderText
=
"Id"
Visible
=
"false"
/>
<
telerik:GridBoundColumn
UniqueName
=
"Name"
DataField
=
"Name"
HeaderText
=
"Name"
/>
<
telerik:GridTemplateColumn
>
<
ItemTemplate
>
<
table
cellpadding
=
"0"
cellspacing
=
"0"
border
=
"0"
>
<
tr
>
<
td
style
=
"border: none; width: 18px; padding: 0;"
>
<
asp:ImageButton
ID
=
"DeleteImageButton"
runat
=
"server"
ToolTip
=
"Delete"
ImageUrl
=
"App_Themes/PlanAdvisor/Grid/Delete.png"
CommandName
=
"DeleteItem"
/>
</
td
>
</
tr
>
</
table
>
</
ItemTemplate
>
<
HeaderStyle
HorizontalAlign
=
"Right"
Width
=
"55px"
></
HeaderStyle
>
<
ItemStyle
HorizontalAlign
=
"Right"
></
ItemStyle
>
</
telerik:GridTemplateColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Protected
Sub
MyGrid_ItemCommand(
ByVal
sender
As
Object
,
ByVal
e
As
GridCommandEventArgs)
Handles
MyGrid.ItemCommand
If
e.Item.ItemType = GridItemType.Item
OrElse
e.Item.ItemType = GridItemType.AlternatingItem
Then
Dim
item
As
GridDataItem =
CType
(e.Item, GridDataItem)
If
e.CommandName =
"DeleteItem"
Then
DeleteItem(
CInt
(item(
"Id"
).Text))
MyGrid.Rebind()
End
If
End
If
End
Sub
<
span
style
=
"color: #ff0000;"
>Test</
span
> Some content "really long text here; some more stuff here
protected void ExportToPdf_Click(object sender, EventArgs e)
{
RadGrid1.ExportSettings.ExportOnlyData = true;
RadGrid1.ExportSettings.IgnorePaging = true;
RadGrid1.ExportSettings.OpenInNewWindow = true;
RadGrid1.ExportSettings.FileName = "FileName";
RadGrid1.MasterTableView.ExportToPdf();
}
// Asset of a person
public
class
PersonAsset {
public
Guid PersonID {
get
;}
//DataKey; second GroupBy will be by PersonID
public
string
Asset {
get
;
set
;}
public
Guid AssetID {
get
;
set
}
//not a DataKey for the Grid, correlates to a comboxbox that makes the asset changeable
public
string
PersonName {
get
;
set
;}
public
string
Note1 {
get
;
set
;}
public
string
Note2 {
get
;
set
;}
public
string
Note3 {
get
;
set
;}
public
PersonAssetState State {
get
;
set
;}
}
//going to perform first GroupBy using this enum
public
enum
PersonAssetState {
NotSet,
Type1,
Type2
}
<
telerik:RadGrid
runat
=
"server"
ID
=
"rGridInventory"
ShowHeader
=
"true"
Width
=
"99%"
OnNeedDataSource
=
"rGridInventory_NeedDataSource"
>
<
MasterTableView
DataKeyNames
=
"PersonID"
ClientDataKeyNames
=
"PersonID"
ShowGroupFooter
=
"true"
GroupLoadMode
=
"Client"
>
<
GroupFooterTemplate
>
</
GroupFooterTemplate
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"State"
SortOrder
=
"Descending"
/>
<
telerik:GridGroupByField
FieldName
=
"PersonID"
/>
</
GroupByFields
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldName
=
"State"
/>
<
telerik:GridGroupByField
FieldName
=
"PersonID"
/>
</
SelectFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
</
MasterTableView
>
</
telerik:RadGrid
>