Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6771401
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T15:25:39+00:00 2026-05-26T15:25:39+00:00

I have created a class doing some jobs like GridView inherit from System.Web.UI.WebControls.WebControl. public

  • 0

I have created a class doing some jobs like GridView inherit from System.Web.UI.WebControls.WebControl.

public class IHGridView : System.Web.UI.WebControls.WebControl
{
    // inside here, actually return Repeater class.


    protected override void OnInit(EventArgs e)
    {
        _repeater.ItemTemplate = new IHGridItemTemplate(ListItemType.Item, this.Columns);
        this.Controls.Add(_repeater);
    }
}

I also created ItemTemplate for my repeater in IHGridView.

public class IHGridItemTemplate : ITemplate
{
}

IHGridView class returns Repeater and some html codes, but in convenience to deveop I have created some stuff.

public class Columns : StateManagedCollection
{
}

public class IHBoundFieldBase : IStateManager
{
}

public class IHLabelField : IHBoundFieldBase
{
}

Now in my aspx, I can use this like below:

<cc1:IHGridView ID="IHGridView1" runat="server" EditMode="View">
    <Columns>
         <cc1:IHLabelField ID="IHLabelField7" DataField="PERSON_NAME" HeaderText="PersonName" />
    </Columns>
</cc1:IHGridView>

Now I come up with a problem.
I cannot use DataBinder.Eval in aspx.

<cc1:IHLabelField ID="IHLabelField7" HeaderText="PersonName" Text='<%# DataBinder.Eval(Container.DataItem, "PERSON_NAME") %>' />

This gives me an error.
The error message is below: CS1061: There is no definition of ‘DataItem’ in ‘System.Web.UI.Control’. There is no extendable method ‘DataItem’ in ‘System.Web.UI.Control”s first argument. Please check if there is using rubric or assembly reference. This was written in Korean, but I translated into English.
Could anyone give me a clue to solve this problem?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T15:25:40+00:00Added an answer on May 26, 2026 at 3:25 pm

    In templated controls, the template is instantiated in the container. For data-binding to work in the templated fields, its recommended that container should implement IDataItemContainer interface – the interface implementation should be supplying the data-item.

    AFAIK, to support data binding expressions, ASP.NET parser injects handler for DataBinding event for the control (whose properties uses these expressions) and then in the handler, it generates code that looks for data-item in the container.

    So in your example, if you wish to use data-binding expression in the IHLabelField.Text property then the control’s naming container should either implement IDataItemContainer or should have DataItem property. So in this case, you will probably need DataItem on IHGridView control – and it wouldn’t work the way you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my C#-Silverlight-3-Application, I have created a class, that is doing some calculations that
I have created a class library in VB .NET. Some code in the library
Need some help about with Memcache. I have created a class and want to
I have created this datastructure: class Event { public: Event(EVENT_TYPE type, void* pSender =
Im doing some practices on XNA, and i created a class that represents a
I created class ChImage from UIImage @interface ChImage : UIImage { @public int ChannelId;
I have created an app that sends intents among multiple activities. After doing some
I have created a class for a dashboard item which will hold information such
I have created UITableCellView class called NoteCell . The header defines the following: #import
I have created a class library called AddServiceLibrary in which I have a method

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.