Product Bundles
DevCraft
All Telerik .NET and Kendo UI JavaScript components and AI Tools in one package.
Kendo UI
Bundle of AI Tools plus four JavaScript UI libraries built natively for jQuery, Angular, React and Vue.
Telerik
Build great .NET business apps
.Net Web
Cross-Platform
Desktop
Reporting and Documents
Testing & Mocking
Debugging
Build JavaScript UI
Javascript
AI for Developers & IT
Ensure AI program success
AI Coding
Additional Tools
Enhance the developer and designer experience
UI/UX Tools
Free Tools
CMS
Support and Learning
Productivity and Design Tools
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
"server"
OnNeedDataSource
"RadGrid1_NeedDataSource"
AllowSorting
"true"
ShowGroupPanel
"True"
OnGroupsChanging
"RadGrid1_GroupsChanging"
OnItemCommand
"RadGrid1_ItemCommand"
AutoGenerateEditColumn
>
ClientSettings
AllowDragToGroup
</
MasterTableView
GroupsDefaultExpanded
"false"
EditMode
"InPlace"
GroupByExpressions
telerik:GridGroupByExpression
GroupByFields
telerik:GridGroupByField
FieldName
"Group"
/>
SelectFields
public
Hashtable Groups
{
get
if
(ViewState[
"Groups"
] ==
null
)
Hashtable res =
new
Hashtable();
ViewState[
] = res;
return
res;
}
(Hashtable)ViewState[
];
set
] = value;
protected
void
Page_Load(
object
sender, EventArgs e)
RadGrid1.DataBound +=
EventHandler(RadGrid1_DataBound);
RadGrid1_DataBound(
foreach
(GridGroupHeaderItem item
in
RadGrid1.MasterTableView.GetItems(GridItemType.GroupHeader))
(Groups.ContainsKey(item.DataCell.Text))
item.Expanded = (
bool
)Groups[item.DataCell.Text];
RadGrid1_NeedDataSource(
source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
DataTable tbl =
DataTable();
DataColumn col =
DataColumn(
"ID"
);
col.DataType =
typeof
(
int
tbl.Columns.Add(col);
col =
"Name"
string
size = 15;
maxLen = size.ToString().Length;
for
i = 1; i <= size; i++)
tbl.Rows.Add(
[] { i,
+ i.ToString(
"D"
+ maxLen),
+ i % 5 });
RadGrid1.DataSource = tbl;
RadGrid1_GroupsChanging(
source, GridGroupsChangingEventArgs e)
Groups.Clear();
Groups[item.DataCell.Text] = item.Expanded;
RadGrid1_ItemCommand(
source, GridCommandEventArgs e)
(e.CommandName == RadGrid.ExpandCollapseCommandName)
Groups[((GridGroupHeaderItem)e.Item).DataCell.Text] = !e.Item.Expanded;