I'm running into a thing with a data edit WebForm trying to set a column's ReadOnly property.
Data is returned from SQL into a DataSet
GridView is defined as follows
asp:GridView ID="GV1" runat="server" AutoGenerateEditButton="True"
CellPadding="10" CellSpacing="10" BorderStyle="Solid"
HorizontalAlign="Center" Caption="DashBoard Configuration Settings"
CaptionAlign="Top">
EditRowStyle BackColor="#99CCFF" />
/asp:GridView>
GridView GV1 is handled as follows
GV1.DataSource = GVSet;
GV1.DataBind()
The data displays in a grid, as one would expect, but when I get the ColumnIndex of the column that should be ReadOnly and then try to set it with
((BoundField)GV1.Columns[ColIndx]).ReadOnly = true;
I get an "index out of bounds" error because GV1.Columns.Count = 0
What am I missing, besides a deep and abiding understanding of c#?
"You don't manage people. You manage things - people you lead" Adm. Grace Hopper
Pflugerville, between a Rock and a Weird Place