Ask a Question related to ASP.NET Data Grid Control, Design and Development.
-
Assimalyst #1
DataGrid Row Disappears when click edit??
Hi,
I have a datagrid DataBound with the following code:
private void SampleSearch()
{
// set search strings
int intUserNo = (int)(Session["usrNo"]);
string strPatientCode = patientCodeTxtBx.Text;
DateTime dateProcedureDate = DateTime.Parse(procedureDateTxtBx.Text);
// set parameter values
daSampleAss.SelectCommand.Parameters["@patientCode"].Value =
strPatientCode;
daSampleAss.SelectCommand.Parameters["@procedureDate"].Value =
dateProcedureDate;
daSampleAss.SelectCommand.Parameters["@usrNo"].Value = intUserNo;
daSampleAss.Fill(dsSampleAss1);
DataGrid1.DataBind();
}
Which works OK.
But when I click the 'Edit' link in the first column, the headers
remain but the row disappears. It's code is as follows:
private void DataGrid1_EditCommand(object source,
System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
DataGrid1.DataBind();
}
DataGrid1 has DataSource = dsSampleAss1.
Any ideas?
Thanks.
Assimalyst Guest
-
Would like to load a datagrid already in edit mode instead of having the user click the edit button
Now my asp.net datagrid shows an edit button and clicking it puts the datagrid in edit mode. I would like to: 1) possilby load the page already... -
datalist disappears on edit bind
Hi I have a simple datalist which displays a list of typenames. it will list from a datasource and let me add. But on the Edit bind the list... -
DataGrid disappears on UpdateCommand
Hi, I'm using a DataGrid with dynmically created colums. (AutoGenerateColumns=false) I call the DataGrid creation and data binding if... -
DataGrid Disappears when I click on Edit
In my test environment my datagrid is working is just fine. I have multiple template columns and I am not using paging. When I move the datagrid... -
DataGrid contains no data after postback of edit button click...
This is specifically what is going on in my application:... -
Assimalyst #2
Re: DataGrid Row Disappears when click edit??
It seems after much messing that the problem may be to do with the fact
that I have removed the if(!IsPostBack) code from the
DataGrid1.DataBind().
I created a test and it works ok if if(!IsPostBack) is included, and
run from the Page_Load method.
However I want to bnd the datagrid using a button click, in which case
the datagrid does not bind due to if(!IsPostBack) being false. Is there
anyway around this?
Thanks.
Assimalyst Guest



Reply With Quote

