The example shows connecting to a table, but I'm connecting to a SP.
I get the error, "Object reference not set to an instance of an object."
DataGridColumnS tyle colStyle4 = new
DataGridTextBox Column();
dgts.GridColumn Styles.Add(colS tyle4);
dgts.GridColumn Styles[4].Width = 75;
DataGridTextBox Column myGridTextBoxCo lumn =
(DataGridTextBo xColumn)dgPrivi leges.TableStyl es["dbo.SALES_REVE NUE"].GridColumnStyl es["GROSS_FEE_AMOU NT"];
myGridTextBoxCo lumn.Format = "c";
colStyle4.Mappi ngName = dt.Columns[4].ColumnName;
I have also tried using dt.TableName but recieved error, "Cannot convert
type 'string' to 'System.Windows .Forms.DataGrid TextBoxColumn'
DataGridTextBox Column myGridTextBoxCo lumn =
(DataGridTextBo xColumn)dt.Tabl eName;
""Jeffrey Tan[MSFT]"" wrote:
Hi Cadel,
Thanks for your post.
We can set DataGridTextBox Column.Format to "c" to get the currency format.
For more information, please refer to DataGridTextBox Column.Format in MSDN
documentation.
Hope this helps
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.