Unbound datagrid view - how to rename colums?

Steve,



This is what Mike and I worked out with your example..



End If

btnStart.Visible = True



dim rowsselected as boolean

Dim txtKeyField As String = edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet = Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans, "UD21Adapter", rowsSelected, False, rowswhereClause)



ugdEpiCustom1.DataSource = dsUD21



For Each C as UltraGridColumn in ugdEpiCustom1.DisplayLayout.Bands(0).Columns

c.Hidden = TRUE

Next



ugdEpiCustom1.DisplayLayout.Bands(0).Columns("Key3").Hidden = False

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("Key4").Hidden = False

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("Key5").Hidden = False

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("Number02").Hidden = False

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("Key3").Header.Caption ="Part Number"

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("Key4").Header.Caption ="Job Number"

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("Key5").Header.Caption ="Assembly"

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("Number02").Header.Caption ="Operation"



Thanks a bunch, works great!



Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Steven Gotschall
Sent: Thursday, June 09, 2011 10:46 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] unbound datagrid view - how to rename colums?





It looks like Yahoo really mangled my email. Let me know if you need any help on the syntax.

What I would really like to be able to do is to create a dataview that Vantage recognizes so I could use that to bind datagrids and controls to it. I've never been able to figure out how to do that.

From: Rob Bucek <rbucek@... <mailto:rbucek%40dsmfg.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Thursday, June 9, 2011 10:40 AM
Subject: RE: [Vantage] unbound datagrid view - how to rename colums?


Thanks for the fast reply Steven! Ill play around with this and see what I can come up with.

Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>

From: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> ] On Behalf Of Steven Gotschall
Sent: Thursday, June 09, 2011 9:38 AM
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Subject: Re: [Vantage] unbound datagrid view - how to rename colums?

You can either rename the column in the dataset or the Header Caption on the UltraGrid. Here is an example of both.

dim rowsselected as boolean

Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)

dsUD21.Tables("UD21").Columns("UD21.Key1").ColumnName = "MyKey1Name"

ugdEpiCustom1.DataSource = dsUD21

For Each C as UltraGridColumn in ugdEpiCustom1.DisplayLayout.Bands(0).Columns
c.Hidden - TRUE
Next

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("UD21.Key2").Hidden = FalseugdEpiCustom1.DisplayLayout.Bands(0).Columns("UD21.Key2").Header.Caption ="ThisIsKey2"

I haven't tested this particular code, but it should work if you get the column names right. I use something very similar in a couple of my customizations.

From: Rob Bucek <rbucek@... <mailto:rbucek%40dsmfg.com> <mailto:rbucek%40dsmfg.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com> <mailto:vantage%40yahoogroups.com>
Sent: Thursday, June 9, 2011 10:14 AM
Subject: [Vantage] unbound datagrid view - how to rename colums?

Anyone know how to rename columns in an unbound data grid view? I have
a UD table coming in and only want 5 or 6 columns visible and assign a
specific column name. Right now, all columns come in with the original
column headers.. key1, key2 etc.. code thus far..

dim rowsselected as boolean

Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)

ugdEpiCustom1.DataSource = dsUD21

Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>

[Non-text portions of this message have been removed]

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("MyKey1Name").Hidden = False

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
Anyone know how to rename columns in an unbound data grid view? I have
a UD table coming in and only want 5 or 6 columns visible and assign a
specific column name. Right now, all columns come in with the original
column headers.. key1, key2 etc.. code thus far..





dim rowsselected as boolean

Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)

ugdEpiCustom1.DataSource = dsUD21



Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>







[Non-text portions of this message have been removed]
You can either rename the column in the dataset or the Header Caption on the UltraGrid. Here is an example of both.
Â
dim rowsselected as boolean
Â
Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")
Â
Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)
Â
UD21adapt.BOConnect
Â
dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"
Â
Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)
Â
dsUD21.Tables("UD21").Columns("UD21.Key1").ColumnName = "MyKey1Name"
Â
ugdEpiCustom1.DataSource = dsUD21
Â
For Each C as UltraGridColumn in ugdEpiCustom1.DisplayLayout.Bands(0).Columns
     c.Hidden - TRUE
Next
Â
ugdEpiCustom1.DisplayLayout.Bands(0).Columns("UD21.Key2").Hidden = FalseugdEpiCustom1.DisplayLayout.Bands(0).Columns("UD21.Key2").Header.Caption ="ThisIsKey2"
Â
I haven't tested this particular code, but it should work if you get the column names right. I use something very similar in a couple of my customizations.
Â
Â

From: Rob Bucek <rbucek@...>
To: vantage@yahoogroups.com
Sent: Thursday, June 9, 2011 10:14 AM
Subject: [Vantage] unbound datagrid view - how to rename colums?


Â
Anyone know how to rename columns in an unbound data grid view? I have
a UD table coming in and only want 5 or 6 columns visible and assign a
specific column name. Right now, all columns come in with the original
column headers.. key1, key2 etc.. code thus far..

