Add a new column to a grid view (v8)

Thanks for your reply,
I am trying to add the jobhead.createdby field on the work queue in MES. Once I go into customisation and click on the active work grid I can see some fields off the job head table so perhaps I wouldnt need a foreign key view but do not see the created by field as a hidden and therefore am trying to bring it into the grid view. Any help would be appreciated.
Thanks

Regards

Aman

--- In vantage@yahoogroups.com, bwalker@... wrote:
>
> As I have posted a couple times before - here is code for adding Parent Part to Time Phase grid:
>
> Module Script
>
>
> '// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
> '// Begin Wizard Added Module Level Variables **
>
> Private WithEvents edvTimePhas As EpiDataView
> '// End Wizard Added Module Level Variables **
>
>
> '// Add Custom Module Level Variables Here **
>
>
>
> Sub InitializeCustomCode()
>
>
> '// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Intialization' lines **
> '// Begin Wizard Added Variable Intialization
>
> edvTimePhas = CType(oTrans.EpiDataViews("TimePhas"), EpiDataView)
> '// End Wizard Added Variable Intialization
> '// Begin Custom Method Calls
> If Not (edvTimePhas.dataView.Table.Columns.Contains("ParentPart")) Then
> edvTimePhas.dataView.Table.Columns.Add(new DataColumn("ParentPart"))
> End If
> '// End Custom Method Calls
> End Sub
>
> Private Sub edvTimePhas_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvTimePhas.EpiViewNotification
> '// ** Argument Properties and Uses **
> '// view.dataView(args.Row)("[FieldName]")
> '// args.Row, args.Column, args.Sender, args.NotifyType
> '// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
> If (args.NotifyType = EpiTransaction.NotifyType.Initialize) Then
> If (args.Row > -1) Then
> AddParentPart()
> End If
> End If
> End Sub
>
> Private Sub AddParentPart()
> For Each dr As DataRow In edvTimePhas.dataView.Table.Rows
> If Not IsDBNull(dr("JobNum")) Then
> dr("ParentPart") = getParentPart(dr("JobNum"))
> End If
> Next
> End Sub
>
> Private Function getParentPart(ByVal job As String) As String
> Dim parentPart As String
> Dim recordSelected As Boolean
> Dim showSearch As Boolean = False
> Dim whereClause As String = "JobNum = '" + job + "'"
> Dim dsJobInfo As DataSet = SearchFunctions.listLookup(TimePhasForm, "JobAsmSearchAdapter", recordSelected, showSearch, whereClause)
> If recordSelected Then
> parentPart = dsJobInfo.Tables(0).Rows(0)("PartNum").ToString()
> Else
> parentPart = ""
> End If
>
> Return parentPart
> End Function
>
> End Module
>
> --- In vantage@yahoogroups.com, "aman" <aman_deep21@> wrote:
> >
> > Hi
> >
> > I am trying to add a new column to a grid view and came across this post. Can someone please help me through this if they have cracked it?
> >
> > Aman
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > Damn !, I understand the logic there but I agree that's VERY painfull.
> > >
> > > Did you carry on with your potential customisation or scrap it once you found this out ?.
> > >
> > > Thanks.
> > >
> > > --- In vantage@yahoogroups.com, "Thomas, Lynn A." <thomasl@> wrote:
> > > >
> > > > You can't add a column to an existing grid view. I've covered this exact same ground with tech support already, a few months ago. What you have to do is recreate the data view, and add the column[s] you need. Hide the existing grid and replace it with one displaying your custom view data.
> > > >
> > > > Painful, but that's what they told me.
> > > >
> > > > Lynn Thomas
> > > > Senior Engineer
> > > > SAIC
> > > > 317-357-4041 X255
> > > >
> > > >
> > > >
> > > > [Non-text portions of this message have been removed]
> > > >
> > >
> >
>
Hi,

I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.

Do I need to use code to add a new column ?.

Thanks.
I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.

Thanks.

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> Hi,
>
> I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
>
> Do I need to use code to add a new column ?.
>
> Thanks.
>
Hi,

