Set value and lost the style

Dec 9, 2014 at 11:32 PM
If just set the full row style and then set one of the row's cell value then it will lost the cell style.
Dec 9, 2014 at 11:36 PM
Edited Dec 9, 2014 at 11:53 PM
And another issue is when the row doesn't have a style and then try get the row style ,it will not found and throw a new exception.

This looks like is ok,but has problem.
   public ExcelStyle Style
        {
            get
            {
                uint? styleIdx = null;
                Row r = _wsheet.GetRow(_row);
                if (r != null)
                    styleIdx = r.StyleIndex; //Here will throw new exception.
                return new ExcelStyle(this, _wsheet.Document.Styles, styleIdx);
            }
Error in implicit conversion. Cannot convert null object.

And I adviced you can do like this
  uint? styleIdx = null;
                Row r = _wsheet.GetRow(_row);
                if (r != null)
                {
                    if (r.StyleIndex == null)
                        styleIdx = null;
                    else
                        styleIdx = r.StyleIndex;
                }