Nick Harrison

Nick Harrison

  • NA
  • 6
  • 6.8k

.Net 2.0 GridView Bug?

May 5 2011 10:26 AM

I have a web application, one of the forms has a GridView on it. .Net 2.0.
Most of the columns are template and I have textbox controls in the ItemTemplate . Normally the Id and name of the control resolves to something like the following.

ctl00$contentHolder$dgData$ctl02$dfCustomerSearchWord

All well and good as I expect.

If I add the following code to the RowCreated event.


if (e.Row.RowType == DataControlRowType.DataRow)
{
TextBox dfDgCustomerSearchWord = (TextBox)e.Row.FindControl("dfCustomerSearchWord");



string sCustomerSearchWord = dfDgCustomerSearchWord.UniqueID;

}

The control and name attributes resolve to this.

dfCustomerSearchWord

What the hell is that all about, I havnt even tried to assign anything to the UniqueId, only accessed it.

Is this a bug? If not can anybody explain what esoteric reasoning might elicit this sort of behaviour in the GridView?


Answers (3)