All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:
do you have any ideas? below is my code. Thanks!
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
"server"
AutoGenerateColumns
"False"
OnItemDataBound
"RadGrid1_ItemDataBound"
OnNeedDataSource
"RadGrid1_NeedDataSource"
>
MasterTableView
CommandItemDisplay
"Top"
DataKeyNames
"ID"
EditMode
"InPlace"
Columns
telerik:GridBoundColumn
DataField
UniqueName
HeaderText
</
telerik:GridTemplateColumn
ItemTemplate
asp:Label
"Label1"
Text='<%# Eval("Name") %>'></
EditItemTemplate
asp:TextBox
"TextBox1"
telerik:GridEditCommandColumn
protected
void
RadGrid1_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
dynamic data =
new
[] {
{ ID = 1, Name =
"name1"
},
{ ID = 2, Name =
"name2"
{ ID = 3, Name =
"name3"
{ ID = 4, Name =
"Name4"
{ ID = 5, Name =
"name5"
}
};
RadGrid1.DataSource = data;
RadGrid1_ItemDataBound(
sender, GridItemEventArgs e)
if
(e.Item.IsInEditMode && e.Item
is
GridEditableItem && e.Item
GridDataInsertItem)
// Insert mode
GridEditableItem item = e.Item
as
GridEditableItem;
(item[
].Controls[0]
TextBox).Text =
"Your ID"
;
(item.FindControl(
)
"Your Name"