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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiline column in datagrid that accepts return

Status
Not open for further replies.

mbutch

Programmer
Nov 17, 2000
100
US
Can this be done? I have a memo field that I want to be edited in a datagrid on a win form. I want to be able to show three lines at a time and use returns. Here is what I've tried.

Code:
DataGridTextBoxColumn colFullInfo = new DataGridTextBoxColumn();
colFullInfo.MappingName = "fullinfo";
colFullInfo.Width = 400;
colFullInfo.HeaderText = "Extended Product Info";
this.styles.GridColumnStyles.Add(colFullInfo);

this.dataGrid1.SetDataBinding(this.dataSet11, "stock");

this.styles.MappingName = "stock";

this.dataGrid1.TableStyles.Add(this.styles);

DataGridTextBoxColumn myTextBoxColumn;

myTextBoxColumn = (DataGridTextBoxColumn) this.dataGrid1.TableStyles["stock"].GridColumnStyles["fullinfo"];

DataGridTextBox myGridTextBox;

myGridTextBox = (DataGridTextBox) myTextBoxColumn.TextBox;

myGridTextBox.AcceptsReturn = true;

myGridTextBox.Multiline = true;

myGridTextBox.Height = 40;

myGridTextBox.ScrollBars = ScrollBars.Both;[code]

The only thing that works is the scroll bar.  Does anyone have some ideas?

Thanks,

Mike
 
Memo fields, Text fields, blob fields etc... could be huge and I suggest you to put an X in the column of the memo field if there is something in the field.
When you click on this column (with X, for example )you display the memo text in a separate edit box where you allow the updates of this field and when finished you will update the DataTable (DataSet) accordingly.
-obislavu-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top