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.
Build JavaScript UI
Javascript
Telerik
Build modern .NET business apps
.Net Web
Cross-Platform
Desktop
Reporting and Documents
AI for Developers & IT
Ensure AI program success
AI Coding
AI Engineering
Additional Tools
Enhance the developer and designer experience
Testing & Mocking
Debugging
UI/UX Tools
CMS
Free Tools
Support and Learning
Productivity and Design Tools
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
"server"
AutoGenerateColumns
"false"
OnPreRender
"RadGrid1_PreRender"
OnInsertCommand
"RadGrid1_InsertCommand"
DataSourceID
"SqlDataSource1"
>
MasterTableView
TableLayout
"Fixed"
DataKeyNames
"EmployeeID"
CommandItemDisplay
"Top"
Columns
telerik:GridBoundColumn
UniqueName
DataField
HeaderText
/>
"FirstName"
"First Name"
"LastName"
"Last Name"
</
DetailTables
telerik:GridTableView
"TerritoryID"
Name
"Detail"
"SqlDataSource2"
ParentTableRelation
telerik:GridRelationFields
DetailKeyField
MasterKeyField
public
static
string
connection = WebConfigurationManager.ConnectionStrings[
"NorthwindConnectionString"
].ConnectionString;
SqlConnection conn =
new
SqlConnection(connection);
SqlCommand SqlCommand =
SqlCommand();
Int32 EmpId = 0;
protected
void
RadGrid1_PreRender(
object
sender, EventArgs e)
{
foreach
(GridDataItem item
in
RadGrid1.MasterTableView.Items)
if
(Convert.ToInt32(item.GetDataKeyValue(
).ToString()) == EmpId)
item.Expanded =
true
;
}
RadGrid1_InsertCommand(
sender, GridCommandEventArgs e)
GridEditFormInsertItem insertItem = (GridEditFormInsertItem)e.Item;
Int32 Id = Convert.ToInt32((insertItem[
].Controls[0]
as
TextBox).Text);
firstname = (insertItem[
TextBox).Text;
lastname = (insertItem[
SqlCommand(
"Insert into Employees(EmployeeID,FirstName,LastName) values(@EmployeeID,@FirstName,@LastName)"
, conn);
SqlCommand.Parameters.Add(
SqlParameter(
"@EmployeeID"
, Id));
"@FirstName"
, firstname));
"@LastName"
, lastname));
conn.Open();
int
count = SqlCommand.ExecuteNonQuery();
conn.Close();
EmpId = Id;