|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Disable ButtonColumn inside DataGrid through logicWhat I am looking to do is disable a column of ButtonColumn type inside
my DataGrid when another column of ButtonColumn types is pressed. For
instance, I have a button in my first column of the DataGrid that I am
using to select my row and do a little extra logic. I also have a
button in the last column of the DataGrid that I am going to use to do
some other logic that will display a hidden panel that has a message
with an OK and Cancel buttons asking them for confirmation to delete
the row.
So, what I want to do is, when you click the 'Delete' button, in my logic where I am un-hiding the panel and its controls, I want to disable the 'Select' button in the first column of the DataGrid for all rows. I currently have it working where I can 'hide' the ButtonColumn in the first column of my DataGrid, by using the following code, but I really want to leave it visible, but just 'disabled'. Does anybody know of a way to do this? dgCashReports.Columns[0].visible = false; // this hides the entire column of ButtonColumns Thanks, Stephen -- sheidt ------------------------------------------------------------------------ sheidt's Profile: http://www.highdots.com/forums/member.php?userid=323 View this thread: http://www.highdots.com/forums/showthread.php?t=1543962 change to a templated column, then in datagrids ItemDataBound:
If e.Item.ItemType = ListItemType.EditItem Then 'make sure of this e.Item.FindControl("FileUploadEdit").enabled = false endif Show quoteHide quote "sheidt" wrote: > > What I am looking to do is disable a column of ButtonColumn type inside > my DataGrid when another column of ButtonColumn types is pressed. For > instance, I have a button in my first column of the DataGrid that I am > using to select my row and do a little extra logic. I also have a > button in the last column of the DataGrid that I am going to use to do > some other logic that will display a hidden panel that has a message > with an OK and Cancel buttons asking them for confirmation to delete > the row. > > So, what I want to do is, when you click the 'Delete' button, in my > logic where I am un-hiding the panel and its controls, I want to > disable the 'Select' button in the first column of the DataGrid for all > rows. > > I currently have it working where I can 'hide' the ButtonColumn in the > first column of my DataGrid, by using the following code, but I really > want to leave it visible, but just 'disabled'. Does anybody know of a > way to do this? > > dgCashReports.Columns[0].visible = false; // this hides the entire > column of ButtonColumns > > Thanks, > Stephen > > > -- > sheidt > ------------------------------------------------------------------------ > sheidt's Profile: http://www.highdots.com/forums/member.php?userid=323 > View this thread: http://www.highdots.com/forums/showthread.php?t=1543962 > > FileUploadEdit is the name of my control. Put the name of your control there.
Show quoteHide quote "Harolds" wrote: > change to a templated column, then in datagrids ItemDataBound: > If e.Item.ItemType = ListItemType.EditItem Then 'make sure of this > e.Item.FindControl("FileUploadEdit").enabled = false > endif > > "sheidt" wrote: > > > > > What I am looking to do is disable a column of ButtonColumn type inside > > my DataGrid when another column of ButtonColumn types is pressed. For > > instance, I have a button in my first column of the DataGrid that I am > > using to select my row and do a little extra logic. I also have a > > button in the last column of the DataGrid that I am going to use to do > > some other logic that will display a hidden panel that has a message > > with an OK and Cancel buttons asking them for confirmation to delete > > the row. > > > > So, what I want to do is, when you click the 'Delete' button, in my > > logic where I am un-hiding the panel and its controls, I want to > > disable the 'Select' button in the first column of the DataGrid for all > > rows. > > > > I currently have it working where I can 'hide' the ButtonColumn in the > > first column of my DataGrid, by using the following code, but I really > > want to leave it visible, but just 'disabled'. Does anybody know of a > > way to do this? > > > > dgCashReports.Columns[0].visible = false; // this hides the entire > > column of ButtonColumns > > > > Thanks, > > Stephen > > > > > > -- > > sheidt > > ------------------------------------------------------------------------ > > sheidt's Profile: http://www.highdots.com/forums/member.php?userid=323 > > View this thread: http://www.highdots.com/forums/showthread.php?t=1543962 > > > >
Strange Error when viewing page
HtmlInputFile issue get the value of dropdownList check if image or file exists Easy way to use bound combo with foreignkey id/value on webform? Implicit conversion from one object to another set focus List'o MyProj CSS Elements? View DataSet Relational Data DataGrid edit mode |
|||||||||||||||||||||||