can't check the value of a field

P

phil

Hi,

The aspx file contains a datasource and a gridview.
The (only) field is a boolean type (true/false).
Now, when the value of the field is 'true' something must happen (e.g.
Response.Write("this is true") ).
So i used the server-event 'GridView1_RowCreated' but how can i check the
value of the field on each row?
I tried this code below, but it doesn't work ...
Thanks
Phil

<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\mydb.mdb"
ProviderName="System.Data.OleDb" SelectCommand="SELECT field1 from
mytable"></asp:SqlDataSource>
<asp:GridView ID="GridView1" runat="server" DataSourceID="SqlDataSource1"
<Columns><asp:BoundField DataField="myfield" /> </Columns>
</asp:GridView>

The code-behind:
Protected Sub GridView1_RowCreated(ByVal sender As Object, ByVal e As
System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowCreated
Dim a As DataControlField
a = GridView1.Columns(0)
' This contains the name of the field but there is nothing i can put after
'Columns(0).' , like "value" or something ...
End Sub
 

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,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top