Hi Vijaya,
The basic idea is to use the grid's ItemDataBound event. Here's an example.
Private Sub DataGrid1_ItemDataBound(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.DataGridItemEventArgs) Handles
DataGrid1.ItemDataBound
If (e.Item.ItemType = ListItemType.Header) Then
CType(e.Item.Cells(1).FindControl("Button1"),
WebControls.TextBox).Text = "hello"
End If
End Sub
However, my example uses static text, "hello". You can write an entire
database selection function here in this event. Another option is to walk
through your dataset before closing it and storing the desired value in a
global variable for later use here. In any case, ItemDataBound is the place
to do it.
Thank you, Mike
Microsoft, ASP.NET Support Professional
Microsoft highly recommends to all of our customers that they visit the
http://www.microsoft.com/protect site and perform the three straightforward
steps listed to improve your computer’s security.
This posting is provided "AS IS", with no warranties, and confers no rights.
--------------------