on 03-13-2006 4:14 AM
Hi,Dear All
SAP table not like system.data.Datatable.
So,how can I hide a column(s)
(convert saptable to System.Data.DataTable ??)
Thanks in advance
Yi
I resolved it by myself
Dim ts As New DataGridTableStyle
Me.SapProxy11.Get_Cpu_Single("LOCAL", " ", 0, 0, 0, 0, "", 0, 0, "", 0, dstcpu)
'dst.AllowNew = False
'dst.alll = False
' DataGrid1.DataSource = dstcpu
ts.MappingName = "dstcpu"
dt = dstcpu.ToADODataTable()
'dt = DBSet.Tables(0)
Dim aColumnTextColumn As DataGridTextBoxColumn
DataGrid1.DataSource = dt
ts.MappingName = dt.TableName
Dim numCols As Integer
numCols = dt.Columns.Count
Dim i As Integer = 0
Do While (i < numCols)
aColumnTextColumn = New DataGridTextBoxColumn
aColumnTextColumn.HeaderText = dt.Columns(i).ColumnName
aColumnTextColumn.MappingName = dt.Columns(i).ColumnName
ts.PreferredColumnWidth = 100
ts.PreferredRowHeight = 20
If i = 0 Or i = 1 Or i = 2 Then
aColumnTextColumn.Width = 0
End If
ts.AlternatingBackColor = Color.LightGray
ts.GridColumnStyles.Add(aColumnTextColumn)
i = (i + 1)
Loop
Hope it can give helps to others
Yi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This is not an ideal solution.
Use DataGridTableStyle and DataGridColumnStyle directly with the SAP-Table (not ADO-Table). Set DataGridTableStyle's "MappingName" property to the name of the type of the SAP Table, e.g. "BRFCKNA1Table".
This features all nicely work directly in VS IDE, e.g. if you create an instance of the SAP Table on the designer with the "SAP Table Wizard" or if you use proxy fields. Please see the Tutorias for details.
I can not use DataGridTableStyle to make datagrid
so anybody has any ideas on this one????
Yi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
8 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.