Variable DataGrid Column Text

A

Alan Z. Scharf

1. Is there a way to make datagrid column text fill in from an expression?

2. I want column header text based on a lookup value from a UDF.

Thanks.

Alan
 
K

Ken Cox [Microsoft MVP]

Not sure about the UDF, but if your datagrid isn't autogenerating the
columns, you should be able to get a column header like this:

Private Sub DataGrid1_PreRender _
(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles DataGrid1.PreRender
DataGrid1.Columns(0).HeaderText = "This could change" ' Could be an
expression?
End Sub

Is that what you meant?

Ken
MVP [ASP.NET]
 
A

Alan Z. Scharf

Ken,

Yes. Thanks again.

Alan


Ken Cox said:
Not sure about the UDF, but if your datagrid isn't autogenerating the
columns, you should be able to get a column header like this:

Private Sub DataGrid1_PreRender _
(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles DataGrid1.PreRender
DataGrid1.Columns(0).HeaderText = "This could change" ' Could be an
expression?
End Sub

Is that what you meant?

Ken
MVP [ASP.NET]


Alan Z. Scharf said:
1. Is there a way to make datagrid column text fill in from an expression?

2. I want column header text based on a lookup value from a UDF.

Thanks.

Alan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top