Just a last call to see if anyone is able to help at all as I'm stumped.

I'll try Epicor as well but they'll just bounce me to consulting :(

Thanks.

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
>
> Thanks.
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > Hi,
> >
> > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> >
> > Do I need to use code to add a new column ?.
> >
> > Thanks.
> >
>
Did you not receive the email I sent you off-list last Friday?

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> Hi,
>
> Just a last call to see if anyone is able to help at all as I'm stumped.
>
> I'll try Epicor as well but they'll just bounce me to consulting :(
>
> Thanks.
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> >
> > Thanks.
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > Hi,
> > >
> > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > >
> > > Do I need to use code to add a new column ?.
> > >
> > > Thanks.
> > >
> >
>
You can't add a column to an existing grid view. I've covered this exact same ground with tech support already, a few months ago. What you have to do is recreate the data view, and add the column[s] you need. Hide the existing grid and replace it with one displaying your custom view data.

Painful, but that's what they told me.

Lynn Thomas
Senior Engineer
SAIC
317-357-4041 X255



[Non-text portions of this message have been removed]
Damn !, I understand the logic there but I agree that's VERY painfull.

Did you carry on with your potential customisation or scrap it once you found this out ?.

Thanks.

--- In vantage@yahoogroups.com, "Thomas, Lynn A." <thomasl@...> wrote:
>
> You can't add a column to an existing grid view. I've covered this exact same ground with tech support already, a few months ago. What you have to do is recreate the data view, and add the column[s] you need. Hide the existing grid and replace it with one displaying your custom view data.
>
> Painful, but that's what they told me.
>
> Lynn Thomas
> Senior Engineer
> SAIC
> 317-357-4041 X255
>
>
>
> [Non-text portions of this message have been removed]
>
I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.

I really appreciate your help :)

--- In vantage@yahoogroups.com, "bw2868bond" <bwalker@...> wrote:
>
> Did you not receive the email I sent you off-list last Friday?
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > Hi,
> >
> > Just a last call to see if anyone is able to help at all as I'm stumped.
> >
> > I'll try Epicor as well but they'll just bounce me to consulting :(
> >
> > Thanks.
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > >
> > > Thanks.
> > >
> > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > >
> > > > Do I need to use code to add a new column ?.
> > > >
> > > > Thanks.
> > > >
> > >
> >
>
I've added the code and had a little play with it, and it's exactly what I'm after, thank you so much !.

I need to play around with it and point it to a different data source and see what occurs.

I know I'm being rude asking for more, sorry, but would you be aware of how to add the new column to the begining of the grid rather than at the end, and possibly highlight the grid's row based on the value of the new column (which would be a check box for so would have a true or false value ?).

Thanks :)

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.
>
> I really appreciate your help :)
>
> --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> >
> > Did you not receive the email I sent you off-list last Friday?
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > Hi,
> > >
> > > Just a last call to see if anyone is able to help at all as I'm stumped.
> > >
> > > I'll try Epicor as well but they'll just bounce me to consulting :(
> > >
> > > Thanks.
> > >
> > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > >
> > > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > > >
> > > > Thanks.
> > > >
> > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > > >
> > > > > Do I need to use code to add a new column ?.
> > > > >
> > > > > Thanks.
> > > > >
> > > >
> > >
> >
>
After you have added your 'custom column' to the dataview you can move the column position to wherever you want and save the layout - it is tricky and things have to be done in the correct order. The layout of the grid columns is stored in a really ugly bit of xml code (in fact the entire customization is ugly xml code)

If you always want it to be in specific position, then I believe it is possible to specify that in the initialize row event of the epiultragrid - in fact that is the same event you would use to colorize (hilight) a row based upon some value.

I posted some code to do that a good while ago - let me know if you can't find that post and I will see if I can dig it up

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> I've added the code and had a little play with it, and it's exactly what I'm after, thank you so much !.
>
> I need to play around with it and point it to a different data source and see what occurs.
>
> I know I'm being rude asking for more, sorry, but would you be aware of how to add the new column to the begining of the grid rather than at the end, and possibly highlight the grid's row based on the value of the new column (which would be a check box for so would have a true or false value ?).
>
> Thanks :)
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.
> >
> > I really appreciate your help :)
> >
> > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > >
> > > Did you not receive the email I sent you off-list last Friday?
> > >
> > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > >
> > > > Hi,
> > > >
> > > > Just a last call to see if anyone is able to help at all as I'm stumped.
> > > >
> > > > I'll try Epicor as well but they'll just bounce me to consulting :(
> > > >
> > > > Thanks.
> > > >
> > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > >
> > > > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > > > >
> > > > > Thanks.
> > > > >
> > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > > > >
> > > > > > Do I need to use code to add a new column ?.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > >
> > > >
> > >
> >
>
Hi,

I've found your post...

http://tech.groups.yahoo.com/group/vantage/message/64610

... and an article on the Infragistics website...

http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1102

... which I'll have to take a good look at now that I'm aware of it :)

