Skip to content

Replies

0
Wendy
Wendy answered on Mar 19, 2012 4:20 PM

Ok I am still having some issues here. Ill admit i am not the most experinced Web Dev and I am probably missing something simple but here is what is going on. 

I do 

grdResults.DataSource = GetData();

grdResults.DataBind();

 

Then to format the column.

                ((Infragistics.Web.UI.GridControls.BoundDataField)grdResults.Columns[grdResults.Columns.Count – 1]).DataFormatString = "{0: $###,###,##0.00}";

 

I think get a object not set to a instance error, which appears to be because the columns in the grid do not exist yet. Which is rather confusing.

 

What exactly do i need to do to correct this? Thanks so much!

0
Wendy
Wendy answered on Mar 19, 2012 2:39 PM

I guess I am auto generating columns then, as this is the error I am getting when i try that. 

 

Error 7 'Infragistics.Web.UI.GridControls.GridField' does not contain a definition for 'DataFormatString' and no extension method 'DataFormatString' accepting a first argument of type 'Infragistics.Web.UI.GridControls.GridField' could be found (are you missing a using directive or an assembly reference?) 54 66

And here is the line of code I am using.
grdResults.Columns[grdResults.Columns.Count – 1].DataFormatString= "{0:c}";