Subject | TIB_Grid Field Validation and Totals |
---|---|
Author | Bob |
Post date | 2002-11-21T17:13:06Z |
I need some advise on handling tib_grids. I am having fits trying to
validate and operate on data the the user is entering into grids. Here are a
few examples:
1. Certain rows need to be read-only depending on the value in a certain
column of the grid (ie. Processed = true). I can't figure out how to
conditionally make a row read-only.
2. The user enters values in a column which is then totalled, but if the
total that the user entered is greater than the total allowed, change the
user's input either back to zero or to the maximum that they'd be allowed to
enter. My difficulties appeared to be in calculating the total: a SP on the
server would not operate on the data in the grid, but if I operated on the
tib_query that the grid pointed to I would lose track of where the user was
in the grid and start firing off events left and right while I iterated
through the dataset to recalc the total. I'm not sure what event to tie to.
I can certainly provide more detail on these problems. Before I do that I
want to know whether other people use grids for such editing or whether it's
preferred to use them read-only and then popup a different window to allow
the user to actually edit. It seems that every time I hook to an event to
operate on a grid I get that event firing all the time (mostly at
inopportune times). What's the recommended practice?
Any suggestions on my above problems are appreciated also, unless I'm all
washed up in my approach.
Thanks for your advice.
Bob.
validate and operate on data the the user is entering into grids. Here are a
few examples:
1. Certain rows need to be read-only depending on the value in a certain
column of the grid (ie. Processed = true). I can't figure out how to
conditionally make a row read-only.
2. The user enters values in a column which is then totalled, but if the
total that the user entered is greater than the total allowed, change the
user's input either back to zero or to the maximum that they'd be allowed to
enter. My difficulties appeared to be in calculating the total: a SP on the
server would not operate on the data in the grid, but if I operated on the
tib_query that the grid pointed to I would lose track of where the user was
in the grid and start firing off events left and right while I iterated
through the dataset to recalc the total. I'm not sure what event to tie to.
I can certainly provide more detail on these problems. Before I do that I
want to know whether other people use grids for such editing or whether it's
preferred to use them read-only and then popup a different window to allow
the user to actually edit. It seems that every time I hook to an event to
operate on a grid I get that event firing all the time (mostly at
inopportune times). What's the recommended practice?
Any suggestions on my above problems are appreciated also, unless I'm all
washed up in my approach.
Thanks for your advice.
Bob.