DataGrid "MappingName" property

  • Thread starter Thread starter _e_
  • Start date Start date
E

_e_

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?
 
Hi,

The MappingName property value for the DataGridTableStyle object should be
equal to the DataTable's TableName property, not to the type name.
 
Hi,

The MappingName property value for the DataGridTableStyle 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?
 
Dear,

Unfortunately 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/miscctrl/DataGridZen.asp?msg=715387#xx715387xx
(includes source)

Also the faq at http://www.syncfusion.com/faq/winforms/ has a very good
section dedicated to the datagrid.

HTH,

Jan
 
Unfortunately 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/miscctrl/DataGridZen.asp?msg=715387#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.
 
"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.
 
Back
Top