QUERY : Dymanic Datagrid

2 views
Skip to first unread message

Prince P Y

unread,
Oct 24, 2005, 12:08:55 PM10/24/05
to Techdot...@googlegroups.com

Can any one send the code for dynamic data grid manipulation with out real table binding…

 

 

Regards,

Prince P Y [B.E I.T],

S/W Engineer,

REACH Technologies,

#621, 5th Main,

OMBR Layout,

Bangalore -43

www.reach-tech.com

Mob: 91-944862035

Res: 080-55369104

Off: 080-56996111/2/3 - Ext: 227

 

Current Res Address:

24/6, 3rd Cross, Sri Lakshmi Residency,

St. Johns Orthodox Church Road,

A Narayanapura, Nagappareddy Layout,

Near K.R.Puram Railway station,

Bangalore – 16, India

 

Srinath B

unread,
Oct 24, 2005, 11:18:51 PM10/24/05
to Techdot...@googlegroups.com
hi Prince P Y
      i did not get u clearly but i think this shuld help u out
the code is in vb.net
 

Dim

 datagrid1 As New DataGrid

Dim ds As New DataSet

Dim dt As New DataTable

// creatin columns

Dim

dc As New DataColumn("column1")

dt.Columns.Add(dc)

.
.
.
.
.
// creating rows

Dim

dr  As DataRow = dt.NewRow
 // adding row values.....(0) means column no u can use
 //column name directly either
 
 
dr(0)  =   " "
.
.
..
.
 
// adding rows 2 table
dt.rows.add(dr)
 
// adding table 2 dataset
 
ds.tables.add(dt)
 
// bcoz v r makin changes 2 daaset this is must
 
ds.acceptchanges()
 
// well depengin on ur requirement make changes in the following
 

datagrid1.EnableViewState =

True

datagrid1.AutoGenerateColumns =

True

datagrid1.HorizontalAlign = HorizontalAlign.Center

datagrid1.ItemStyle.HorizontalAlign = HorizontalAlign.Center

datagrid1.HeaderStyle.HorizontalAlign = HorizontalAlign.Center

datagrid1.CssClass = "REPSTYLE"

datagrid1.CellPadding = 4

datagrid1.HeaderStyle.CssClass = "REPHEADSTYLE"

datagrid1.DataSource = ds

datagrid1.DataBind()

Me.Controls.Add(datagrid1)
 
 
// if u wnt 2 add each row consecutively use loop and create a new datarow in dat
 
ok bye
Srinath
 
 
 

 
On 10/24/05, Prince P Y <princ...@gmail.com> wrote:

Can any one send the code for dynamic data grid manipulation with out real table binding…

 

 

Regards,

Prince P Y [B.E I.T],

S/W Engineer,

REACH Technologies ,

#621, 5th Main,

OMBR Layout,

Bangalore -43

www.reach-tech.com

Mob: 91-944862035

Res: 080-55369104

Off: 080-56996111/2 /3 - Ext: 227

Reply all
Reply to author
Forward
0 new messages