John Smith wrote:
Is it possible to set DataGrid's ReadOnly property to True/False at
runtime? An example:
<asp:datagrid id="dg1" runat="server" AutoGenerateColumns="False">
<Columns>
<asp:BoundColumn DataField="id" ReadOnly="True"
HeaderText="ID"></asp:BoundColumn>
</Columns>
<asp:datagrid>
Hmm. You asked about the grid's ReadOnly property, but you illustrated
it by showing a column's ReadOnly attribute. Which one did you really
mean?
Sub SetGridEditMode(RO as boolean)
dg1.ReadOnly = RO
End Sub
or
Sub SetGridColEditMode(colidx as int32,RO as boolean)
dim col as datagridcolumn = dg1.Columns(colidx)
End Sub
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.