473,765 Members | 2,005 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populate datagrid from a Tlist

143 New Member
I have a TList that returns several items in C#. I want to pull 3 entities from this tlist to assign to variables. 2 of the 3 will be displayed in a datagrid. How do I assign these values to the variables and then populate my datagrid?

Here's what I have so far...

[HTML]private void btnDelPointSear ch_Click(object sender, EventArgs e)
{

m_delPoint = textBoxDelivery Point.Text;
try
{
TList<Point> dp = RemotingHandler .Instance.Point .GetDelPoint(m_ delPoint);

//string meterNumber = ?????
//int pointID = ?????
//string description = ?????

//populate datagrid with meterNumber and description

}
catch (Exception ex)
{
//execption handling
}


}[/HTML]
Sep 4 '07 #1
1 1282
teddarr
143 New Member
OK, I have the data assigned to the proper variables. Now I just need to display this data on a table or datagrid, something with a scroll bar. Drop down menu would not fit with the flow of the application so that is out of the question.

Any ideas? Here's where I am now:
[HTML]
private void btnDelPointSear ch_Click(object sender, EventArgs e)
{
string description = String.Empty;
string meterNumber = String.Empty;
int pointID;

m_delPoint = textBoxDelivery Point.Text;
try
{
TList<Point> dp = RemotingHandler .Instance.Point .GetDelPoint(m_ delPoint);

//populate datagrid

foreach (Point delPt in dp)
{
description = delPt.Descripti on;
meterNumber = delPt.MeterNumb er;
pointID = delPt.PointID;
//add to grid datagrid1.Rows. Add( datarow );
//dataGridDeliver yPoints.Rows.Ad d(delPt);
}
}
catch (Exception ex)
{
//exception handlling
}

}[/HTML]
Sep 5 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1881
by: Stephen | last post by:
Was wondering if it is possible to take the contents of a row in a datagrid and use an event to copy over the details of the selected row into another datagrid. I'd like to be able to do the following: - I have a datagrid on my page which comes back as follows. The addresses are in a column which is databound. I would like to create an event on the on-click of the select link (located in the datagrid). On this event I would like to...
3
5157
by: Seeker of the Unseen | last post by:
Hi All, I am new to C++. I am currently playing with Borland C++ builder, I am trying to use TList to put my objects inside it, but I don't seem to quite grasp the concept of it. Can anyone help me with some documetation of some kind on how to use TList, cause the help file didn't help me much.
0
1586
by: Mainlander | last post by:
I have a class that I designed that contains some objects in its fields, that are derived from the TList class. I want to use the TList Sort procedure to sort the items that are in the derived class. The derived class has an extra field that specifies how to sort the items. The problem I have is in the implementation of the Sort method in the way the class is implemented by Borland. The call to the Sort method must pass in the name of...
9
3325
by: Mike L | last post by:
I tried a sample of code in MSDN magazine, but now I'm stuck. What code has the best performance to populate a Data Grid with a SP? Below is the code I have, which might be completing the wrong way to populate a data grid. I like using code and not the server explorer. (I replaced the sa password for this post.) private void frmDealerSearch_Load(object sender, System.EventArgs e) { string sConnString = "Data
4
3007
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be added to the data grid. My current code is coming up with errors, dt and drv are unknown in the else part of the if statement. if (this.dgPrivileges.DataSource == null) {
3
2101
by: crjunk | last post by:
I have 4 different databases that I'm having to pull data from in order to populate a datagrid. I am able to do this, but my problem is that because I'm pulling the data from 4 different databases, the data is ordered alphabetically but is grouped by database. Here is an example of what is happening to the data in the datgrid with the code that I have now. DB1 Apple DB1 Bird DB1 Cake
1
1882
by: GladaFrasse | last post by:
Hello Has someone made a treeview with 3 nodes. When the third node is expanded then a datagrid should be shown (integrated in the treview) with the possiblity to edit the values (not the columns) in the grid. If someone has some clue on how to make this I would appreciate if that person could post a message. Frans
1
2125
by: Mike P | last post by:
Is it possible when populating a datagrid to populate a dropdownlist column based upon the value populated to another row in the datagrid? (i.e. I have a drop down which I want to populate differently for each row with user names based upon a UserRegionID which is also a column in the row). Since you don't actually know the value of the UserRegionID until the data is already bound to the datagrid, how do you do this?
3
4369
by: rn5a | last post by:
A SqlDataReader is populated with the records from a SQL Server 2005 DB table. The records retrieved depends upon 2 conditions (the conditions depend on what a user selects in an ASPX page). If condition1 is true, then the SqlDataReader will be populated with the records existing in table1 & will return 0 to the calling function but if condition2 is true, then the SqlDataReader will be populated with the records from another table named...
0
10164
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8833
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3926
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.