datagrid controls

  • Thread starter Thread starter DotNetJunkies User
  • Start date Start date
D

DotNetJunkies User

How do i desabled the edit mode in my datagrid.
In the datagrid i put an EditCommandColumn with OnEditCommand="setEditMode" and onUpdateCommand="SetUpdateMode" and onCancelCommand="SetCancelCommand".
sometime i would like to disable the onEditcommand, so when click on Edit, it doesn't react
to this action(the same when we write Button.enable=false). The aim of this is that i dont want to permit the update of data downloaded
into the datagrid when some these data have a specific value.
here a part of my code where i would like to put this instruction.

Private Sub Page_Load(Byval sender as system.Object, ByVal e as System.EventArgs)

if not ispostback then
bindDatagrid()

if .... then
/* here a part of my code where i would like to put this instruction. */

end if
end if

End Sub
 
Look into the ItemDataBound event of the datagrid. As each row of the grid
is created this event fires and you may use it to check what your data is
and then disable the edit command for that row.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
DotNetJunkies User said:
How do i desabled the edit mode in my datagrid.
In the datagrid i put an EditCommandColumn with
OnEditCommand="setEditMode" and onUpdateCommand="SetUpdateMode" and
onCancelCommand="SetCancelCommand".
sometime i would like to disable the onEditcommand, so when click on Edit, it doesn't react
to this action(the same when we write Button.enable=false). The aim of
this is that i dont want to permit the update of data downloaded
into the datagrid when some these data have a specific value.
here a part of my code where i would like to put this instruction.

Private Sub Page_Load(Byval sender as system.Object, ByVal e as System.EventArgs)

if not ispostback then
bindDatagrid()

if .... then
/* here a part of my code where i would like to put this instruction. */

end if
end if

End Sub
engine supports Post Alerts, Ratings, and Searching.
 
Back
Top