E
Esperanza
Hello everybody,
I want to do a master detail web form.
I've made a datagrid as a master and put a datalist below which will show up
the details information. I choose a datalist for the details informations
because, I have many columns and don't want to have it display as a row.
I've got the following line in error :
DataGrid1.SelectedItem = e.Item.ItemIndex
Saying :
Property or indexer 'System.Web.UI.WebControls.DataGrid.SelectedItem' cannot
be assigned to -- it is read only
Why it says it is read only, the column is not in readonly.
Thanks in advance !!
Esperanza
New to .net
Here is my code :
//==============================================
private void Page_Load(object sender, System.EventArgs e)
{
DataGrid1.DataSource = dataViewGPPL;
DataGrid1.DataKeyField = "GLNOCLI";
DataGrid1.DataBind();
}
//============================================
//==========================================================================
========
private void DataGrid1_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.SelectedItem = e.Item.ItemIndex;
int intPrimaryKey = (int)DataGrid1.DataKeys[e.Item.ItemIndex];
this.sqlDataAdapResultatsHys.SelectCommand.Parameters["@NoClient"].Value
= intPrimaryKey;
DetailsDataList.DataSource = dataSetResultatsHys;
DetailsDataList.DataBind();
}
//==========================================================================
========
I want to do a master detail web form.
I've made a datagrid as a master and put a datalist below which will show up
the details information. I choose a datalist for the details informations
because, I have many columns and don't want to have it display as a row.
I've got the following line in error :
DataGrid1.SelectedItem = e.Item.ItemIndex
Saying :
Property or indexer 'System.Web.UI.WebControls.DataGrid.SelectedItem' cannot
be assigned to -- it is read only
Why it says it is read only, the column is not in readonly.
Thanks in advance !!
Esperanza
New to .net
Here is my code :
//==============================================
private void Page_Load(object sender, System.EventArgs e)
{
DataGrid1.DataSource = dataViewGPPL;
DataGrid1.DataKeyField = "GLNOCLI";
DataGrid1.DataBind();
}
//============================================
//==========================================================================
========
private void DataGrid1_ItemCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.SelectedItem = e.Item.ItemIndex;
int intPrimaryKey = (int)DataGrid1.DataKeys[e.Item.ItemIndex];
this.sqlDataAdapResultatsHys.SelectCommand.Parameters["@NoClient"].Value
= intPrimaryKey;
DetailsDataList.DataSource = dataSetResultatsHys;
DetailsDataList.DataBind();
}
//==========================================================================
========