B
Brent Jenny
I am a veteran asp 3.0 coder and I need some help with a datagrid
problem. I am trying to parse some text in a datafield for display.
In the past I would simply loop through a dataset(recordset) and have
access to the data values at write time so that I could parse on the
fly. Now I am using a bound DatGrid and I am not sure what to do. My
code looks like this:
public void CreateGrid(){
//declare a new datagrid and set properties
DataGrid DataGrid1 = new DataGrid();
DataGrid1.BorderWidth = Unit.Pixel(2);
DataGrid1.CellPadding = 10;
DataGrid1.GridLines = GridLines.Both;
DataGrid1.BorderColor = Color.Blue;
DataGrid1.ShowHeader = true;
DataGrid1.AutoGenerateColumns = false;
DataGrid1.SelectedItemStyle.BackColor = Color.Yellow;
//add bound columns to the datagrid
BoundColumn datagridcol = new BoundColumn();
datagridcol.HeaderText = "Description";
datagridcol.DataField = "desc";
DataGrid1.Columns.Add(datagridcol);
datagridcol = new BoundColumn();
datagridcol.HeaderText = "M&E P/N";
datagridcol.DataField = "mne_number";
DataGrid1.Columns.Add(datagridcol);
//bind datagrid
DataGrid1.DataSource = GetDataSet();
DataGrid1.DataBind();
}
I want to limit the description field to 25 characters and insert some
dashes into the mne_number. I know it would be best to do this in the
stored procedure but it was written by someone else and I don't have
access.
signed,
Feeling like a newby again
problem. I am trying to parse some text in a datafield for display.
In the past I would simply loop through a dataset(recordset) and have
access to the data values at write time so that I could parse on the
fly. Now I am using a bound DatGrid and I am not sure what to do. My
code looks like this:
public void CreateGrid(){
//declare a new datagrid and set properties
DataGrid DataGrid1 = new DataGrid();
DataGrid1.BorderWidth = Unit.Pixel(2);
DataGrid1.CellPadding = 10;
DataGrid1.GridLines = GridLines.Both;
DataGrid1.BorderColor = Color.Blue;
DataGrid1.ShowHeader = true;
DataGrid1.AutoGenerateColumns = false;
DataGrid1.SelectedItemStyle.BackColor = Color.Yellow;
//add bound columns to the datagrid
BoundColumn datagridcol = new BoundColumn();
datagridcol.HeaderText = "Description";
datagridcol.DataField = "desc";
DataGrid1.Columns.Add(datagridcol);
datagridcol = new BoundColumn();
datagridcol.HeaderText = "M&E P/N";
datagridcol.DataField = "mne_number";
DataGrid1.Columns.Add(datagridcol);
//bind datagrid
DataGrid1.DataSource = GetDataSet();
DataGrid1.DataBind();
}
I want to limit the description field to 25 characters and insert some
dashes into the mne_number. I know it would be best to do this in the
stored procedure but it was written by someone else and I don't have
access.
signed,
Feeling like a newby again