|
-
Dec 5th, 2005, 10:39 AM
#1
Thread Starter
Junior Member
Masking a Binding DataGrid control
[code]
Dim bndTemp As Binding
bndTemp = New Binding("Text", DsCustomersDB1, "tblCustomers.fldCustPFCDate")
txtCustPFC.DataBindings.Add(bndTemp)
[code]
The result of the above code has variable fldCustPFCDate with the value of: 9/1/2005 12:00:00 AM
In my Access tblCustomers data table, fldCustPFCDate has a format of short date and only contains the date: 9/1/2005 as its value.
My question is how do I mask this New Binding statement to show only the date?
Thanks,
Soleman
-
Dec 5th, 2005, 11:24 AM
#2
Re: Masking a Binding DataGrid control
Maybe like this:
VB Code:
Dim bndTemp As Binding
bndTemp = New Binding("Text", DsCustomersDB1, ctype("tblCustomers.fldCustPFCDate",date).ToShortDateString)
txtCustPFC.DataBindings.Add(bndTemp)
-
Dec 5th, 2005, 12:43 PM
#3
Thread Starter
Junior Member
Re: Masking a Binding DataGrid control
Hi Wild Bill!
I tried your suggestion and a get the following error:
Cast from string "tblCustomers.fldCustPFCDate" to type 'Date' is not valid
-
Dec 5th, 2005, 04:58 PM
#4
Re: Masking a Binding DataGrid control
VB Code:
For Each dr As DataRow In DsCustomersDB1.Tables("tblCustomers").Rows
dr.Item("fldCustPFCDate") = CType(dr.Item("fldCustPFCDate"), Date).ToShortDateString
Next
Dim bndTemp As Binding = New Binding("Text", DsCustomersDB1.Tables("tblCustomers"), "fldCustPFCDate")
txtCustPFC.DataBindings.Add(bndTemp)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|