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
<
asp:TextBox
ID
=
"TextBox1"
runat
"server"
/>
asp:Button
"Button1"
Text
"Add Rows"
onclick
"Button1_Click"
telerik:RadGrid
"RadGrid1"
onneeddatasource
"RadGrid1_NeedDataSource"
>
MasterTableView
Columns
telerik:GridTemplateColumn
ItemTemplate
asp:Label
"Label1"
></
</
int
num = 0;
public
static
count = 0;
protected
void
RadGrid1_NeedDataSource(
object
sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
DataTable ds =
new
DataTable();
RadGrid1.DataSource = addBlankLines(ds, count);
}
Button1_Click(
sender, EventArgs e)
num = Convert.ToInt32(TextBox1.Text);
count = count + num;
RadGrid1.Rebind();
private
DataTable addBlankLines(DataTable ds,
count)
if
(num != 0)
DataRow drBlank =
default
(DataRow);
for
(
i = 0; i < count; i++)
drBlank = ds.NewRow();
ds.Rows.Add(drBlank);
return
ds;