Click here to Skip to main content
15,885,896 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi,

I am getting error while adding date at runtime to mshflexgrid header column.
Can anybody help me to resolve this please.

Thanks very much..
Prerana

the error is : Exception from HRESULT: 0x800A017D (CTL_E_INVALIDPROPERTYARRAYINDEX)
this error is displaying at the last time of loop.
The following is the code:

If i = 3 Then
                       fdate = DateTimePicker1.Value.ToString("MM/dd/yyyy HH:mm:ss tt")
                       sdate = DateTimePicker1.Value.ToString("dd-MM-yyyy")
                       .set_TextMatrix(0, i, sdate)
                   ElseIf i > 3 And i < 34 Then
                       If rbtDaily.Checked = True Then
                           j = 1
                           ndate = (Now.AddDays(j).ToString("MM/dd/yyyy HH:mm:ss tt"))
                           sdate = Now.AddDays(j).ToString("dd-MM-yyyy")
                           '.set_ColWidth(i, 1000) ': .get_GridLinesHeader("'" & ndate & "'")
error at this line:        .set_TextMatrix(0, i, sdate)
                       ElseIf rbtWeekly.Checked = True Then
                           ndate = DateValue(Now.AddDays(6).ToString("MM/dd/yyyy HH:mm:ss tt"))
                           sdate = Now.AddDays(6).ToString("dd-MM-yyyy")
                           .set_TextMatrix(0, i, sdate)
                       ElseIf rbtMonthly.Checked = True Then
                           j = 1
                           ndate = DateValue(Now.AddMonths(j).ToString("MM/dd/yyyy HH:mm:ss tt"))
                           sdate = Now.AddDays(j).ToString("dd-MM-yyyy")
                           ' tdate = ndate
                           .set_TextMatrix(0, i, sdate)
                       End If
Posted
Updated 9-Feb-12 22:31pm
v3
Comments
Rajesh Anuhya 10-Feb-12 2:13am    
Edited: Code Tags added.
--RA
Sergey Alexandrovich Kryukov 10-Feb-12 2:46am    
Nothing is explained! What error, where; resolve what?
--SA
OriginalGriff 10-Feb-12 3:14am    
It is not at all clear from that what your problem is: we don't know what the code it meant to do, so we can't tell what it is doing wrong.

Use the "Improve question" widget to edit your question and provide better information.
Christian Graus 10-Feb-12 7:57am    
Why on earth use the msflexgrid in VB.NET ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900