calvin Posted November 1, 2004 Posted November 1, 2004 I would like to create an object(like label) on each column of datagrid(create column in runtime). I was get an error of "Object reference not set to an instance of an object" in my code. Code: For i = 1 to ... Dim _templateColumn As TemplateColumn _templateColumn = New TemplateColumn _templateColumn.HeaderText = i.ToString("00") Dim lblRegistered As Label = New Label lblRegistered.ID = "lblResult" & i _templateColumn.ItemTemplate.InstantiateIn(lblRegistered) *Error here Controls.Add(lblRegistered) DataGrid1.Columns.Add(_templateColumn) Next Is there any error in my code? Please let me know if you found it. Appreciate for those who give the solution and comments. Thank you. Calvin Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.