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

DataGrid without data

Lee

Hello all,

Could any provide a link to an example of using a grid without a
datasource? I would like to manually populate the grid as well as
format it.

Thank you,

--
Warm Regards,
Lee

"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."
Mar 25 '06 #1
2 1064
vj
I am not sure why you are trying to do a unbound mode in a DataGrid.. Can
you be more specific?... I would still take the data, move it to a DataTable
and then add the datatable for DataSource It would be easier to work with
the data... Also look at the below link for more tips, that might help you
out..

http://www.syncfusion.com/FAQ/Window...efault.aspx#44

VJ

"Lee" <lu*************@yahoo.com> wrote in message
news:Ow**************@tk2msftngp13.phx.gbl...

Hello all,

Could any provide a link to an example of using a grid without a
datasource? I would like to manually populate the grid as well as
format it.

Thank you,

--
Warm Regards,
Lee

"Upon further investigation it appears that your software is missing
just one thing. It definitely needs more cow bell..."

Mar 25 '06 #2
Hello lee,

You can use custom class that returns ICollection interface. See codesnippet
below

public ICollection GroupsDataSource()
{
groupsDataTable = new DataTable("Rule Groups");

groupsDataTable.Columns.Add("GroupID");
groupsDataTable.Columns.Add("GroupName");
groupsDataTable.Columns.Add("AssignedRules");

Random rnd = new Random();
for (int i = 0; i < 5; i++)
{
newRow[0] = i.ToString();
newRow[1] = "Group" + i;
newRow[2] = "Rules" + i;

groupsDataTable.LoadDataRow(newRow, true);
}

return new DataView(groupsDataTable);
}

and then bind it to your DataGrid like

DataGrid1.DataSource = setsDataTable;
DataGrid1.DataBind();

l> Hello all,
l> Could any provide a link to an example of using a grid without a
l> datasource? I would like to manually populate the grid as well as
l> format it.
l>
l> Thank you,
l>
l> "Upon further investigation it appears that your software is missing
l> just one thing. It definitely needs more cow bell..."
l>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Mar 25 '06 #3

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

Similar topics

0
by: djozy | last post by:
....which I have on my ASP.NET webform. I press button for inserting data's from database in datagrid, that satisfy condition, lets say hair='black'. In datagrid I can see all data's with that...
5
by: Jim | last post by:
is it possible to add a row to a Windows datagrid witthout having a datatable? I need to add a row to the datagrid control. Thanks.
3
by: Brad | last post by:
I'm working with a DataGrid in C#, and the user needs to be able add and remove columns from the DataGrid on the fly, without opening and closing the form. The scenario is this. I have a setup...
0
by: Dave | last post by:
Tried posting in the Winform Forum without much luck, so posting here... After inserting a new data row to a DataTable that is bound to a datagrid, I am unable to change data in a row that is...
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. ...
1
by: Andrew | last post by:
Hey all, I am very new to ASP.Net (and .Net in general), but that isn't stopping the boss from wanting to begin new projects in it. This latest project has me kinda stumped and after a couple...
6
by: Dee | last post by:
Hi The paging numbers of my DataGrid dont actually page. What can be the cause? Everyting else seems to work. Thanks Dee
2
by: AA | last post by:
Do anyone know how to refresh the datagrid without setting datasource to nothing and initialize the grid again? My case is that I have form consisting from two part. The upper part is a datagrid...
2
by: Flack | last post by:
I have a DataGrid and a DataTable. When my form loads I create the DataTable with the appropriate columns and use it for the DataGrids.DataSource. Later on in my app, I alter the DataTable: ...
8
by: Brock | last post by:
I am trying to populate a Crystal Report from data in my DataGrid. The reason for this is that I want the user to be able to change values without updating the database, but still have their report...
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: 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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...
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
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,...

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.