Product Bundles
DevCraft
All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
Web
Mobile
Document Management
Desktop
Reporting
Testing & Mocking
CMS
UI/UX Tools
Debugging
Free Tools
Support and Learning
Productivity and Design Tools
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
"server"
AutoGenerateColumns
"false"
OnNeedDataSource
"RadGrid1_NeedDataSource"
onprerender
"RadGrid1_PreRender"
>
MasterTableView
DataKeyNames
",ID"
CommandItemDisplay
"Top"
Name
"parent"
Columns
telerik:GridBoundColumn
DataField
"ID"
HeaderText
UniqueName
</
ClientSettings
Selecting
AllowRowSelect
"true"
/>
protected
void
RadGrid1_PreRender(
object
sender, EventArgs e)
{
if
(!
string
.IsNullOrEmpty(Request.QueryString[
]))
foreach
(GridDataItem item
in
RadGrid1.MasterTableView.Items)
(item.GetDataKeyValue(
).ToString() == Request.QueryString[
].ToString())
item.Selected =
true
;
}
RadGrid1_NeedDataSource(
sender, GridNeedDataSourceEventArgs e)
DateTime dt = DateTime.Now;
dynamic data =
new
[] {
{ ID = 1, Name =
"Name_1"
, customdate=dt,NO = 11.00,CustomerId=
"ALFKI"
,Stock=20,IsSysAdmin =
},
{ ID = 2, Name =
"Name2"
"ALFKI2"
,Stock=30,IsSysAdmin =
false
{ ID = 3, Name =
"Name3"
"ALFKI1"
{ ID = 4, Name =
"Name4"
, customdate=dt,NO = 11.44,CustomerId=
,Stock=40,IsSysAdmin =
{ ID = 55555, Name =
"Name5"
, customdate=dt,NO = 10.4,CustomerId=
};
RadGrid1.DataSource = data;