|
-
September 20th, 2002, 11:46 AM
#1
C#: How do I show only one row for an Edit
below are two commented out peices where it will on click of the edit button show only the one selected row, but the e.item.itemindex is now out of whack. AND the row no longer editable...
Any suggestions on simply hiding all but the selected row for edit while maintaining the index?
public void DataGrid_OnEditCommand(object sender, DataGridCommandEventArgs e)
{
DataGrid1.EditItemIndex = e.Item.ItemIndex;
string sELFID = dataSet51.tbl1[e.Item.ItemIndex].ELFID;
bool testnull1 = dataSet51.tbl1[e.Item.ItemIndex].IsELFPatchNull();
bool testnull2 = dataSet51.tbl1
TextBox1.Visible=true;
TextBox2.Visible=true;
if(!testnull1)
{
TextBox1.Text = dataSet51.tbl1[e.Item.ItemIndex].ELFPatch.ToString();
}
if(!testnull2)
{
TextBox2.Text = dataSet51.tbl1[e.Item.ItemIndex].ELFAddInfo.ToString();
}
lbl11.Text = dataSet51.tbl1[e.Item.ItemIndex].ELFName.ToString();
lbl11.Font.Italic = true;
lbl11.Font.Bold = true;
//dataSet51.Clear();
//sqlDataAdapter1.SelectCommand.CommandText = "SELECT <clip due to length> where thisID = thisID"
DataGrid1.DataBind();
PlaceHolder1.Controls.Add(lbl11);
int b;
b = 7;
sqlDataAdapter2.Fill(dataSet71);
a = dataSet71.Tables["tbl2"].Rows.Count;
for(int i = 0; i <= (a-1) ; i++)
{
((CheckBox)DataGrid1.Items[e.Item.ItemIndex].Cells[(b+i)].Controls[0]).Enabled = true;
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|