Regarding the link to your post above I'm not familiar with the procedure you decribe for using the Event Wizard to create the code ?.

Thanks.

--- In vantage@yahoogroups.com, "bw2868bond" <bwalker@...> wrote:
>
> After you have added your 'custom column' to the dataview you can move the column position to wherever you want and save the layout - it is tricky and things have to be done in the correct order. The layout of the grid columns is stored in a really ugly bit of xml code (in fact the entire customization is ugly xml code)
>
> If you always want it to be in specific position, then I believe it is possible to specify that in the initialize row event of the epiultragrid - in fact that is the same event you would use to colorize (hilight) a row based upon some value.
>
> I posted some code to do that a good while ago - let me know if you can't find that post and I will see if I can dig it up
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > I've added the code and had a little play with it, and it's exactly what I'm after, thank you so much !.
> >
> > I need to play around with it and point it to a different data source and see what occurs.
> >
> > I know I'm being rude asking for more, sorry, but would you be aware of how to add the new column to the begining of the grid rather than at the end, and possibly highlight the grid's row based on the value of the new column (which would be a check box for so would have a true or false value ?).
> >
> > Thanks :)
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.
> > >
> > > I really appreciate your help :)
> > >
> > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > >
> > > > Did you not receive the email I sent you off-list last Friday?
> > > >
> > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > Just a last call to see if anyone is able to help at all as I'm stumped.
> > > > >
> > > > > I'll try Epicor as well but they'll just bounce me to consulting :(
> > > > >
> > > > > Thanks.
> > > > >
> > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > >
> > > > > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > > > > >
> > > > > > > Do I need to use code to add a new column ?.
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
I've sent an e-mail to your Yahoo adress with the tweaked code, however, it throws up a few errors :(

Thanks.

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> Hi,
>
> I've found your post...
>
> http://tech.groups.yahoo.com/group/vantage/message/64610
>
> ... and an article on the Infragistics website...
>
> http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1102
>
> ... which I'll have to take a good look at now that I'm aware of it :)
>
> Regarding the link to your post above I'm not familiar with the procedure you decribe for using the Event Wizard to create the code ?.
>
> Thanks.
>
> --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> >
> > After you have added your 'custom column' to the dataview you can move the column position to wherever you want and save the layout - it is tricky and things have to be done in the correct order. The layout of the grid columns is stored in a really ugly bit of xml code (in fact the entire customization is ugly xml code)
> >
> > If you always want it to be in specific position, then I believe it is possible to specify that in the initialize row event of the epiultragrid - in fact that is the same event you would use to colorize (hilight) a row based upon some value.
> >
> > I posted some code to do that a good while ago - let me know if you can't find that post and I will see if I can dig it up
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > I've added the code and had a little play with it, and it's exactly what I'm after, thank you so much !.
> > >
> > > I need to play around with it and point it to a different data source and see what occurs.
> > >
> > > I know I'm being rude asking for more, sorry, but would you be aware of how to add the new column to the begining of the grid rather than at the end, and possibly highlight the grid's row based on the value of the new column (which would be a check box for so would have a true or false value ?).
> > >
> > > Thanks :)
> > >
> > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > >
> > > > I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.
> > > >
> > > > I really appreciate your help :)
> > > >
> > > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > > >
> > > > > Did you not receive the email I sent you off-list last Friday?
> > > > >
> > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Just a last call to see if anyone is able to help at all as I'm stumped.
> > > > > >
> > > > > > I'll try Epicor as well but they'll just bounce me to consulting :(
> > > > > >
> > > > > > Thanks.
> > > > > >
> > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > >
> > > > > > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > > > > > >
> > > > > > > > Do I need to use code to add a new column ?.
> > > > > > > >
> > > > > > > > Thanks.
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
I've added the following line into the code that removes the error...

Private WithEvents eugPendingReceiptLines As EpiUltraGrid

... however the line in the grid doesn't get coloured differently though :(

Thanks.

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> I've sent an e-mail to your Yahoo adress with the tweaked code, however, it throws up a few errors :(
>
> Thanks.
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > Hi,
> >
> > I've found your post...
> >
> > http://tech.groups.yahoo.com/group/vantage/message/64610
> >
> > ... and an article on the Infragistics website...
> >
> > http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1102
> >
> > ... which I'll have to take a good look at now that I'm aware of it :)
> >
> > Regarding the link to your post above I'm not familiar with the procedure you decribe for using the Event Wizard to create the code ?.
> >
> > Thanks.
> >
> > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > >
> > > After you have added your 'custom column' to the dataview you can move the column position to wherever you want and save the layout - it is tricky and things have to be done in the correct order. The layout of the grid columns is stored in a really ugly bit of xml code (in fact the entire customization is ugly xml code)
> > >
> > > If you always want it to be in specific position, then I believe it is possible to specify that in the initialize row event of the epiultragrid - in fact that is the same event you would use to colorize (hilight) a row based upon some value.
> > >
> > > I posted some code to do that a good while ago - let me know if you can't find that post and I will see if I can dig it up
> > >
> > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > >
> > > > I've added the code and had a little play with it, and it's exactly what I'm after, thank you so much !.
> > > >
> > > > I need to play around with it and point it to a different data source and see what occurs.
> > > >
> > > > I know I'm being rude asking for more, sorry, but would you be aware of how to add the new column to the begining of the grid rather than at the end, and possibly highlight the grid's row based on the value of the new column (which would be a check box for so would have a true or false value ?).
> > > >
> > > > Thanks :)
> > > >
> > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > >
> > > > > I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.
> > > > >
> > > > > I really appreciate your help :)
> > > > >
> > > > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > > > >
> > > > > > Did you not receive the email I sent you off-list last Friday?
> > > > > >
> > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > Just a last call to see if anyone is able to help at all as I'm stumped.
> > > > > > >
> > > > > > > I'll try Epicor as well but they'll just bounce me to consulting :(
> > > > > > >
> > > > > > > Thanks.
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > >
> > > > > > > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > > > > > > >
> > > > > > > > Thanks.
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > > > > > > >
> > > > > > > > > Do I need to use code to add a new column ?.
> > > > > > > > >
> > > > > > > > > Thanks.
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
You also need to have the EpiUltraGrid you refer to in your code get linked to the actual grid in the form. This is done in the Form Load event.

Private Sub ReceiptEntryForm_Load(ByVal sender As object, ByVal args As EventArgs) Handles ReceiptEntryForm.Load
'//
'// Add Event Handler Code
'//
eugPendingReceiptLines = CType(csm.GetNativeControlReference("c6c0cd19-19eb-4014-81fc-54b32395513b"), EpiUltraGrid)
End Sub

Give that a go.
Good Luck - bw

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> I've added the following line into the code that removes the error...
>
> Private WithEvents eugPendingReceiptLines As EpiUltraGrid
>
> ... however the line in the grid doesn't get coloured differently though :(
>
> Thanks.
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > I've sent an e-mail to your Yahoo adress with the tweaked code, however, it throws up a few errors :(
> >
> > Thanks.
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > Hi,
> > >
> > > I've found your post...
> > >
> > > http://tech.groups.yahoo.com/group/vantage/message/64610
> > >
> > > ... and an article on the Infragistics website...
> > >
> > > http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1102
> > >
> > > ... which I'll have to take a good look at now that I'm aware of it :)
> > >
> > > Regarding the link to your post above I'm not familiar with the procedure you decribe for using the Event Wizard to create the code ?.
> > >
> > > Thanks.
> > >
> > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > >
> > > > After you have added your 'custom column' to the dataview you can move the column position to wherever you want and save the layout - it is tricky and things have to be done in the correct order. The layout of the grid columns is stored in a really ugly bit of xml code (in fact the entire customization is ugly xml code)
> > > >
> > > > If you always want it to be in specific position, then I believe it is possible to specify that in the initialize row event of the epiultragrid - in fact that is the same event you would use to colorize (hilight) a row based upon some value.
> > > >
> > > > I posted some code to do that a good while ago - let me know if you can't find that post and I will see if I can dig it up
> > > >
> > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > >
> > > > > I've added the code and had a little play with it, and it's exactly what I'm after, thank you so much !.
> > > > >
> > > > > I need to play around with it and point it to a different data source and see what occurs.
> > > > >
> > > > > I know I'm being rude asking for more, sorry, but would you be aware of how to add the new column to the begining of the grid rather than at the end, and possibly highlight the grid's row based on the value of the new column (which would be a check box for so would have a true or false value ?).
> > > > >
> > > > > Thanks :)
> > > > >
> > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > >
> > > > > > I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.
> > > > > >
> > > > > > I really appreciate your help :)
> > > > > >
> > > > > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > > > > >
> > > > > > > Did you not receive the email I sent you off-list last Friday?
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > >
> > > > > > > > Hi,
> > > > > > > >
> > > > > > > > Just a last call to see if anyone is able to help at all as I'm stumped.
> > > > > > > >
> > > > > > > > I'll try Epicor as well but they'll just bounce me to consulting :(
> > > > > > > >
> > > > > > > > Thanks.
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > >
> > > > > > > > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > > > > > > > >
> > > > > > > > > Thanks.
> > > > > > > > >
> > > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > > >
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > > > > > > > >
> > > > > > > > > > Do I need to use code to add a new column ?.
> > > > > > > > > >
> > > > > > > > > > Thanks.
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Brilliant !, everything works a treat now, I'm stunned at how you know all of this (I'm glad someone does). Thanks you for all of your help, you've put Epicor to shame.

