I am adding a column in ultrawebgrid with column.type as Button. I want to enable / disable it depending upon the value in the data table coulmn which is bound to this ultrawebgrid.
I will really appreciate a quick respnse.
Thanks,
SP.
So you want to enable/disable on a row by row basis?
If so, you can loop through the rows in the grid and examine the values of the cell in question, then set the .AllowEditing property of the cell based upon the value it finds.
air code:
for each r as ultragridrow in yourgrid.rows
if r.cells.fromkey("fieldkey").value = somevalue then
r.cells.fromkey("buttonfield").allowediting = no
end if
next
Hi gernblandston,
I tried setting cell.AllowEditing ro no.
But the CellButton is not getting Disabled.
It works for normal cell though Any Ideas?
Regards
AKVarms
I actually found my answer when looking up an issue for something else.
Using the InitializeRow event, I check the value of a cell and if it was the value I was looking for I hid the button in another cell.
I do need help with something else though.
I can't figure out how to set the Text of the button when I add a new row. I'm using the addnewbox hidden = false so there is a button showing up at the bottom of my grid to click on to add a new row. In my new row, I have a button in one of the cells, I have the text of this button set to "edit" but on a new row I need the text to be "lookup". Is there an event that takes place when the user clicks on the button to add a row so I can change the text of the button? Or, can I set the default text of this button thru the control in the aspx page? I'm currently using the InitializeRow event to set the text to "edit".