Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

vTree show error cell

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support
View previous topic :: View next topic  
Author Message
medbiller



Joined: 20 Dec 2007
Posts: 39
Location: Arroyo, PR

PostPosted: Tue Aug 28, 2012 1:13 pm    Post subject: vTree show error cell Reply with quote

I have a vTree with 1 From Date column & 1 To Date column. Before commiting to database I check that FromDate <= ToDate for each row. Is there a way to mark a cell that has an error (i.e. FromDate > ToDate) like the MS DataViewGrid SetError method?
_________________
Medical billing & records developer.
Back to top
View user's profile Send private message Visit poster's website AIM Address
medbiller



Joined: 20 Dec 2007
Posts: 39
Location: Arroyo, PR

PostPosted: Tue Aug 28, 2012 3:16 pm    Post subject: Reply with quote

For example when I click the save button I do this:
If vt.FindRow(dtrw).Item(procDx.Name).ToString.Trim.Length = 0 Then
Dim cellData As New CellData(procDx)
binding.GetCellData(vt.FindRow(dtrw), procDx, cellData) 'get the default binding for the given row and use it to populate the cell data
cellData.Error = "Dx pointer Error"
vt.UpdateRowData(vt.FindRow(dtrw))
cellErr = True
End If

Where dtrw if the current datarow I'm checking in a For/Next loop, vt is the vTree. After vtUpdateRowData I see no red dot in the errored cell.
_________________
Medical billing & records developer.
Back to top
View user's profile Send private message Visit poster's website AIM Address
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Aug 29, 2012 12:05 am    Post subject: Reply with quote

Yes you can associate errors either with a particular cell or the whole row. If you binding to DataSet then you can just call DataRow.SetColumnError to set the error that should be displayed for a particular column, or set the DataRow.RowError property to set an error in the row header. This will display an error icon in the column or row header and when the user hovers over the error icon the error is displayed in a tooltip. The sample Data Set Browser project demonstrates doing this if you enter a Required Date for an order to be more than 1 month later than todays date it will set an error on the Required Date cell.

If you are not binding to a DataSet then you can still display errors but you need to handle them programmatically. To do this handle the GetCellData event and set the error programmatically eg

Code:
        private void _virtualTree_GetCellData(object sender, Infralution.Controls.VirtualTree.GetCellDataEventArgs e)
        {
            // get the default binding for the given row and use it to populate the cell data
            //
            RowBinding binding = _virtualTree.GetRowBinding(e.Row);
            binding.GetCellData(e.Row, e.Column, e.CellData);

            if (someCondition)
            {
                e.CellData.Error = "There was an error";
            }
        }


Then in your Save method you would just call UpdateRowData to force Virtual Tree to update the cell data.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Virtual Tree Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group