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

default cell value (infragistics)

Status
Not open for further replies.

Hueby

MIS
Oct 20, 2004
321
US
Hi all,

I have the default value for my 'bit' data Type in my SQL DB set to 0 (false).

I am using Infragistic's NetAdvantage Components. In my ultra winGrid (data pulled from DataSet) I have the default Cell Value = False. Like so....(e.Layout.Bands(0).Columns("field").DefaultCellValue = False)

When I go to add a new row though, the checkBox in the grid is grey with a check in it. (it should be white and blank)

AND, when i save the new row, in my DataBase is stores it as <null> still....

(I save by calling a simple da.fill(dataset))

I've tried a few different things, like leaving the default value blank in the DB, etc. but no luck so far.

When manually inputing a row in my Enterprise Manager the default works fine from the DB stand point. So it seems the winGrid is doing something ??

I just didn't know if anyone uses these components at all, and give some more insight on this. Thanks!
 
Instead of setting DefaultCellValue, did you try setting the field value to 0 or 1 each time when adding a new row to the grid. Looks like your DefaultCellValue is not doing what it is suppose to. BTW what ColumnStyle are you using for the checkbox. If you are using ColumnStyle.TriStateCheckBox try changing that to ColumnStyle.CheckBox and see what it gives you now.

-Kris
 
Well, I can not set it to 0 or 1 or I get a error because of the DataType being boolean to the winGrid (and bit in SQL DB).

When I go to save the row it will throw a error. (using this for example: e.Layout.Bands(0).Columns("Completed").DefaultCellValue = 0)

I tried the columnStyle changes but no difference there at all.... ???? Thank you for your suggestions Kris!


 
I guess you are seeing the checkbox as grey because of the NULL value. Can you add the row to the ultragrid datasource directly and setting all the default values to the datasource instead of adding it directly to ultragrid.

-Kris
 
Oh, thats a idea... I'm sure I can do that somehow, I'll have to look into that. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top