J
J
This works well for binding a Dataset (created from an XML file) to a
DataGrid for the entire 'page' table. However I would like to only
grab a few rows from the 'page' table (like: select id, description
from page where docid = 1).
Any help would be greatly appreciated... because this datagrid thing
is kicking my ass.
Thank you,
J
-------------------------------------
dataGrid3.TableStyles.Clear();
DataGridTableStyle ts1 = new DataGridTableStyle();
ts1.MappingName = "page";
DataGridColumnStyle TextCol = new DataGridTextBoxColumn();
TextCol.MappingName = "id";
TextCol.HeaderText = "id";
TextCol.Width = 30;
TextCol.ReadOnly = true;
ts1.GridColumnStyles.Add(TextCol);
TextCol = new DataGridTextBoxColumn();
TextCol.MappingName = "DOCID";
TextCol.HeaderText = "DOCID";
TextCol.Width = 50;
TextCol.ReadOnly = false;
ts1.GridColumnStyles.Add(TextCol);
dataGrid3.SetDataBinding(pDS, "page");
dataGrid3.TableStyles.Add (ts1);
CurrencyManager cm = (CurrencyManager)BindingContext
[dataGrid1.DataSource, "page"];
DataView dv = (DataView)cm.List;
dv.AllowNew = false;
-------------------------------------
DataGrid for the entire 'page' table. However I would like to only
grab a few rows from the 'page' table (like: select id, description
from page where docid = 1).
Any help would be greatly appreciated... because this datagrid thing
is kicking my ass.
Thank you,
J
-------------------------------------
dataGrid3.TableStyles.Clear();
DataGridTableStyle ts1 = new DataGridTableStyle();
ts1.MappingName = "page";
DataGridColumnStyle TextCol = new DataGridTextBoxColumn();
TextCol.MappingName = "id";
TextCol.HeaderText = "id";
TextCol.Width = 30;
TextCol.ReadOnly = true;
ts1.GridColumnStyles.Add(TextCol);
TextCol = new DataGridTextBoxColumn();
TextCol.MappingName = "DOCID";
TextCol.HeaderText = "DOCID";
TextCol.Width = 50;
TextCol.ReadOnly = false;
ts1.GridColumnStyles.Add(TextCol);
dataGrid3.SetDataBinding(pDS, "page");
dataGrid3.TableStyles.Add (ts1);
CurrencyManager cm = (CurrencyManager)BindingContext
[dataGrid1.DataSource, "page"];
DataView dv = (DataView)cm.List;
dv.AllowNew = false;
-------------------------------------