Databinding to a Custom Control's Textbox

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have a custom control that comprises of a label and a textbox. I have added the Design Time Properties for the designer to select the DataSource and DataMember, those seem to work fine at Design Time. But at Run Time the TextBox remains empty. How do I "Wire Up" the DataSource/Datamember so that the data shows in the TextBox?

This is the portion of the code Im using to set the DataMember/Source properties:

[Editor("System.Windows.Forms.Design.DataMemberListEditor,System.Design, Version=2.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
public string DataMember
{
get
{
return m_DataMember;
}
set
{
m_DataMember = value;
}
}

[AttributeProvider(typeof(IListSource))]
public object DataSource
{
get
{
return m_DataSource;
}
set
{
m_DataSource = value;
}
}

Thank you for any help or tutorials on the subject!
Ron

.



Relevant Pages

  • Datagrid grafikfehler
    ... DataSource ist eine DataView mit .AllowEdit = ... Benutzer markiert eine Zelle => diese bekommt einen grauen Hintergrund ... nur die graue Textbox mitsamt ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: ScriptManager.RegisterClientScriptBlock not working with UpdatePanel
    ... this stuff is easier to debug with firefox and its dev tools. ... which has an ASP:Table (design time) in it. ... The table has rows with a textbox that runs some Javascript ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Text box problem
    ... TextBox by selecting each one separately and moving the bottom "sizing ... Private Sub Form_Click ... For a given font and font size, there seems to be a minimum ... value at Design Time seems to be a bug. ...
    (microsoft.public.vb.controls)
  • RE: Newbie-define textbox datasource within the source code.
    ... > Complex DataBinding accepts as a data source either an IList or an IListSource ... The datasource of the textbox varies depending on what the ... >> datagrid as shown in the code below, but I can not seem to get the right ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: Why a form on users computer has missing objects?
    ... Missing image and 2 labels are placed at design time ... I have inserted some code in textbox Change routine. ...
    (microsoft.public.vb.general.discussion)