473,404 Members | 2,187 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,404 software developers and data experts.

datagrid or table?

Hi

I'm trying to write a program that seraches from strings in various
text files and displays the data in an easy on the eye tabular form on
a webpage. I have written all of the code to search through the files
in question but I need a bit of help on how to display them.

The datagrid on the face of it seems an ideal solution but as its
primary use is databinding it with a data source I'm having a lot of
trouble manually adding items into the control as I am not using any
kind of database I basically have a selection of strings which i want
to put into the datagrid as one row then repeat the operation.

Any ideas on how i would do this?

Or if this is not the way that datagrids are meant to be used, got any
tips for using tables? It seems like there is a lot of code to create
each row, cell etc

Thanks in advance

Jan 18 '06 #1
6 1866
What about using a repeater control?

Jan 18 '06 #2
Robert,
You are correct in your statement that the DataGrid is happiest when it is a
databound animal. You can create a datatable with the appropriate columns and
bind this to the grid.

Or, you might find that a DataList is more appropriate as it lets you
customize the HTML in ItemTemplates and still have the repeating feature.

Finally, you just might decide to create a custom HTML table instead, which
is certainly a valid choice, although it may take a lot more code.

--Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"ro**************@gmail.com" wrote:
Hi

I'm trying to write a program that seraches from strings in various
text files and displays the data in an easy on the eye tabular form on
a webpage. I have written all of the code to search through the files
in question but I need a bit of help on how to display them.

The datagrid on the face of it seems an ideal solution but as its
primary use is databinding it with a data source I'm having a lot of
trouble manually adding items into the control as I am not using any
kind of database I basically have a selection of strings which i want
to put into the datagrid as one row then repeat the operation.

Any ideas on how i would do this?

Or if this is not the way that datagrids are meant to be used, got any
tips for using tables? It seems like there is a lot of code to create
each row, cell etc

Thanks in advance

Jan 18 '06 #3
bob
Maybe in the future i would like to add a the check box column in that
think is available in a datagrid. So if the datagrid option is possible
i would prefer to persue that first.

Cheers

Jan 18 '06 #4
bob
So am I right in thinking that I have to create a source, wheter it be
a database or other datatable first before binding it to the datagrid,
and it is not possible to add many items to it directly?

Jan 18 '06 #5
bob
So am I right in thinking that I have to create a source, wheter it be
a database or other datatable first before binding it to the datagrid,
and it is not possible to add many items to it directly?

Jan 18 '06 #6
That's right. Anything that implements the IList interface is bindable. But,
a DataTable is probably the most flexible because it offers DataView,
sorting, Select, and other features. You can build a DataTable manually, it
is not necessary to get data from a database to create one.
Peter
--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"bob" wrote:
So am I right in thinking that I have to create a source, wheter it be
a database or other datatable first before binding it to the datagrid,
and it is not possible to add many items to it directly?

Jan 18 '06 #7

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

Similar topics

7
by: Billy Jacobs | last post by:
I am using a datagrid to display some data. I need to create 2 header rows for this grid with columns of varying spans. In html it would be the following. <Table> <tr> <td colspan=8>Official...
0
by: Gamze | last post by:
Hi, How can i get values from datagrid to combobox and should select the same name as in datagrid row on the combobox control In my vb.net windows application ,i have combobox which is...
3
by: Diego TERCERO | last post by:
Hi... I'm working on a tool for editing text resources for a family of software product my company produces. These text resources are found in a SQL Server database, in a table called...
3
by: Quetzal | last post by:
Hello, I have a dataset populated using an XML file. The schema has hierarchical components. Let's say <a><b></b></a>. I have created a datagrid and I have assigned a datastyle and then...
6
by: Alpha | last post by:
I have several textboxes that I need to chang the text when the selection row is changed in a datagrid. I have the following code. This textbox displayes the initial selection but when I click on...
5
by: John Richardson | last post by:
I've been bothered for some time about my DataGrid not populating my rows very quickly. I have about 10K rows loading into the grid. I create a datatable dt with 2 columns, an ID and a display. ...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
8
by: Sue | last post by:
I have a datagrid populated with 6 visible read-only labels and several hidden fields. Below the datagrid, I have a table with various textboxes, dropdowns, etc. I've managed to decypher the...
2
by: Marty McDonald | last post by:
When setting certain datagrid properties with the IDE (as in the property window), they don't seem to take effect. For instance, Font Name. So I have to set these via code-behind at the cell...
4
by: jaYPee | last post by:
I have 1 dataset called "dataset1" that contains 2 tables called "course" and "courseload". in my form i have a datagrid. the datasource of this datagrid is "dataset1" and the datamember is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
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...

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.