J
jobs
Say I have Gridview with some Buttonfields I want to enable or disable
based on the values of other bound data? Here I want I only want to
enable button Rate only if field lastAction = "Export Completed"
If this can't be done at the time I first bind, and I must use
Findcontrol and by value, How can I do that?
<asp:GridView ID="PendingGridView" runat="server"
DataSourceID="PendingSqlDataSource"
AutoGenerateColumns="False" DataKeyNames="ProcessId,DayTag"
SkinID="GridView" Width="600px">
<Columns>
<asp:BoundField DataField="Processid" visible=false />
<asp:BoundField DataField="DayTag" HeaderText="Day Tag"
ReadOnly="True" SortExpression="DayTag" />
<asp:BoundField DataField="CarrierCode"
HeaderText="Carrier Code" SortExpression="CarrierCode" />
<asp:BoundField DataField="LastAction" HeaderText="Last
Action" SortExpression="LastAction" />
<asp:BoundField DataField="TotalRecords"
HeaderText="Total Records" SortExpression="TotalRecords" />
<asp:ButtonField ButtonType="Button" Text="Rate"
HeaderText="Rate" CommandName="Rate" >
</asp:ButtonField>
<asp:ButtonField ButtonType="Button" Text="Export"
HeaderText="Export" CommandName="Export">
</asp:ButtonField>
</Columns>
</asp:GridView>
based on the values of other bound data? Here I want I only want to
enable button Rate only if field lastAction = "Export Completed"
If this can't be done at the time I first bind, and I must use
Findcontrol and by value, How can I do that?
<asp:GridView ID="PendingGridView" runat="server"
DataSourceID="PendingSqlDataSource"
AutoGenerateColumns="False" DataKeyNames="ProcessId,DayTag"
SkinID="GridView" Width="600px">
<Columns>
<asp:BoundField DataField="Processid" visible=false />
<asp:BoundField DataField="DayTag" HeaderText="Day Tag"
ReadOnly="True" SortExpression="DayTag" />
<asp:BoundField DataField="CarrierCode"
HeaderText="Carrier Code" SortExpression="CarrierCode" />
<asp:BoundField DataField="LastAction" HeaderText="Last
Action" SortExpression="LastAction" />
<asp:BoundField DataField="TotalRecords"
HeaderText="Total Records" SortExpression="TotalRecords" />
<asp:ButtonField ButtonType="Button" Text="Rate"
HeaderText="Rate" CommandName="Rate" >
</asp:ButtonField>
<asp:ButtonField ButtonType="Button" Text="Export"
HeaderText="Export" CommandName="Export">
</asp:ButtonField>
</Columns>
</asp:GridView>