matt
|
Posted: 09/08/2005, 1:09 PM |
|
Another simple (?) one. How do I add a row-level error message on an editable grid?
I'm using the onValidate event to do custom validation and I want to flag the specific row on which I find the problem. $egrid->Errors->addError puts the message at the top of the grid, not on the specific row. I can not find anything in the documentation about this.
|
|
|
DonB
|
Posted: 09/08/2005, 1:31 PM |
|
CCS 'bubbles up' the errors from individual row Controls to the row itself.
So, if you do validation on a Textbox (for example) and declare an error,
that error gets pushed into the RowsErrors property (an array of strings,
indexed by row number) of the Grid. You don't have ready access to the
'current row number' or the ValidateRow code (from an event handler), so
it's not practical to try setting the RowsErrors[] directly from your event
handler code.
You can look at the ValidateRow method of your EdGrid to see what I mean.
--
DonB
http://www.gotodon.com/ccbth
"matt" <matt@forum.codecharge> wrote in message
news:543209a802cf23@news.codecharge.com...
> Another simple (?) one. How do I add a row-level error message on an
editable
> grid?
>
> I'm using the onValidate event to do custom validation and I want to flag
the
> specific row on which I find the problem. $egrid->Errors->addError puts
the
> message at the top of the grid, not on the specific row. I can not find
> anything in the documentation about this.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
matt
|
Posted: 09/08/2005, 2:58 PM |
|
>> CCS 'bubbles up' the errors from individual row Controls to the row itself.
So, if you do validation on a Textbox (for example) and declare an error,
that error gets pushed into the RowsErrors property
That's not the behavior that I see. I'm doing the validation on a listbox and the errors that I throw are showing up at the "grid" level, not for the individual row. I was hoping to display the errors pertaining to a specific row right above that row. The documentation implies that this is possible, but I can't find an example of how to do it. Again I'm doing $gridname->Errors-addError("message"). Should I be doing something like $gridname->controlname->Errors->addError().? I'll have tried it before you respond......
|
|
|
matt
|
Posted: 09/08/2005, 3:02 PM |
|
Well whaddayaknow - that worked. Like I said at the start - I knew there had to be an easy answer. Those are usually the hardest ones for me to see.
|
|
|
Michael Mikkelsen
|
Posted: 09/08/2005, 3:42 PM |
|
Since he answered his own question shouldn't this go under Tips and Solutions? Just wondering.
I don't think anyone ever looks in the Tips and Solutions forum anyway: http://forums.yessoftware.com/forum.php?forum_id=25
I like this one, but then again I wrote it, so I would: http://forums.yessoftware.com/posts.php?post_id=62496
|
|
|
|