Grid Grouping Control ColumnHeaders
hi
i use Grid Grouping Control Relations to show invoice head and invoice details no problim to show them but but here in egypt we use arabic appliction interfaces so i want to change ColumnHeaders .text for Parents and change ColumnHeaders .text for Child
and my conect code:
===========================
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "\databind.mdb")
Dim cmd As New OleDbCommand()
Dim da As New OleDbDataAdapter()
Dim ds As New DataSet()
con.Open()
With cmd
.Connection = con
.CommandType = CommandType.TableDirect
.CommandText = "select * from Categories"
End With
da.SelectCommand = cmd
da.Fill(ds, "Categories")
GridGroupingControl1.DataSource = ds.Tables(0)
==================================================
how can i do that by code
change ColumnHeaders .text for Parents and change ColumnHeaders .text for Child
i use Grid Grouping Control Relations to show invoice head and invoice details no problim to show them but but here in egypt we use arabic appliction interfaces so i want to change ColumnHeaders .text for Parents and change ColumnHeaders .text for Child
and my conect code:
===========================
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "\databind.mdb")
Dim cmd As New OleDbCommand()
Dim da As New OleDbDataAdapter()
Dim ds As New DataSet()
con.Open()
With cmd
.Connection = con
.CommandType = CommandType.TableDirect
.CommandText = "select * from Categories"
End With
da.SelectCommand = cmd
da.Fill(ds, "Categories")
GridGroupingControl1.DataSource = ds.Tables(0)
==================================================
how can i do that by code
change ColumnHeaders .text for Parents and change ColumnHeaders .text for Child
SIGN IN To post a reply.
4 Replies
RE
reda
October 13, 2009 07:41 PM UTC
any reply
JJ
Jisha Joy
Syncfusion Team
October 14, 2009 11:12 AM UTC
Hi,
You could use the HeaderText property to achieve the desired behavior. See the code:
//Parent table
this.gridGroupingControl1.TableDescriptor.Columns["oldname"].HeaderText = "NewName";
//For the child table
this.gridGroupingControl1.GetTableDescriptor("ChildTableName").Columns["oldname"].HeaderText = "NewName";
Please let me know if this helps.
Regards,
Jisha
You could use the HeaderText property to achieve the desired behavior. See the code:
//Parent table
this.gridGroupingControl1.TableDescriptor.Columns["oldname"].HeaderText = "NewName";
//For the child table
this.gridGroupingControl1.GetTableDescriptor("ChildTableName").Columns["oldname"].HeaderText = "NewName";
Please let me know if this helps.
Regards,
Jisha
RE
reda
October 17, 2009 11:38 AM UTC
thank u it works to change the caption of ColumnHeaders
------------------------------------------
but when i use filter to look for a record give me error
================================================
thats my code
==============
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "\databind.mdb")
Dim cmd As New OleDbCommand()
Dim da As New OleDbDataAdapter()
Dim ds As New DataSet()
Dim dt As DataTable
con.Open()
With cmd
.Connection = con
.CommandType = CommandType.TableDirect
.CommandText = "select * from Categories where(Categories.CategoryID=" & textbox1.text & ")"
End With
da.SelectCommand = cmd
da.Fill(ds, "Categories")
cmd.CommandText = "select * from Products"
da.SelectCommand = cmd
da.Fill(ds, "Products")
'cmd.CommandText = "Inventory Transactions"
'da.SelectCommand = cmd
'da.Fill(ds, "Inventory Transactions")
ds.Relations.Add("Root", ds.Tables("Categories").Columns("CategoryID"), ds.Tables("Products").Columns("CategoryID"))
'ds.Relations.Add("Secondary", ds.Tables("Products").Columns("ProductID"), ds.Tables("Inventory Transactions").Columns("TransactionID"))
gridGroupingControl1.DataSource = ds.Tables(0)
also i use the same code to farpoint spread to show grouing and word will
pl tell how to correct that code to work with gcc i want to filter the records by textbox
------------------------------------------
but when i use filter to look for a record give me error
================================================
thats my code
==============
Dim con As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Application.StartupPath & "\databind.mdb")
Dim cmd As New OleDbCommand()
Dim da As New OleDbDataAdapter()
Dim ds As New DataSet()
Dim dt As DataTable
con.Open()
With cmd
.Connection = con
.CommandType = CommandType.TableDirect
.CommandText = "select * from Categories where(Categories.CategoryID=" & textbox1.text & ")"
End With
da.SelectCommand = cmd
da.Fill(ds, "Categories")
cmd.CommandText = "select * from Products"
da.SelectCommand = cmd
da.Fill(ds, "Products")
'cmd.CommandText = "Inventory Transactions"
'da.SelectCommand = cmd
'da.Fill(ds, "Inventory Transactions")
ds.Relations.Add("Root", ds.Tables("Categories").Columns("CategoryID"), ds.Tables("Products").Columns("CategoryID"))
'ds.Relations.Add("Secondary", ds.Tables("Products").Columns("ProductID"), ds.Tables("Inventory Transactions").Columns("TransactionID"))
gridGroupingControl1.DataSource = ds.Tables(0)
also i use the same code to farpoint spread to show grouing and word will
pl tell how to correct that code to work with gcc i want to filter the records by textbox
JJ
Jisha Joy
Syncfusion Team
October 19, 2009 07:19 AM UTC
Hi Reda,
Please refer the following forum that describes textbox filtering using RecordFilters of GridGroupingControl.
http://www.syncfusion.com/support/forums/grid-windows/73569
Please let me know if you have any questions.
Regards,
Jisha
Please refer the following forum that describes textbox filtering using RecordFilters of GridGroupingControl.
http://www.syncfusion.com/support/forums/grid-windows/73569
Please let me know if you have any questions.
Regards,
Jisha
SIGN IN To post a reply.
- 4 Replies
- 2 Participants
-
RE reda
- Oct 13, 2009 01:47 PM UTC
- Oct 19, 2009 07:19 AM UTC