|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
about datagrid.columns.headertext(had source code)
<i><b>Originally posted by : GuoYong (chenggy@163.net)</b></i><br />Source code<br />Dim strsql As String<br />strsql = System.Configuration.ConfigurationSettings.AppSett ings("server")<br />Dim cn As New OleDbConnection(strsql)<br />cn.Open()<br />strsql = "select cu_cust_code,cu_eng_name,cu_chn_name from e_customer where cu_center_code='" & DDL2.SelectedItem.Value & "'"<br />Dim ap As New OleDbDataAdapter(strsql, cn)<br />Dim ds As New DataSet()<br />ap.Fill(ds, "e_customer")<br />DataGrid1.DataSource = ds.Tables(0).DefaultView<br />DataGrid1.ShowHeader = True<br />DataGrid1.AllowPaging = True<br />DataGrid1.PageSize = 6<br />1 DataGrid1.Columns(0).HeaderText = "Cust. Code"<br />2 DataGrid1.Columns(1).HeaderText = "English Name"<br />3 DataGrid1.Columns(2).HeaderText = "Chinese Name"<br />DataGrid1.DataBind()<br /><br />System error message<br />line 1 error<br />index out of range<br />System.ArgumentOutOfRangeException<br /><br />why?help me please
|
|
#2
|
|||
|
|||
|
<i><b>Originally posted by : Mohammad Jamous (jamouss@hotmail.com)</b></i><br />hi there<br /><br />try to change the column header in the dataset instaed of grid like this<br />************************<br />objChannels.DS(0).Columns(0).ColumnName = "English Name"<br />*************************<br />or you can use tableStyle approach, but it need<br />some orderd code.<br /><br />by the way i can send u an example how to use TableStyle.<br /><br />------------<br />GuoYong at 5/21/2002 10:42:42 PM<br /><br />Source code<br />Dim strsql As String<br />strsql = System.Configuration.ConfigurationSettings.AppSett ings("server")<br />Dim cn As New OleDbConnection(strsql)<br />cn.Open()<br />strsql = "select cu_cust_code,cu_eng_name,cu_chn_name from e_customer where cu_center_code='" & DDL2.SelectedItem.Value & "'"<br />Dim ap As New OleDbDataAdapter(strsql, cn)<br />Dim ds As New DataSet()<br />ap.Fill(ds, "e_customer")<br />DataGrid1.DataSource = ds.Tables(0).DefaultView<br />DataGrid1.ShowHeader = True<br />DataGrid1.AllowPaging = True<br />DataGrid1.PageSize = 6<br />1 DataGrid1.Columns(0).HeaderText = "Cust. Code"<br />2 DataGrid1.Columns(1).HeaderText = "English Name"<br />3 DataGrid1.Columns(2).HeaderText = "Chinese Name"<br />DataGrid1.DataBind()<br /><br />System error message<br />line 1 error<br />index out of range<br />System.ArgumentOutOfRangeException<br /><br />why?help me please
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > about datagrid.columns.headertext(had source code) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|