dim rowsselected as boolean

Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)

ugdEpiCustom1.DataSource = dsUD21

Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>

[Non-text portions of this message have been removed]





ugdEpiCustom1.DisplayLayout.Bands(0).Columns("MyKey1Name").Hidden = False

[Non-text portions of this message have been removed]
Thanks for the fast reply Steven! Ill play around with this and see what I can come up with.



Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Steven Gotschall
Sent: Thursday, June 09, 2011 9:38 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] unbound datagrid view - how to rename colums?





You can either rename the column in the dataset or the Header Caption on the UltraGrid. Here is an example of both.

dim rowsselected as boolean

Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)

dsUD21.Tables("UD21").Columns("UD21.Key1").ColumnName = "MyKey1Name"

ugdEpiCustom1.DataSource = dsUD21

For Each C as UltraGridColumn in ugdEpiCustom1.DisplayLayout.Bands(0).Columns
c.Hidden - TRUE
Next

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("UD21.Key2").Hidden = FalseugdEpiCustom1.DisplayLayout.Bands(0).Columns("UD21.Key2").Header.Caption ="ThisIsKey2"

I haven't tested this particular code, but it should work if you get the column names right. I use something very similar in a couple of my customizations.



From: Rob Bucek <rbucek@... <mailto:rbucek%40dsmfg.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Thursday, June 9, 2011 10:14 AM
Subject: [Vantage] unbound datagrid view - how to rename colums?


Anyone know how to rename columns in an unbound data grid view? I have
a UD table coming in and only want 5 or 6 columns visible and assign a
specific column name. Right now, all columns come in with the original
column headers.. key1, key2 etc.. code thus far..

dim rowsselected as boolean

Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)

ugdEpiCustom1.DataSource = dsUD21

Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>

[Non-text portions of this message have been removed]

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("MyKey1Name").Hidden = False

[Non-text portions of this message have been removed]





[Non-text portions of this message have been removed]
It looks like Yahoo really mangled my email. Let me know if you need any help on the syntax.
Â
What I would really like to be able to do is to create a dataview that Vantage recognizes so I could use that to bind datagrids and controls to it. I've never been able to figure out how to do that.

From: Rob Bucek <rbucek@...>
To: vantage@yahoogroups.com
Sent: Thursday, June 9, 2011 10:40 AM
Subject: RE: [Vantage] unbound datagrid view - how to rename colums?


Â
Thanks for the fast reply Steven! Ill play around with this and see what I can come up with.



Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>





From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Steven Gotschall
Sent: Thursday, June 09, 2011 9:38 AM
To: vantage@yahoogroups.com
Subject: Re: [Vantage] unbound datagrid view - how to rename colums?





You can either rename the column in the dataset or the Header Caption on the UltraGrid. Here is an example of both.

dim rowsselected as boolean

Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)

dsUD21.Tables("UD21").Columns("UD21.Key1").ColumnName = "MyKey1Name"

ugdEpiCustom1.DataSource = dsUD21

For Each C as UltraGridColumn in ugdEpiCustom1.DisplayLayout.Bands(0).Columns
c.Hidden - TRUE
Next

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("UD21.Key2").Hidden = FalseugdEpiCustom1.DisplayLayout.Bands(0).Columns("UD21.Key2").Header.Caption ="ThisIsKey2"

I haven't tested this particular code, but it should work if you get the column names right. I use something very similar in a couple of my customizations.



From: Rob Bucek <rbucek@... <mailto:rbucek%40dsmfg.com> >
To: vantage@yahoogroups.com <mailto:vantage%40yahoogroups.com>
Sent: Thursday, June 9, 2011 10:14 AM
Subject: [Vantage] unbound datagrid view - how to rename colums?


Anyone know how to rename columns in an unbound data grid view? I have
a UD table coming in and only want 5 or 6 columns visible and assign a
specific column name. Right now, all columns come in with the original
column headers.. key1, key2 etc.. code thus far..

dim rowsselected as boolean

Dim txtKeyField As String =
edvUD07.dataView(edvUD07.Row)("Key2")

Dim UD21adapt As UD21Adapter = New UD21Adapter(UD07Form)

UD21adapt.BOConnect

dim rowswhereClause as string = "key1 = '" & txtKeyField & "'"

Dim dsUD21 As DataSet =
Epicor.Mfg.UI.FormFunctions.SearchFunctions.listLookup(oTrans,
"UD21Adapter", rowsSelected, False, rowswhereClause)

ugdEpiCustom1.DataSource = dsUD21

Rob Bucek

Production Control Manager

PH: (715) 284-5376 ext 311

Mobile: (715)896-0590

FAX: (715)284-4084

<http://www.dsmfg.com/>

(Click the logo to view our site) <http://www.dsmfg.com/>

[Non-text portions of this message have been removed]

ugdEpiCustom1.DisplayLayout.Bands(0).Columns("MyKey1Name").Hidden = False

[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]




[Non-text portions of this message have been removed]