K
kk
I have 2 issues, please help !
1st issue :
--------------------------------------------------------
Loading Grid
------------
1) creating new rows in a datatable and adding data a
array list to datatable.
ArrayList arrData = new ArrayList();
arrData = Employee.GetAll();
DataTable dt = new DataTable();
DataRow dr = new DataRow();
for(i=0; i< arrData.Count; i++)
{
dr = dt.NewRow();
dr["Age"] = ((Employee)arrData).Age;
dr["Name"] = ((Employee)arrData).Name;
dr["Object"] = arrData;
}
2) From datatable populating the grid
Total time taken for this is 40 secs.
Grid.DataSource = dt;
Clicking on tabs at runtime with grids in each tab
--------------------------------------------------
3) Even though the grid is loaded with data, it takes
full 20 secs for the grid to show on each tab when
switching between tabs at runtime. Grid painting is
time consuming.
2nd issue:
----------------------------------------------------------
Tried the InsertAt after the data binding and it did not
work, complained that positions for items cannot be
changed. Also tried inserting before the binding,
although there were no runtime errors, the "All" entry was
overwritten by the databinding.
public static void LoadCombo(System.Windows.Forms.ComboBox
cbo, ICollection data, string display, string key)
{
ArrayList arData = (ArrayList) data;
if (arData.Count == 0)
{
cbo.DataSource = null;
}
else
{
cbo.DataSource = arData;
cbo.DisplayMember = display;
cbo.ValueMember = key;
cbo.Items.insert(0,"All"); -- Did not work
}
1st issue :
--------------------------------------------------------
Loading Grid
------------
1) creating new rows in a datatable and adding data a
array list to datatable.
ArrayList arrData = new ArrayList();
arrData = Employee.GetAll();
DataTable dt = new DataTable();
DataRow dr = new DataRow();
for(i=0; i< arrData.Count; i++)
{
dr = dt.NewRow();
dr["Age"] = ((Employee)arrData).Age;
dr["Name"] = ((Employee)arrData).Name;
dr["Object"] = arrData;
}
2) From datatable populating the grid
Total time taken for this is 40 secs.
Grid.DataSource = dt;
Clicking on tabs at runtime with grids in each tab
--------------------------------------------------
3) Even though the grid is loaded with data, it takes
full 20 secs for the grid to show on each tab when
switching between tabs at runtime. Grid painting is
time consuming.
2nd issue:
----------------------------------------------------------
Tried the InsertAt after the data binding and it did not
work, complained that positions for items cannot be
changed. Also tried inserting before the binding,
although there were no runtime errors, the "All" entry was
overwritten by the databinding.
public static void LoadCombo(System.Windows.Forms.ComboBox
cbo, ICollection data, string display, string key)
{
ArrayList arData = (ArrayList) data;
if (arData.Count == 0)
{
cbo.DataSource = null;
}
else
{
cbo.DataSource = arData;
cbo.DisplayMember = display;
cbo.ValueMember = key;
cbo.Items.insert(0,"All"); -- Did not work
}
..-----Original Message-----
first issue... don't know. send code sample.
2nd issue - after binding add a new item.
mycbobox.Items.Insert(intPosToInsertAt,"ALL")
Nick Harris, MCSD
http://www.VizSoft.net
.