Dear all,
I want to put below code in the ultragrid cell click action. How can I do or what eventhandler I can use?
this.txtcellvalue.text=this.ultragrid1.activeCell.text;
Thanks,
Hi,
This code doesn't make sense. It looks like you want to set the value of a cell to the value of the active cell. But you can't do this for a cell the user clicks on, because once the user clicks on that cell, it will become the active cell and you will be setting the cell's value to itself.
Also, you can't set the Text property on a cell, anyway, you can only set the Value property.
Perhaps if you explain in more detail what you are trying to do, I could offer some other suggestions.
Dear Mike,
Sorry that I have not mentioned much.
It should be set active cell text to the textBox.text
Do you have any ideas?
Okay, you can't set the Text property of a cell, you have to set the Value. But this should work:
this.ultraGrid1.ActiveCell.Value = this.textBox1.Text
The only reason that would fail is if there is no ActiveCell (so you should check for null) or if the text you are trying to set it not valid for the cell (like if the ActiveCell is a CheckBox, for example).