OgrLayer categories not applying

I am loading the linear data from Sqlite data and applied the categories based on attribute value for that layer. After that, I have placed the linear feature on map and updated the required attributes. After placement not updated the style on feature. The linear feature showing default drawing style.
There is no issue with shapefile, I can able to view the category symbology while placement.
Could you please suggest how to apply the category while placement in OgrLayer .

Are you still struggling with this?
I haven’t used SpatialLite data a lot myself, but will try to come up with some sample code if needed.

Did you had a look at OgrLayer.GenerateCategories()? It also had an example.

Hi,

I have created the categories based on the unique field value for the featureclass at the time of loading the featureclass from Sqlite as a OGR layer. After loading i have placed a linear feature and updated the attribute value, but not updated the symbology on Map.
Below is the code for generating the category while loading the data from sqlite
Ex: Created Category lamp(group and type fields combination) and shapefile is a OGR Layer
ShapefileCategory ct = null;
ct = shapefile.GetBuffer().Categories.Add(“lamp”);
ct.Expression=[group=11 AND type=21];
tkDashStyle objDashStyle = new tkDashStyle();

objDashStyle = tkDashStyle.dsDashDot;

pattern.AddLine(16777215, 2.0, objDashStyle);
ct.DrawingOptions.LinePattern = pattern;
ct.DrawingOptions.UseLinePattern = true;
shapefile.GetBuffer().Categories.ApplyExpressions();

After loading

I placed a linear shape and added into ogrlayer with required attribute information(group=11 and type=21), but not reflect the symbology on map.
If i call the shapefile.GetBuffer().Categories.ApplyExpressions(); also not working

Please help me on this problem.

Thank you