473,325 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Object data source + HastTable

Hey
I have List<myObjects> and each myObject has property with HashTable. And I
want to bind it to GridView. Each item in HastTable is a column in gridView
but it will change in time so this one it will have 5 columns, next 3 , next
7. So I need to automatically create columns in gridView depending on
HashTable. Can you tell me best way to do this ? [If you have better idea
than hashTable please share].
Jarod

Apr 6 '06 #1
1 2783
Jarod,

Are you only going to bind to one object in the List at a time? If not,
then you would have to find ALL of the properties of ALL of the hashtables
and then flatten the structure.

You should also have your objects (if you are binding to them in the
GridView) implement ICustomTypeDescriptor. This way, you can indicate what
columns you want shown. It's a little work to do, but you have to do this
in order provide custom metadata.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Jarod" <bl*****@NOSPAM.gazeta.pl> wrote in message
news:uS**************@TK2MSFTNGP04.phx.gbl...
Hey
I have List<myObjects> and each myObject has property with HashTable. And
I want to bind it to GridView. Each item in HastTable is a column in
gridView but it will change in time so this one it will have 5 columns,
next 3 , next 7. So I need to automatically create columns in gridView
depending on HashTable. Can you tell me best way to do this ? [If you have
better idea than hashTable please share].
Jarod

Apr 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DrUg13 | last post by:
In java, this seems so easy. You need a new object Object test = new Object() gives me exactly what I want. could someone please help me understand the different ways to do the same thing in...
0
by: muralidharan | last post by:
WebForm1.aspx Code: <%@ Register TagPrefix="ComponentArt" Namespace="ComponentArt.Web.UI" Assembly="ComponentArt.Web.UI" %> <ComponentArt:TreeView id="TreeView1" Height="520"...
8
by: dixie | last post by:
I have a report with a subreport. The source object for this subreport varies according to the value of a field in a table. I am trying to programmatically set the object source for the subreport...
15
by: Tim Jarvis | last post by:
Hi, I have an object that I am binding to a text box, this object exposes a boolean field, and I have implemented a format event handler and a parse event handler for the binding object, where I...
5
by: Greg | last post by:
Hi, I have been unable to resolve this error message: Object Ref not set to an instance of an object. The issue is that I cannot determine which object reference is causing the problem. ...
0
by: zhaoJian | last post by:
Here it is my code ,but it can't update the database.How to do it ? In _UpdateUnit event, I can not get the original value to @Original_UnitID,so I set a hidden column named LabelKey.But It...
3
by: Adriano | last post by:
Hello, when I try to print something, either DataGrid or from Crystal Report viever the folowing error message appears and cancels printing: Object reference not set to an instance of an...
1
by: David Veeneman | last post by:
Hi-- I'm trying to databind a business object to several controls using the DataBindings property of the controls, like this: textBoxStartDate.DataBindings.Add("Text", CurrentStep, "StartDate",...
3
by: Doogie | last post by:
Hi I have a gridview on my web page and I bind it to an object of my own creation. When I click a button on that page, I want to get the data from that gridview and cast it back into that object...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.