Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DataGrid: HeaderText instead of the MappingName

Status
Not open for further replies.

dpdoug

Programmer
Nov 27, 2002
455
US
I am creating a DataGrid in a win form for the first time -- I've done many on a webform, but this is much different.

I want to make the headerText different than the column name, but when I test it the headerText always turns out the same as the mapping Name.

HeaderText = "PO"

MappingName = "PurchaseOrder"

The word PurchaseOrder takes up too much space so I want to use PO, but the Mapping Name keeps displaying instead of the HeaderText.

Is this a bug? or am I doing something wrong?
 
I looked at your class and tried to incorporate it into my app, but I can't figure out how to use it.

If I drop a DataGrid control onto the form, then how does it get the properties from the comDataGrid class?

sorry, I'm just learning the windows DataGrid. I't quite different than the webform version of the DataGrid that I've done hundreds of.

 
You dont drop a datagrid onto your form. You drop a comdatagrid onto your form. Here are the steps to do this.

1) Create a new project - call it myControls
2) Add the ComDataGridClass to it. (Rebuild)
3) Right click the project (Properties)...set output type to class library
4) Add a reference to the new project from your working project.
5) On the forms toolbox, right click and add tab, call the tab mycontrols.
6) Click on the new tab and in the area underneath, right click again, and select add/remove items.
7) Browse for and Locate the mycontrols.dll file (in the bin folder under the folder you created the project in)

Now you have added a new Library for controls which you can drop onto your forms. If you add more controls to your mycontrols class, you must rebuild the library project and repeat step 6 again.

Hope this helps




Sweep
...if it works dont mess with it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top