I've coded a gridview that has used bound data to determine if I
should show a button on a particular gridview row as follows:
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="Submit" Text="Test" CommandArgument='<
%#Eval("CNumber") %>' CommandName="Submit" Enabled='<%#
Test(Eval("ProcessId")) %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
Question is, how can I do the samething, but based on the value of
other columns that are yet to posted?
For example say I have a textbox column and dropdown column in the
grid. I only want the button to be visible if something has been
entered into the textbox and something has been selected on that row.
Thanks for any help or information!
wildman@noclient.net - 13 Feb 2008 19:43 GMT
Update on this.
I figured I might be able to accomplish this with in the rowcreated
event of the gridview. However, oddly enough, when I test my
dropdown's selected value, it's always showing the default selected
value, regardless of current viewstate value.
Any ideas?
Protected Sub AddPoints_RowCreated(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
gridAddPoints.RowCreated
If e.Row.RowType = DataControlRowType.DataRow Then
Dim minutes As String =
CType(e.Row.Cells(4).FindControl("Minutes"),
DropDownList).SelectedValue
If Not minutes = "Enter Minutes" Then
' NEVER TRUE THOUGH I DO SELECT ANOTHER VALUE.
Dim SubmitPoint As Button =
CType(e.Row.Cells(5).Controls(0), Button)
SubmitPoint.Enabled = "True"
End If
End If
End Sub
Angel - 13 Feb 2008 23:05 GMT
It must be the week for the GridView... You like someone else earlier have
what appears to be a mix of thing you want to do with the grid. I would
suggest that if you have something that is not working you post the code and
that will make life a lot easier for to help you.

Signature
aaa
> I've coded a gridview that has used bound data to determine if I
> should show a button on a particular gridview row as follows:
[quoted text clipped - 15 lines]
>
> Thanks for any help or information!