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

Bound DataGrid with new custom columns

I have a VB.NET Windows application with bound DataGrid control with it’s
DataSource property set to a DataSet object. The DataSet object is created
from an XML Schema. I would like to define some new columns in the DataGrid
that are not yet in the DataSet object that are populated based on a given
critera and values in the existing DataSet object.

I added the new columns to the XML Schema and created a DataGridTableStyle
that contains DataGridTextBoxColumn objects to hide some columns of the grid.

First question: Do all DataGridTextBoxColumn objects must have it's Mapping
property set, thereby, forcing me to add the new columns also to the DataSet?

Second Question: Is there an event or a delegate that can be defined that is
trapped for each row or column instance of the DataSet when it is in the
process of being filled? Or is there another way I can trap each column as it
is being filled?

Is this the best way to do what I am trying to do?

--
Greg
Nov 21 '05 #1
4 2168
Greg,

You can forever use add a column to a datatable (a dataset is only a
collection of datatables and has no columns).

Here a very simple sample on our site how you can add a column and direct
use an expression. (This is a very simple one, you can of course use as well
styles)

http://www.windowsformsdatagridhelp....3-a3539697edbd

I hope this helps,

Cor
Nov 21 '05 #2
It did not help me. What if the formula in the example is a complex formula
that must be processed in the application? Such as looking up values based on
a given critera?
--
Greg
"Cor Ligthert [MVP]" wrote:
Greg,

You can forever use add a column to a datatable (a dataset is only a
collection of datatables and has no columns).

Here a very simple sample on our site how you can add a column and direct
use an expression. (This is a very simple one, you can of course use as well
styles)

http://www.windowsformsdatagridhelp....3-a3539697edbd

I hope this helps,

Cor

Nov 21 '05 #3
Greg,
It did not help me. What if the formula in the example is a complex
formula
that must be processed in the application? Such as looking up values based
on
a given critera?
--

You can forever set values in a column using a loop. (for each or for index)

I hoop this helps,

Cor
Nov 21 '05 #4
Thucks
--
Greg
"Cor Ligthert [MVP]" wrote:
Greg,
It did not help me. What if the formula in the example is a complex
formula
that must be processed in the application? Such as looking up values based
on
a given critera?
--

You can forever set values in a column using a loop. (for each or for index)

I hoop this helps,

Cor

Nov 21 '05 #5

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

Similar topics

1
by: The_Rave | last post by:
Hi everyone, I'm trying to add my own template columns to the property builder of ..NET. E.g. a checkbox column, or an image column. But I can't find the sources of the wizard, or a way to add...
0
by: shamila | last post by:
</asp:label><asp:datagrid id="DataGrid3" runat="server" cssclass="DataGrid" showfooter="True" onupdatecommand="DataGrid3_Update"ondeletecommand="DataGrid3_Delete" oneditcommand="DataGrid3_Edit"...
3
by: Matthew Woods | last post by:
Hi, is there any way to format and order the columns displayed in a datagrid bound to a class that inherits from IBindingList? i have used DataGridTableStyle and added DataGridTextBoxColumns to it...
2
by: Alex | last post by:
I'm reposting my issue with some more info. I would like to use a DataGrid to display my DataSet. My DataSet is from a table in a SQL DB. Both columns in the table are strings. I would like...
15
by: John Blair | last post by:
Hi, Code attached but the line that gives me an error is MyDataGrid.Columns(2).Visible = False It actually gives me an error for any value instead of 2 even when 9 bound columns of data exist....
5
by: tshad | last post by:
Is there a way to carry data that I have already read from the datagrid from page to page? I am looking at my Datagrid that I page through and when the user says get the next page, I have to go...
4
by: Raed Sawalha | last post by:
i have datagrid , I added a bound column and I need to map it with two data fields ...is this possible? <asp:datagrid id=dgInbox runat="server" EnableViewState="False"...
7
by: vsiat | last post by:
I am trying to create a treeview out of a database table with the typical structure ID, NAME, PARENTID, TYPE, EXTRA_INFO, where is linked to the . What I want to achieve is create a tree made...
0
by: TonyJ | last post by:
Hello! I'm unsure when I can use a bound datagrid and when I can't. What limitations has a bound datagrid? 1. For example if I want to manipulate the data in the datasource before displaying...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.