-----------------------------------------------------------
New Message on cochindotnet
-----------------------------------------------------------
From: shinoy_babu
Message 3 in Discussion
hi rilov
here is the solution
dgEmployee is the id of datagrid
<o:p> </o:p>
<o:p> </o:p>
Private Sub dgEmployee_Init(ByVal sender As Object, ByVal e As _
System.EventArgs)Handles dgEmployee.Init<o:p></o:p>
dgEmployee.AutoGenerateColumns = False<o:p></o:p>
Dim colWidth As Integer = 75
Dim col As New BoundColumn()<o:p></o:p>
col.HeaderText = "Employee<BR>ID"<o:p></o:p>
col.DataField = "id"<o:p></o:p>
col.ItemStyle.HorizontalAlign = HorizontalAlign.Left<o:p></o:p>
col.HeaderStyle.HorizontalAlign = HorizontalAlign.Center<o:p></o:p>
col.ItemStyle.Width = New Unit(colWidth, UnitType.Pixel)<o:p></o:p>
dgEmployee.Columns.Add(col)<o:p></o:p>
'Store this info for later use.<o:p></o:p>
dgEmployee.Attributes(col.DataField) = dgEmployee.Columns.Count - 1<o:p></o:p>
col = New BoundColumn()<o:p></o:p>
col.HeaderText = "Employee<BR>Name"<o:p></o:p>
col.DataField = "name"<o:p></o:p>
col.HeaderStyle.HorizontalAlign = HorizontalAlign.Center<o:p></o:p>
col.ItemStyle.Width = New Unit(colWidth, UnitType.Pixel)<o:p></o:p>
dgEmployee.Columns.Add(col)<o:p></o:p>
<o:p> </o:p>
dgEmployee.Attributes(col.DataField) = dgEmployee.Columns.Count - 1<o:p></o:p>
col = New BoundColumn()<o:p></o:p>
col.HeaderText = "Age"<o:p></o:p>
col.DataField = "age"<o:p></o:p>
col.ItemStyle.HorizontalAlign = HorizontalAlign.Center<o:p></o:p>
col.HeaderStyle.HorizontalAlign = HorizontalAlign.Center<o:p></o:p>
col.ItemStyle.Width = New Unit(colWidth, UnitType.Pixel)<o:p></o:p>
dgEmployee.Columns.Add(col)<o:p></o:p>
dgEmployee.Attributes(col.DataField) = dgEmployee.Columns.Count - 1<o:p></o:p>
End Sub
i am shinoy from cochin
This event is happend when the data grid is initializing
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
-----------------------------------------------------------
To stop getting this e-mail, or change how often it arrives, go to your E-mail
Settings.
http://groups.msn.com/cochindotnet/_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]