Sunday, February 26, 2012

Databinding in c# - Important

Hello
All the samples I found are based on datagrid for the child table.
What if I don't want the child records to be displayed in a datagrid, but in
their own data bound controls like "text box, combo & list boxes). And I
want to provide a second level of navigation buttons to traverse those child
records in the child table.
I'm sure this is possible, but I can't seem to find any sample on it.
Please let me know if you can throw any light on it.
Thank You
You can use the BindingContext and the BindingManagerBase classes to
accomplish this... using the Control.DataBindings.Add( , , )
I don't have any sample off of the top of my head but if you put in
BindingContext and BindingManagerBase in google, you'll find some
W.G. Ryan, MVP
www.tibasolutions.com | www.devbuzz.com | www.knowdotnet.com
"Hemang Shah" <hemang@.hemang.net> wrote in message
news:ToidnScZwb7iqGjcRVn-ow@.rogers.com...
> Hello
> All the samples I found are based on datagrid for the child table.
> What if I don't want the child records to be displayed in a datagrid, but
in
> their own data bound controls like "text box, combo & list boxes). And I
> want to provide a second level of navigation buttons to traverse those
child
> records in the child table.
> I'm sure this is possible, but I can't seem to find any sample on it.
> Please let me know if you can throw any light on it.
> Thank You
>
>
|||Hemang,
It's the same as if you were binding to the grid. When you add the
binding for the control to the child table, you set the data source to the
relation, not to the child table itself.
Hope this helps.
- Nicholas Paldino [.NET/C# MVP]
- mvp@.spam.guard.caspershouse.com
"Hemang Shah" <hemang@.hemang.net> wrote in message
news:ToidnScZwb7iqGjcRVn-ow@.rogers.com...
> Hello
> All the samples I found are based on datagrid for the child table.
> What if I don't want the child records to be displayed in a datagrid, but
> in
> their own data bound controls like "text box, combo & list boxes). And I
> want to provide a second level of navigation buttons to traverse those
> child
> records in the child table.
> I'm sure this is possible, but I can't seem to find any sample on it.
> Please let me know if you can throw any light on it.
> Thank You
>
>