One final thing and then I'll leave you in peace, as this new column has been added via code how do I set it's caption / heading when you view the grid in the Vantage program ? (I've seen other snippets of code but can't get them to work).

Thanks.

--- In vantage@yahoogroups.com, "bw2868bond" <bwalker@...> wrote:
>
> You also need to have the EpiUltraGrid you refer to in your code get linked to the actual grid in the form. This is done in the Form Load event.
>
> Private Sub ReceiptEntryForm_Load(ByVal sender As object, ByVal args As EventArgs) Handles ReceiptEntryForm.Load
> '//
> '// Add Event Handler Code
> '//
> eugPendingReceiptLines = CType(csm.GetNativeControlReference("c6c0cd19-19eb-4014-81fc-54b32395513b"), EpiUltraGrid)
> End Sub
>
> Give that a go.
> Good Luck - bw
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > I've added the following line into the code that removes the error...
> >
> > Private WithEvents eugPendingReceiptLines As EpiUltraGrid
> >
> > ... however the line in the grid doesn't get coloured differently though :(
> >
> > Thanks.
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > I've sent an e-mail to your Yahoo adress with the tweaked code, however, it throws up a few errors :(
> > >
> > > Thanks.
> > >
> > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > >
> > > > Hi,
> > > >
> > > > I've found your post...
> > > >
> > > > http://tech.groups.yahoo.com/group/vantage/message/64610
> > > >
> > > > ... and an article on the Infragistics website...
> > > >
> > > > http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1102
> > > >
> > > > ... which I'll have to take a good look at now that I'm aware of it :)
> > > >
> > > > Regarding the link to your post above I'm not familiar with the procedure you decribe for using the Event Wizard to create the code ?.
> > > >
> > > > Thanks.
> > > >
> > > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > > >
> > > > > After you have added your 'custom column' to the dataview you can move the column position to wherever you want and save the layout - it is tricky and things have to be done in the correct order. The layout of the grid columns is stored in a really ugly bit of xml code (in fact the entire customization is ugly xml code)
> > > > >
> > > > > If you always want it to be in specific position, then I believe it is possible to specify that in the initialize row event of the epiultragrid - in fact that is the same event you would use to colorize (hilight) a row based upon some value.
> > > > >
> > > > > I posted some code to do that a good while ago - let me know if you can't find that post and I will see if I can dig it up
> > > > >
> > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > >
> > > > > > I've added the code and had a little play with it, and it's exactly what I'm after, thank you so much !.
> > > > > >
> > > > > > I need to play around with it and point it to a different data source and see what occurs.
> > > > > >
> > > > > > I know I'm being rude asking for more, sorry, but would you be aware of how to add the new column to the begining of the grid rather than at the end, and possibly highlight the grid's row based on the value of the new column (which would be a check box for so would have a true or false value ?).
> > > > > >
> > > > > > Thanks :)
> > > > > >
> > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > >
> > > > > > > I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.
> > > > > > >
> > > > > > > I really appreciate your help :)
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > > > > > >
> > > > > > > > Did you not receive the email I sent you off-list last Friday?
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > >
> > > > > > > > > Hi,
> > > > > > > > >
> > > > > > > > > Just a last call to see if anyone is able to help at all as I'm stumped.
> > > > > > > > >
> > > > > > > > > I'll try Epicor as well but they'll just bounce me to consulting :(
> > > > > > > > >
> > > > > > > > > Thanks.
> > > > > > > > >
> > > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > > >
> > > > > > > > > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > > > > > > > > >
> > > > > > > > > > Thanks.
> > > > > > > > > >
> > > > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > > > >
> > > > > > > > > > > Hi,
> > > > > > > > > > >
> > > > > > > > > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > > > > > > > > >
> > > > > > > > > > > Do I need to use code to add a new column ?.
> > > > > > > > > > >
> > > > > > > > > > > Thanks.
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
I know what I know thanks to a lot of people who help each other on this group.....

When you do the .......Columns.Add("xyz") what ever you put inside the quotes becomes the display name / caption / heading as well as how you refer to it in code - far easier to add it how you want it to appear

Cheers.

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> Brilliant !, everything works a treat now, I'm stunned at how you know all of this (I'm glad someone does). Thanks you for all of your help, you've put Epicor to shame.
>
> One final thing and then I'll leave you in peace, as this new column has been added via code how do I set it's caption / heading when you view the grid in the Vantage program ? (I've seen other snippets of code but can't get them to work).
>
> Thanks.
>
> --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> >
> > You also need to have the EpiUltraGrid you refer to in your code get linked to the actual grid in the form. This is done in the Form Load event.
> >
> > Private Sub ReceiptEntryForm_Load(ByVal sender As object, ByVal args As EventArgs) Handles ReceiptEntryForm.Load
> > '//
> > '// Add Event Handler Code
> > '//
> > eugPendingReceiptLines = CType(csm.GetNativeControlReference("c6c0cd19-19eb-4014-81fc-54b32395513b"), EpiUltraGrid)
> > End Sub
> >
> > Give that a go.
> > Good Luck - bw
> >
> > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > >
> > > I've added the following line into the code that removes the error...
> > >
> > > Private WithEvents eugPendingReceiptLines As EpiUltraGrid
> > >
> > > ... however the line in the grid doesn't get coloured differently though :(
> > >
> > > Thanks.
> > >
> > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > >
> > > > I've sent an e-mail to your Yahoo adress with the tweaked code, however, it throws up a few errors :(
> > > >
> > > > Thanks.
> > > >
> > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > I've found your post...
> > > > >
> > > > > http://tech.groups.yahoo.com/group/vantage/message/64610
> > > > >
> > > > > ... and an article on the Infragistics website...
> > > > >
> > > > > http://devcenter.infragistics.com/Support/KnowledgeBaseArticle.Aspx?ArticleID=1102
> > > > >
> > > > > ... which I'll have to take a good look at now that I'm aware of it :)
> > > > >
> > > > > Regarding the link to your post above I'm not familiar with the procedure you decribe for using the Event Wizard to create the code ?.
> > > > >
> > > > > Thanks.
> > > > >
> > > > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > > > >
> > > > > > After you have added your 'custom column' to the dataview you can move the column position to wherever you want and save the layout - it is tricky and things have to be done in the correct order. The layout of the grid columns is stored in a really ugly bit of xml code (in fact the entire customization is ugly xml code)
> > > > > >
> > > > > > If you always want it to be in specific position, then I believe it is possible to specify that in the initialize row event of the epiultragrid - in fact that is the same event you would use to colorize (hilight) a row based upon some value.
> > > > > >
> > > > > > I posted some code to do that a good while ago - let me know if you can't find that post and I will see if I can dig it up
> > > > > >
> > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > >
> > > > > > > I've added the code and had a little play with it, and it's exactly what I'm after, thank you so much !.
> > > > > > >
> > > > > > > I need to play around with it and point it to a different data source and see what occurs.
> > > > > > >
> > > > > > > I know I'm being rude asking for more, sorry, but would you be aware of how to add the new column to the begining of the grid rather than at the end, and possibly highlight the grid's row based on the value of the new column (which would be a check box for so would have a true or false value ?).
> > > > > > >
> > > > > > > Thanks :)
> > > > > > >
> > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > >
> > > > > > > > I'm afraid that I don't regularly check that Yahoo e-mail account, but I'm looking at it now and will get back to you asap.
> > > > > > > >
> > > > > > > > I really appreciate your help :)
> > > > > > > >
> > > > > > > > --- In vantage@yahoogroups.com, "bw2868bond" <bwalker@> wrote:
> > > > > > > > >
> > > > > > > > > Did you not receive the email I sent you off-list last Friday?
> > > > > > > > >
> > > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > > >
> > > > > > > > > > Hi,
> > > > > > > > > >
> > > > > > > > > > Just a last call to see if anyone is able to help at all as I'm stumped.
> > > > > > > > > >
> > > > > > > > > > I'll try Epicor as well but they'll just bounce me to consulting :(
> > > > > > > > > >
> > > > > > > > > > Thanks.
> > > > > > > > > >
> > > > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > > > >
> > > > > > > > > > > I forgot to mention that this new column is not one of the hidden columns allready there, it will be from a different table, so I understand that a foreign key view may need to be created but it's how I get that data into the existing grid view ?.
> > > > > > > > > > >
> > > > > > > > > > > Thanks.
> > > > > > > > > > >
> > > > > > > > > > > --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> > > > > > > > > > > >
> > > > > > > > > > > > Hi,
> > > > > > > > > > > >
> > > > > > > > > > > > I'd like to try a customisation where I need to add some new coluns to a grid view (the pending receive grid view on Receipt Entry), however, looking at the 'Epicor Tools User Guide' I see nothing on this subject.
> > > > > > > > > > > >
> > > > > > > > > > > > Do I need to use code to add a new column ?.
> > > > > > > > > > > >
> > > > > > > > > > > > Thanks.
> > > > > > > > > > > >
> > > > > > > > > > >
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>
Hi

I am trying to add a new column to a grid view and came across this post. Can someone please help me through this if they have cracked it?

Aman

--- In vantage@yahoogroups.com, "clive.1972" <clive.1972@...> wrote:
>
> Damn !, I understand the logic there but I agree that's VERY painfull.
>
> Did you carry on with your potential customisation or scrap it once you found this out ?.
>
> Thanks.
>
> --- In vantage@yahoogroups.com, "Thomas, Lynn A." <thomasl@> wrote:
> >
> > You can't add a column to an existing grid view. I've covered this exact same ground with tech support already, a few months ago. What you have to do is recreate the data view, and add the column[s] you need. Hide the existing grid and replace it with one displaying your custom view data.
> >
> > Painful, but that's what they told me.
> >
> > Lynn Thomas
> > Senior Engineer
> > SAIC
> > 317-357-4041 X255
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
>
As I have posted a couple times before - here is code for adding Parent Part to Time Phase grid:

Module Script


'// ** Wizard Insert Location - Do Not Remove 'Begin/End Wizard Added Module Level Variables' Comments! **
'// Begin Wizard Added Module Level Variables **

Private WithEvents edvTimePhas As EpiDataView
'// End Wizard Added Module Level Variables **


'// Add Custom Module Level Variables Here **



Sub InitializeCustomCode()


'// ** Wizard Insert Location - Do not delete 'Begin/End Wizard Added Variable Intialization' lines **
'// Begin Wizard Added Variable Intialization

edvTimePhas = CType(oTrans.EpiDataViews("TimePhas"), EpiDataView)
'// End Wizard Added Variable Intialization
'// Begin Custom Method Calls
If Not (edvTimePhas.dataView.Table.Columns.Contains("ParentPart")) Then
edvTimePhas.dataView.Table.Columns.Add(new DataColumn("ParentPart"))
End If
'// End Custom Method Calls
End Sub

Private Sub edvTimePhas_EpiViewNotification(view As EpiDataView, args As EpiNotifyArgs) Handles edvTimePhas.EpiViewNotification
'// ** Argument Properties and Uses **
'// view.dataView(args.Row)("[FieldName]")
'// args.Row, args.Column, args.Sender, args.NotifyType
'// NotifyType.Initialize, NotifyType.AddRow, NotifyType.DeleteRow, NotifyType.InitLastView, NotifyType.InitAndResetTreeNodes
If (args.NotifyType = EpiTransaction.NotifyType.Initialize) Then
If (args.Row > -1) Then
AddParentPart()
End If
End If
End Sub

Private Sub AddParentPart()
For Each dr As DataRow In edvTimePhas.dataView.Table.Rows
If Not IsDBNull(dr("JobNum")) Then
dr("ParentPart") = getParentPart(dr("JobNum"))
End If
Next
End Sub

Private Function getParentPart(ByVal job As String) As String
Dim parentPart As String
Dim recordSelected As Boolean
Dim showSearch As Boolean = False
Dim whereClause As String = "JobNum = '" + job + "'"
Dim dsJobInfo As DataSet = SearchFunctions.listLookup(TimePhasForm, "JobAsmSearchAdapter", recordSelected, showSearch, whereClause)
If recordSelected Then
parentPart = dsJobInfo.Tables(0).Rows(0)("PartNum").ToString()
Else
parentPart = ""
End If

Return parentPart
End Function

End Module

--- In vantage@yahoogroups.com, "aman" <aman_deep21@...> wrote:
>
> Hi
>
> I am trying to add a new column to a grid view and came across this post. Can someone please help me through this if they have cracked it?
>
> Aman
>
> --- In vantage@yahoogroups.com, "clive.1972" <clive.1972@> wrote:
> >
> > Damn !, I understand the logic there but I agree that's VERY painfull.
> >
> > Did you carry on with your potential customisation or scrap it once you found this out ?.
> >
> > Thanks.
> >
> > --- In vantage@yahoogroups.com, "Thomas, Lynn A." <thomasl@> wrote:
> > >
> > > You can't add a column to an existing grid view. I've covered this exact same ground with tech support already, a few months ago. What you have to do is recreate the data view, and add the column[s] you need. Hide the existing grid and replace it with one displaying your custom view data.
> > >
> > > Painful, but that's what they told me.
> > >
> > > Lynn Thomas
> > > Senior Engineer
> > > SAIC
> > > 317-357-4041 X255
> > >
> > >
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
>