-----------------------------------------------------------
New Message on BDOTNET
-----------------------------------------------------------
From: diniya25
Message 5 in Discussion
Hi Here I have mentioned the some usefull tips for adding controls to
datagrid cell. In the Datagrid ItemDataBound event you have to add following
code. Example: if e.Item.ItemType = ListItemType.Item or e.Item.ItemType
= ListItemType.AlternatingItem Then 'adding the label
Dim myLBL As New Label
myLBL.EnableViewState = True
myLBL.Text = dgTable(dg1).Rows(e.Item.DataSetIndex)(0)
e.Item.Cells(0).Controls.Add(myLBL)
If dgTable(dg1).Rows(e.Item.DataSetIndex)(2) = "txtbox" Then
'insert textbox and load with data
Dim myTB As New TextBox
If Not IsPostBack Then
myTB.Text = dgTable(dg1).Rows(e.Item.DataSetIndex)(1)
End If
e.Item.Cells(1).Controls.Add(myTB)
End If
If dgTable(dg1).Rows(e.Item.DataSetIndex)(2) = "checkbox" Then
'insert checkbox and load with data
Dim myCB As New CheckBox
If Not IsPostBack Then
If dgTable(dg1).Rows(e.Item.DataSetIndex)(1).tolower = "t" Then
myCB.Checked = True
Else
myCB.Checked = False
End If
End If
e.Item.Cells(1).Controls.Add(myCB)
End If
end if I think this is usefull for u
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/bdotnet/_emailsettings.msnw
Need help? If you've forgotten your password, please go to Passport Member
Services.
http://groups.msn.com/_passportredir.msnw?ppmprop=help
For other questions or feedback, go to our Contact Us page.
http://groups.msn.com/contact
If you do not want to receive future e-mail from this MSN group, or if you
received this message by mistake, please click the "Remove" link below. On the
pre-addressed e-mail message that opens, simply click "Send". Your e-mail
address will be deleted from this group's mailing list.
mailto:[EMAIL PROTECTED]