Thursday, November 17, 2011

Bind the data to label control which in data grid using c#

Here i want to bind the data to labels which are placed in grid view .For this i will put the binding property instead of label text property .In the below example i was bind the Id ,name to label's etc
Default.aspx:
In the grid view control, go to the <Item Template> element for the ID Column. Change the asp:Label control to display the ID for the current row in the grid view by replacing the Label text with the data binding

  <%# DataBinder.Eval(Container.DataItem, "ID") %>


  <%# DataBinder.Eval(Container.DataItem, "Name") %>
 
Post a Comment

Bel