473,320 Members | 1,947 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,320 software developers and data experts.

Populate datagrid from a Tlist

143 100+
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 btnDelPointSearch_Click(object sender, EventArgs e)
{

m_delPoint = textBoxDeliveryPoint.Text;
try
{
TList<Point> dp = RemotingHandler.Instance.Point.GetDelPoint(m_delPo int);

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

//populate datagrid with meterNumber and description

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


}[/HTML]
Sep 4 '07 #1
1 1261
teddarr
143 100+
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 btnDelPointSearch_Click(object sender, EventArgs e)
{
string description = String.Empty;
string meterNumber = String.Empty;
int pointID;

m_delPoint = textBoxDeliveryPoint.Text;
try
{
TList<Point> dp = RemotingHandler.Instance.Point.GetDelPoint(m_delPo int);

//populate datagrid

foreach (Point delPt in dp)
{
description = delPt.Description;
meterNumber = delPt.MeterNumber;
pointID = delPt.PointID;
//add to grid datagrid1.Rows.Add( datarow );
//dataGridDeliveryPoints.Rows.Add(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
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...
3
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...
0
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...
9
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...
4
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...
3
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...
1
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...
1
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...
3
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...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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)...
0
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...
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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.