I am trying to use this sample with a databound grid control. In the onsavechanges method I am trying to set a tag with an object (basically a arraylist). However whatever I set I can not read back out.
I have tried setting:
this.StyleInfo.Tag = ddUser.GetValues();
or
this.Grid.Model[this.RowIndex, this.ColIndex].Tag = ddUser.GetValues();
Whenever I try to read it back out I get nothing.
AD
Administrator
Syncfusion Team
April 13, 2005 01:00 AM UTC
A GridDataBoundGrid does not store anything except the Cellvalue. (Your datasource has not Tag property to hold the e.Style.Tag that you are setting, so it is lost.)
If you want to do save the style.Tag property, then you need to cache it is grid.Model.SaveCellInfo and then provide it in grid.Model.QueryCellInfo. Here is a kb link that does something similar to save style.FormulaTags in a GridDataBoundGrid. http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=104&catId=11
AD
Administrator
Syncfusion Team
April 13, 2005 01:33 PM UTC
I am confused I am trying to read the tag property in my savecellinfo method and it is already gone. Should I use the formulatags instead?
AD
Administrator
Syncfusion Team
April 13, 2005 01:48 PM UTC
So, in your SaveCellInfo event handler, is e.Style.Tag empty?
AD
Administrator
Syncfusion Team
April 13, 2005 02:09 PM UTC
In the DropDownUserCell OnSaveChanges method I added the following code:
this.StyleInfo.Tag = ddUser.GetValues();
I have tried many variations (including setting the tag on the model for the cell).
In my on save event when I read the cells e.Style.Tag it is undefined.
AD
Administrator
Syncfusion Team
April 13, 2005 03:01 PM UTC
In OnSaveChanges, try putting the Tag directly into the grid.
this.Grid.Model[RowIndex,ColIndex].Tag = ddUser.GetValues();
AD
Administrator
Syncfusion Team
April 13, 2005 04:11 PM UTC
See my original post that is what I tried at first.
AD
Administrator
Syncfusion Team
April 13, 2005 05:20 PM UTC
Here is the sample we ship modified to use a GridDataBoundGrid. The Tag set in renderer.OnSaveChanges makes it to the grid.Model.SaveCellInfo eventhandler in this sample for me using 3.0.1.0. Does it for you? What are you doing differently?
http://www.syncfusion.com/Support/user/uploads/CS-forum042004.zip