This is a migrated thread and some comments may be shown as answers.

AddRow to RadGrid

1 Answer 25 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dogan
Top achievements
Rank 1
Dogan asked on 05 Nov 2008, 11:53 AM

Hi,

how can i add new row to  RadGrid while grid was bind

RadGrid1.DataSource=MyDataSet();

RadGrid1.DataBind();

Telerik.Web.UI.GridTableRow Str = new Telerik.Web.UI.GridTableRow();

Telerik.Web.UI.GridTableCell Stn = new Telerik.Web.UI.GridTableCell();
Telerik.Web.UI.GridTableCell Stn2 = new Telerik.Web.UI.GridTableCell();
Telerik.Web.UI.GridTableCell Stn3 = new Telerik.Web.UI.GridTableCell();
Telerik.Web.UI.GridTableCell Stn4= new Telerik.Web.UI.GridTableCell();
Telerik.Web.UI.GridTableCell Stn5 = new Telerik.Web.UI.GridTableCell();


Stn.Text = "Deniz";

Stn.BorderWidth = new Unit(1, UnitType.Pixel);

Stn.BackColor = Color.Red;

Str.Cells.Add(Stn);

Str.Cells.Add(Stn2);
Str.Cells.Add(Stn3);
Str.Cells.Add(Stn4);
Str.Cells.Add(Stn5);
RadGrid1.Controls.Add(Str);


my grid has 5 colums but thats code give only 1 colums

please help me
thx

DD

1 Answer, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 07 Nov 2008, 11:42 AM
Hello Dogan,

First of all, I would suggest that you taka advantage of advanced databinding approach. Then, at any point you can add new rows to the underlying datasource - rebinding the grid control will ensure these rows are refreshed for the client.
I hope this helps.

All the best,
Yavor
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Dogan
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Share this question
or