Forum » Izdelava spletišč » Spreminjanje v DataGrid ---> .NET
Spreminjanje v DataGrid ---> .NET
dejc2 ::
Ne dela mi edit v DataGrid-u
Delam v Access bazi, kjer je tabela IGRALEC, v kateri je ime, priimik, gsm. Vse se mora dati spremenit.
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
BindData();
}
}
private void BindData()
{
OleDbCommand sqlCmd = new OleDbCommand("SELECT * FROM IGRALEC", oleDbConnection1);
sqlCmd.CommandType = CommandType.Text;
oleDbConnection1.Open();
DataGrid1.DataSource = sqlCmd.ExecuteReader();
DataGrid1.DataBind();
oleDbConnection1.Close();
}
private void OnEdit(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
BindGrid();
}
private void OnUpdate(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// Process updated data here
DataGrid1.EditItemIndex = -1;
BindData();
}
Delam v Access bazi, kjer je tabela IGRALEC, v kateri je ime, priimik, gsm. Vse se mora dati spremenit.
private void Page_Load(object sender, System.EventArgs e)
{
if(!IsPostBack)
{
BindData();
}
}
private void BindData()
{
OleDbCommand sqlCmd = new OleDbCommand("SELECT * FROM IGRALEC", oleDbConnection1);
sqlCmd.CommandType = CommandType.Text;
oleDbConnection1.Open();
DataGrid1.DataSource = sqlCmd.ExecuteReader();
DataGrid1.DataBind();
oleDbConnection1.Close();
}
private void OnEdit(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
BindGrid();
}
private void OnUpdate(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// Process updated data here
DataGrid1.EditItemIndex = -1;
BindData();
}
http://www.potovalka.si
Microsoft ::
A ti bi rad v grudi prikazoval neke podatke, potem pa jih kasneje urejal?
by Miha
by Miha
s8eqaWrumatu*h-+r5wre3$ev_pheNeyut#VUbraS@e2$u5ESwE67&uhukuCh3pr
dejc2 ::
Ja podatki se najprej preberejo z baze in se prikažejo.. to mi dela.. potem bi jih pa rad uredil.. to mi pa ne dela..
http://www.potovalka.si
dejc2 ::
private void OnEdit(object source, System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
BindGrid();
}
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
BindGrid();
}
http://www.potovalka.si
Microsoft ::
Ja, sam ti mores imet nek gumb, ki bo tale "OnEdit" pognal. Kar tko sam od sebe se ne bo.
by Miha
by Miha
s8eqaWrumatu*h-+r5wre3$ev_pheNeyut#VUbraS@e2$u5ESwE67&uhukuCh3pr
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | C# težavaOddelek: Programiranje | 3703 (2549) | mladec |
» | razložitev nekaterij elementov v visual studio 05Oddelek: Programiranje | 2105 (1910) | darkolord |
» | c# vprasanjeOddelek: Programiranje | 1843 (1522) | user4683 |
» | c++ & database(access)Oddelek: Programiranje | 1484 (1340) | Seadoo |
» | branje byte[] iz MS access-ove bazeOddelek: Programiranje | 1932 (1842) | BHawk |