I'm trying to set custom widths and headings for DataGrid columns, but
they keep displaying as defaults. I did configure the params via the
TableStyles collection -> ColumnStyles collection. MappingName
is set to the name of the DataTable.
My understanding is that the names should match or else the defaults
will be used. Though all the data is being displayed, it does look
like the column sizes and headers are set to defaults (Names = Column
names in the DataTable).
My own DataTable is actually inherited from DataTable, but I am
referring to it by its name:
public class DTX : DataTable {
...
}
I'm using DTX as the mapping name.
So...What am I overlooking? 7 3795
Hi,
The MappingName property value for the DataGridTableSt yle object should be
equal to the DataTable's TableName property, not to the type name.
--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio http://www.x-unity.net/teststudio.aspx
Bring the power of unit testing to VS .NET IDE
"_e_" <no****@nospam. com> wrote in message
news:ov******** *************** *********@4ax.c om... I'm trying to set custom widths and headings for DataGrid columns, but they keep displaying as defaults. I did configure the params via the TableStyles collection -> ColumnStyles collection. MappingName is set to the name of the DataTable.
My understanding is that the names should match or else the defaults will be used. Though all the data is being displayed, it does look like the column sizes and headers are set to defaults (Names = Column names in the DataTable).
My own DataTable is actually inherited from DataTable, but I am referring to it by its name:
public class DTX : DataTable { ... }
I'm using DTX as the mapping name.
So...What am I overlooking?
On Thu, 12 Feb 2004 14:22:51 +0200, "Dmitriy Lapshin [C# / .NET MVP]"
<x-****@no-spam-please.hotpop.c om> wrote: Hi,
The MappingName property value for the DataGridTableSt yle object should be equal to the DataTable's TableName property, not to the type name.
Thanks, Dmitiry. The docs I was looking at were vague on the
subject, and they referred to use of reflection to get parameter
types. That threw me.
Do you happen to know of any books or sites that cover it better than
the VS online docs? I'd like to dig deeper into some obscure features
of Datagrid controls... see if it's possible to add pushbuttons, etc.
Maybe I should post a separate query about that.
I need some detailed info on Datagrid controls. I haven't been able to
find references on adding pushbuttons, etc. What is the best book or
online reference to check for stuff like this?
"ASP.NET Data Web Controls" by Scott Mitchell, published by Sams is
excellent.
Jim
"_e_" <no****@nospam. com> wrote in message
news:0l******** *************** *********@4ax.c om... I need some detailed info on Datagrid controls. I haven't been able to find references on adding pushbuttons, etc. What is the best book or online reference to check for stuff like this?
>"_e_" <no****@nospam. com> wrote in message news:0l******* *************** **********@4ax. com... I need some detailed info on Datagrid controls. I haven't been able to find references on adding pushbuttons, etc. What is the best book or online reference to check for stuff like this?
On Sat, 14 Feb 2004 12:57:18 +0100, "Jan" <ms****@tss.b e> wrote:
Unfortunatel y good information on the extensibility of the datagrid is rare.
There have been some more or less successfull attemps to extend it. Have a look at :
http://www.i-syn.com/devcom/colstyles/intro.htm (includes source-code, and Ulrich seems to be working on an improved version)
http://dotnet.leadit.be/extendeddatagrid/ (unfortunately without source-code) http://www.codeproject.com/cs/miscct...387#xx715387xx (includes source)
Also the faq at http://www.syncfusion.com/faq/winforms/ has a very good section dedicated to the datagrid.
Excellent! Thanks, Jan.
I also found a chapter on databinding in a Wrox book: "Windows GUI
Programming using C#" Like many Wrox books, it isn't well edited or
organized, but at this point, I'm looking for any available fragments.
The i-syn site above seems to be one of the better ramp-ups on the
subject, and Shepherd's Forms Faq is quite amazing.
On Sat, 14 Feb 2004 10:15:11 -0600, "Jim McGivney"
<mc******@nospa m.winid.com> wrote: "ASP.NET Data Web Controls" by Scott Mitchell, published by Sams is excellent. Jim
I didn't realize that Web Datagrid controls related that closely to
Forms controls. I'll check into the book. Thanks, Jim. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: pei_world |
last post by:
Hi, there;
I have a problem with my datagrid control. I declared it in one of my
form, set with DataGridTalbeStyle as well, and when I click on button, I
would like to retrive Data from Database and bind these data to my datagrid
in the form,
when I click the button first time, it work fine. but when I click the
second button. it report belowing error, I guess it is because it already
set up the column name at first time, so cann't do...
|
by: berg |
last post by:
All,
I am binding an ArrayList full of custom objects to an DataGrid. The
property in the custom class are all public.
I define a DataGridTableStyle and set the MappingName to "ArrayList". I
then add a DataGridTextBoxColumn for each of the properties in my custom
class which define a MappingName --> property name in class as well as
header text.
When I run the form, I see correct number of rows displayed, but none of the
columns...
|
by: Das |
last post by:
Hi everyone,
I'm using datagrid control to display the data. I want to hide column to be
displayed into the data grid. I'm using the code as given below:
Method given below is used to bind the data grid with the db:
public static void DataGrid(DataGrid DG,string sql)
{
//Initialize connection with the db
|
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
gridcolumnstyle for all columns at the parent level.
I have created a datastyle for every child level and I have assigned also
gridcolumn styles to the components.
|
by: Robert Schuldenfrei |
last post by:
Dear NG,
After being away from C# programming for a spell, I am trying my hand at
what should be a simple task. I have been hitting my head against the wall
this morning. I have a simple order entry application. The code below gets
line items from a SQL Server database and returns them to a datagrid by way
of a DataTable called lineTable. As long as I am just displaying columns in
the SQL database everything works well. I now want...
| |
by: Mike L |
last post by:
This is for a Win form, in C# 2005.
I want to load a datagrid, make some columns width 0, and then clean out the
record I added.
I get the error message, ""Index was out of range. Must be non-negative and
less than the size of the collection. Parameter name: index""
I have tried, -1,0,1,2 for the index, and I get the same error message on
each try.
|
by: J |
last post by:
Ok, they have changed a lot of stuff in VB.net. How in the world do you hide a column on the Datagrid?
--
Jason
|
by: bordsby |
last post by:
Situation:
I am using an OleDbDataAdapter to fill a DataSet's DataTable with data
from an Access database. The DataSet's DataTable is bound to a
DataGrid. After the OleDbDataAdapter.Fill method is called, the
DataGrid displays the column headings as the column names output from
the Access SQL query. I would like to change some of the styles for
certain columns in the DataGrid, so I first need to set the
DataGridColumnStyle.MappingName...
|
by: Nick |
last post by:
Hello,
Please pardon my ignorance as I'm sure this is easy to do. I have a datagrid
where I want to let the user delete columns. I added a context menu to the
datagrid that has a delete option. If the user right clicks on a column
heading can I highlight that column and then delete it? I'm not exactly sure
how to highlight it or figure out what column has been clicked.
In my testing so far when I use the context menu I always get the...
|
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...
|
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...
| |
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...
|
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |