Hi
I'm trying to add an ultratexteditor with a statebutton on the left to a column. For that purpose I just added this control to my form an set my column's editorcomponent to it.
but the column is always show an as a simple textbox.
How can I achieve my goal?
ok, typical
After researching for hours, I post my question and solve it 10minutes later by myself :D
My fault was, that I manually defined a dataschema and set the datasource in code, so I have to configure my columns after setting my datasource.
One question remains.
Whenever I check/uncheck my statebutton all buttons (of every row) get checked/unchecked.I assume this is because, they all use the same control. Is there a way around it?problem is I want to always show this editor control.What are my options to do that?
any ideas?
is my question clear or do you need additional information?
Hi,
The grid cell itself only stores one peice of information. So you will need to store the state of the state button in the grid row somehow.
You can store the state in any number of places. I'd recommend using the Tag property on the row or on the cell. Or, you could add an unbound column to the grid and hide it. Or... perhaps the state already corresponds to a field in your data source?
Wherever you decide to store the state, what you have to do is handle the UltraCheckEditor's InitializeEditorButtonCheckState event. This event passes you a Context on the event args, which in this case will be a grid cell. And given that grid cell, you need to check the e.CheckState property on the event args to the current state for that cell.
You will also need to trap the EditorButtonClick event. Again, this event passes you a context. In this event, you need to store the state for the button somewhere in the grid row or cell.
Hi Mike
Thanks for your reply.
the state corresponds to a field in my datasource.the problem is that, to each state there is a text the user can input.Like user A checked state B and has to write a reason why he did it.
I thought I could use an ultratextbox editor with a statebutton to reflect this tight coupling.But the only way I found was assign a new ultratextbox to every cell, which isn't very perfomant I assume(although it worked very will with 1000 rows, which is way more than I'll be needing)
I assume you're refering to the ultracheckeditor in the ultratextbox?if so, would affect a change of the checked-state all my cells, since all use the same control?
I'm afraid you lost me. I don't understand what you are saying. Why do you need an UltraTextEditor for every row?
I explained how to use only one and initialize based on the data in the row. But in order to do this, you need to store the state information somewhere. So if your data source has a boolean field to store the state and another field to store the text, there should be no problem.
I was not talking about UltraCheckEditor here - your question was about a StateButton, which I assumed to mean an EditorButton in the ButtonsLeft collection of the UltraTextEditor. Did I misunderstand you?
Let us know if you have further questions.
Michael S.
the problem still exists, but I found another solution (working with RowLayouts now)
thanks