Binding 'null' data to textbox in the datagrid
-
Hi, I use the textbox in the datagrid in the 'TemplateColumn'. I bind the information to the textbox in the page_load by the following command
curRejReason = (TextBox)dgTransaction.Items[i].FindControl("txtRejReason"); curRejReason.Text = dgTransaction.Items[i].Cells[14].Text.Trim().ToString();
It works fine, except for the 'empty / null' dataset information for the textbox field. The null information shows in the textbox as & nbsp; .Trim(), .ToString() and its combination doesnt work.... Any help appretiated There is nothing new under the sun,
But there are lots of old things we don't know.
- Ambrose Bierce -
Hi, I use the textbox in the datagrid in the 'TemplateColumn'. I bind the information to the textbox in the page_load by the following command
curRejReason = (TextBox)dgTransaction.Items[i].FindControl("txtRejReason"); curRejReason.Text = dgTransaction.Items[i].Cells[14].Text.Trim().ToString();
It works fine, except for the 'empty / null' dataset information for the textbox field. The null information shows in the textbox as & nbsp; .Trim(), .ToString() and its combination doesnt work.... Any help appretiated There is nothing new under the sun,
But there are lots of old things we don't know.
- Ambrose BierceBecause the text of that cell is . You can reference data source: DataRowView drview = (DataRowView)e.Item.DataItem curRejReason.Text = drview(yourfield) Juno MCSD.NET, MCDBA, MCSE ---------------------------------------------------------- Support Team of EasyDotNet, INC. http://www.EasyDotNet.com DataForm.NET - The most powerful data entry web server control for ASP.NET
-
Because the text of that cell is . You can reference data source: DataRowView drview = (DataRowView)e.Item.DataItem curRejReason.Text = drview(yourfield) Juno MCSD.NET, MCDBA, MCSE ---------------------------------------------------------- Support Team of EasyDotNet, INC. http://www.EasyDotNet.com DataForm.NET - The most powerful data entry web server control for ASP.NET
Thanks, will give it a try!! :rose: There is nothing new under the sun,
But there are lots of old things we don't know.
- Ambrose Bierce