Good tip, thanks.
As far as the s, I put s in front of all my screen fields. I manually move
the mix of table values from datasets and output parameters(retrieved from
stored procedures) and move them into the screen fields. The screen field
name is the same as the file field name. I created a stored procedure that
generates the code to map the values into the screen fields that I can cut
and paste into the code, along with a function to handle nulls automatically,
both incoming and outgoing.
I could have used the same name, without the s, but this helps me keep track
of when I'm refering to one of the screen fields, instead of some calculated
field.
I also created custom controls for the various types of screen fields (like
date, email, currency, name, address, etc) that ensures that valid data is
entered, reformats the entered data if valid, and has properties with the
actual value for that datatype, along with built in security to ensure the
user has access to that control.
So, I just found it easier to move the values from and to the database when
the fields weren't bound to a datatable. I supposed I should have used 'f'
for form, but 's' looks better in front of the fields and I keep wanting to
call them screens.
Benny Raymond said:
Just in case, you may want to check to make sure that
sHistory.Nodes.Count > 0
Just curious, why the s before History? From most of the code i've seen
other people setting the first letter to the datatype but i guess i was
completely wrong? what does the s normally mean?
Thanks,
FYI: Here's the code I used after I finished populating the tree (sHistory
is the treeview contorl).
TreeNode firstNode = sHistory.Nodes[0];
if (!firstNode.IsVisible)
{
firstNode.EnsureVisible();
}
:
How do I change it to initially show the 1st ten items.
The TreeNode class has an EnsureVisible method. Try calling it for the
first node.
Mattias