-----------------------------------------------------------
New Message on MumbaiUserGroup
-----------------------------------------------------------
From: ubbus
Message 2 in Discussion
Hi Praveen,
The DataGrid has an ItemBound event that gets fired whenever each
row in the grid gets bound to a row from the DataSource. The row that is currently
being bound is passed as the Item property of the second parameter of the event i.e.
eventargs. Using this row reference, you can get a handle to the label or whatever
control that you want to bind the data to and assign to it. Remember though that, the
"whatever control" in question needs to be a server-side control (HTML/WebForm) for
the operation to be successful. btw, the DataRow being bound to is available from the
DataItem property of the Item property. I am pasting some sample code for your
reference:
Private Sub dgApplicableComponentGroups_ItemDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.DataGridItemEventArgs) Handles
dgApplicableComponentGroups.ItemDataBound
Select Case e.Item.ItemType
Case ListItemType.Footer
Return
Case ListItemType.Header
Return
Case ListItemType.Pager
Return
Case ListItemType.Separator
Return
End Select
e.Item.Cells(0).Attributes.Add("ComponentGroupID", CType(e.Item.DataItem,
DataRowView)(0).ToString())
End Sub
Regards,
ubbus.
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/mumbaiusergroup/_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]