S
spitapps
I have a gridview declaratively added to my webform. This gridview
displays data from a stored procedure returned as a dataset. Once the
dataset has been modified slightly i bind it to my gridview control.
Now where and how would i go about adding a column to my gridview
dynamically that is a checkboxfield and is checked based on some
criteria i want to use. An example...
if
DataSet.Tables(0).Rows(i).Item("Discontinued").toString().Equals("yes")
then
checkboxfield is readonly and checked when displayed
next row from dataset
Here is my <Columns> section of my gridview control
<Columns>
<asp:BoundField
DataField="customerNumber" HeaderText="CustomerNumber" />
<asp:BoundField
DataField="address2" HeaderText="Attention" />
<asp:BoundField DataField="city"
HeaderText="City" />
<asp:BoundField DataField="state"
HeaderText="State" />
<asp:BoundField DataField="zipcode"
HeaderText="Zipcode" />
<asp:BoundField
DataField="distance" HeaderText="Distance" />
<asp:HyperLinkField Text="Customer
Info.." DataNavigateUrlFields="rowid" Target="_blank"
DataNavigateUrlFormatString="Products.aspx?id={0}" />
</Columns>
Thanks for any help regarding this in advance
Kyle Spitzer
displays data from a stored procedure returned as a dataset. Once the
dataset has been modified slightly i bind it to my gridview control.
Now where and how would i go about adding a column to my gridview
dynamically that is a checkboxfield and is checked based on some
criteria i want to use. An example...
if
DataSet.Tables(0).Rows(i).Item("Discontinued").toString().Equals("yes")
then
checkboxfield is readonly and checked when displayed
next row from dataset
Here is my <Columns> section of my gridview control
<Columns>
<asp:BoundField
DataField="customerNumber" HeaderText="CustomerNumber" />
<asp:BoundField
DataField="address2" HeaderText="Attention" />
<asp:BoundField DataField="city"
HeaderText="City" />
<asp:BoundField DataField="state"
HeaderText="State" />
<asp:BoundField DataField="zipcode"
HeaderText="Zipcode" />
<asp:BoundField
DataField="distance" HeaderText="Distance" />
<asp:HyperLinkField Text="Customer
Info.." DataNavigateUrlFields="rowid" Target="_blank"
DataNavigateUrlFormatString="Products.aspx?id={0}" />
</Columns>
Thanks for any help regarding this in advance
Kyle Spitzer